Skip to main content

deric — DEclarative RIch Cli

Minimal library to build CLI apps with integrated TOML config file.

Goals

  • Minimal and useful
  • Subcommand support
  • Type checked arguments
  • Integrated logging handling
  • Reuse existing proved libraries: pydantic and rich
  • Use either CLI args, environment variables or TOML configuration (or a mix of them)

Usage

simple_app.py:

from deric import Command, arg

# define a simple app
class SimpleApp(Command):
  name = "your_simple_app"
  description = "Print a value and exit"

  Config = {
    "string": arg(str, ..., "value to print")
    "value": arg(int, 4, "value to print")
  }

  def run(self, config):
    print(config.string, config.value * 2)

SimpleApp().start()

Run it with:

python simple_app.py --string "some string" --value 21

Metadata

Release files for deric 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deric 0.2.3
File Size Uploaded
deric-0.2.3.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deric 0.2.3
File Interpreter ABI Platform
deric-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / deric-0.2.3.tar.gz

Download URL deric-0.2.3.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
40d4037db57168310bbecc3c049629e4a5f33a873d890071d3434a8a6d8e9dc5
BLAKE2b-256 checksum
How to use checksums
dcf43b46cfdbc6a8fdb471ae131f34b784bf911b30dd0a9b1387c8156c2dcfcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1018-azure

Release files / deric-0.2.3-py3-none-any.whl

Download URL deric-0.2.3-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d8cc4c7223acb138a644594070392804e16dd63dd39aee03810da9891275e3a
BLAKE2b-256 checksum
How to use checksums
50c5fbe31556f86379cbaa85dbaa3b084b4791b429edd06be64b8378b6940560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1018-azure

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page