2
0
Fork 0
wuttjamaican/docs/index.rst
Lance Edgar 005f43d14e Add basic command line framework
`wutta setup` is the only real sub/command yet, and it does nothing
2023-11-19 14:22:25 -06:00

78 lines
1.7 KiB
ReStructuredText

WuttJamaican
============
aka. Whatcha Makin
This package provides a "base layer" of sorts, for apps built with it.
It mostly is a distillation of certain patterns developed within the
Rattail Project, which are deemed generally useful. (At least,
according to the author.) It roughly corresponds to the "base layer"
as described in the Rattail Manual (see :doc:`rattail-manual:base/index`).
Good documentation and 100% test coverage are priorities for this project.
Much remains to be done, and it may be slow going since I'll be trying
to incorporate this package into the main Rattail package along the
way. So we'll see where this goes...
Main points of focus so far are the configuration and command line
interfaces.
Basic Usage
-----------
Install with:
.. code-block:: sh
pip install wuttjamaican
Create a config file, e.g. ``my.conf``:
.. code-block:: ini
[foo]
bar = A
baz = 2
feature = true
words = the quick brown fox
In your app, load the config and reference its values as needed::
from wuttjamaican.conf import make_config
config = make_config('/path/to/my.conf')
# this call.. ..returns this value
config.get('foo.bar') # 'A'
config.get('foo.baz') # '2'
config.get_int('foo.baz') # 2
config.get('foo.feature') # 'true'
config.get_bool('foo.feature') # True
config.get('foo.words') # 'the quick brown fox'
config.get_list('foo.words') # ['the', 'quick', 'brown', 'fox']
Contents
--------
.. toctree::
:maxdepth: 3
api/index
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`