Skip to main content

The click running on steroids

Project description

Sayer

Sayer logo

Fast. Scalable. Elegant. Command the CLI like a boss. 🧙‍♂️

Test Suite Package version Supported Python versions


Documentation: https://sayer.dymmond.com 📚

Source Code: https://github.com/dymmond/sayer

The official supported version is always the latest released.


🤔 What is Sayer?

Sayer is a modern, async-native Python CLI framework built for developers who want more:

  • More structure.
  • More power.
  • More expressiveness.

Less boilerplate. Less headache. Less "why doesn't this just work?".

Designed to scale from weekend scripts to enterprise-grade CLI suites — with a touch of magic.


📦 Installation

Using pip:

pip install sayer

Or with uv (blazing fast):

uv pip install sayer

🧩 Features

  • ✅ Fully async support out-of-the-box
  • ✅ Param metadata via Option(...), Argument(...), Env(...) — inspired by the best
  • ✅ Declarative CLI building with decorators
  • ✅ Built-in middleware system (yes, for CLI!)
  • ✅ Shared app state and lifecycle management
  • ✅ Terminal-rich output via rich
  • ✅ Easy testing with SayerTestClient
  • ✅ Flexible help and docs rendering
  • ✅ Clean project scaffolding, sensible defaults
  • ✅ 100% type annotated.

🔥 Why Sayer?

Feature Sayer Notes
Async Support ✅ Yes Truly async from top to bottom
Param Metadata ✅ Yes With rich options, env vars, etc.
Middleware Support ✅ Yes Per-command, app-wide, scoped
Lifecycle Hooks ✅ Yes on_startup, on_shutdown
State Management ✅ Yes Like a Flask g but better
Testability ✅ Yes CLI client for unit tests
Output Styling ✅ Yes Built-in rich integration
Based on Modern Tools ✅ Hatch + UV Modern dev setup from day 1
Full Typing ✅ Yes Mypy + Ruff compliant
Fun to Use? 🕺 Extremely Let the code dance with you

🚀 Getting Started

Create your first CLI app:

from sayer import Sayer, Option

app = Sayer()

@app.command()
def hello(name: str = Option(..., help="Your name")):
    """Say hello to someone"""
    print(f"Hello, {name}!")

if __name__ == "__main__":
    app()

Run it:

$ python app.py hello --name Ada
Hello, Ada!

🧪 Testing

hatch run test:test

Or with pytest:

pytest -v

📚 Documentation

Full docs available at: https://sayer.dymmond.com

You'll find:

  • Full API reference
  • Command examples
  • Parameter deep dives
  • Middleware patterns
  • Configuration strategies
  • ... and some fun easter eggs 🐣

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

sayer-0.7.6.tar.gz (64.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sayer-0.7.6-py3-none-any.whl (79.7 kB view details)

Uploaded Python 3

File details

Details for the file sayer-0.7.6.tar.gz.

File metadata

  • Download URL: sayer-0.7.6.tar.gz
  • Upload date:
  • Size: 64.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.10.19 HTTPX/0.28.1

File hashes

Hashes for sayer-0.7.6.tar.gz
Algorithm Hash digest
SHA256 5c120064252fc3becd5847a39f8ae2ab774734895cb7f897135e1c3556b97e13
MD5 976d9fb02072cc8ec12d83d5a98116e4
BLAKE2b-256 5e2cd4ec2f6abc27eddde62de95db8a33f6a5c38974c3c9fc8b1b112858a31c8

See more details on using hashes here.

File details

Details for the file sayer-0.7.6-py3-none-any.whl.

File metadata

  • Download URL: sayer-0.7.6-py3-none-any.whl
  • Upload date:
  • Size: 79.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.10.19 HTTPX/0.28.1

File hashes

Hashes for sayer-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5d2c8dae3a6e71db5663f3e8f09e3ca612bf127e5276a597e7413bc48064c48c
MD5 ad38afab5ff366bd5471ad033f2bcb20
BLAKE2b-256 223179e17c0bdc2916344b342f90ed1b8a83d841a39f6fec7e8f471be374b242

See more details on using hashes here.

Supported by

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