Skip to main content

Python application framework

Project description

fleks    
Python application framework

Overview

(This is experimental; API-stability is not guaranteed.)

Application framework for python.


Features

  • CLI parsing with click
  • Console output with rich
  • Plugin Framework
  • Exit-handlers, conventions for handling logging, etc

Installation

See pypi for available releases.

pip install fleks

Usage

See also the unit-tests for some examples of library usage.

Tags & Tagging

>>> from fleks import tagging
>>> class MyClass(): pass
>>> tagging.tags(key="Value")(MyClass)
<class '__main__.MyClass'>
>>> assert tagging.tags[MyClass]['key']=="Value"
>>>

Class-Properties

>>> import fleks 
>>> class Test:
...   @fleks.classproperty 
...   def testing(kls):
...      return 42
>>> assert Test.testing==42
>>>

Typing helpers

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']
>>>

Base-classes for Configuration

>>> from fleks import Config
>>>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fleks-2024.4.26.8.26.tar.gz (16.2 kB view hashes)

Uploaded Source

Built Distribution

fleks-2024.4.26.8.26-py3-none-any.whl (18.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page