fleks | |
Python application framework |
(This is experimental; API-stability is not guaranteed.)
Application framework for python.
- CLI parsing with click
- Console output with rich
- Plugin Framework
- Exit-handlers, conventions for handling logging, etc
See pypi for available releases.
pip install fleks
See also the unit-tests for some examples of library usage.
>>> from fleks import tagging
>>> class MyClass(): pass
>>> tagging.tags(key="Value")(MyClass)
<class '__main__.MyClass'>
>>> assert tagging.tags[MyClass]['key']=="Value"
>>>
>>> import fleks
>>> class Test:
... @fleks.classproperty
... def testing(kls):
... return 42
>>> assert Test.testing==42
>>>
fleks.util.typing collects common imports and annotation-types, i.e. various optional/composite types used in type-hints, underneath one convenient namespace. This includes stuff from:
>>> from fleks import typing
>>> print(sorted([name for name in dir(typing) if name.title()==name]))
['Annotated', 'Any', 'Awaitable', 'Bool', 'Callable', 'Collection', 'Container', 'Coroutine', 'Counter', 'Deque', 'Dict', 'Field', 'Final', 'Generator', 'Generic', 'Hashable', 'Iterable', 'Iterator', 'List', 'Literal', 'Mapping', 'Match', 'Namespace', 'Optional', 'Pattern', 'Protocol', 'Reversible', 'Sequence', 'Set', 'Sized', 'Text', 'Tuple', 'Type', 'Union']
>>>
>>> from fleks import Config
>>>