Helpful tools for Logging, Typer, Pydantic, and Debugging
Project description
🛠️ pytools
A modular collection of Python utilities for Typer, Pydantic, and Debugging. Built for high-performance developer workflows using uv and hatchling.
pytools is designed as a "buffet" library—install only the submodules you need to keep your project dependencies lean.
🚀 Quick Start
Add pytools to your project using uv. You can choose specific "extras" to pull in only the dependencies required for that module.
# Install just the Typer utilities (and their deps)
uv add "pytools[typer] @ git+ssh://git@github.com/buchanan-solutions/pytools.git"
# Install everything
uv add "pytools[all] @ git+ssh://git@github.com/buchanan-solutions/pytools.git"
📦 Submodules
| Extra | Description | Key Dependencies |
|---|---|---|
core |
Foundational logic used by all modules. | None (Std Lib only) |
typer |
CLI helpers, context management, and rich logging. | typer, rich, python-dotenv |
pydantic |
Custom validators and base model configurations. | pydantic |
pydantic-settings |
Environment management and config loading. | pydantic-settings |
debugging |
Enhanced print utilities and object inspection. | icecream |
💡 Usage
Typer Context Helper
Easily grab objects from the Typer context in nested commands:
from pytools.typer.utils.get_from_ctx import get_from_ctx
from my_app.models import Config
@app.command()
def run(ctx: typer.Context):
# Traverses parent contexts automatically
config = get_from_ctx(ctx, "config", Config)
...
Enhanced Debugging
from pytools.debugging.debug_print import debug_print
data = {"status": "success", "meta": [1, 2, 3]}
debug_print(data) # Beautifully formatted terminal output
🛠️ Development
This project uses the src layout and hatchling backend.
# Clone and sync environment
git clone https://github.com/your-org/pytools.git
cd pytools
uv sync --all-extras
# Run tests
uv run pytest
📜 License
MIT © 2026 Buchanan Information Systems Inc.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file buchanan_solutions_pytools-0.2.3.tar.gz.
File metadata
- Download URL: buchanan_solutions_pytools-0.2.3.tar.gz
- Upload date:
- Size: 64.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.9 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bf2fc349ad42eca0cc258428d6b19b3bad71fb92024eddb8a666c73a44327b8
|
|
| MD5 |
550bfc5bba141ce6670e2a50f5b2b7f8
|
|
| BLAKE2b-256 |
1983b3f311ba29b6cb9940e5b7fbc9e30fa41208b52f3cadd797ca5880872204
|
File details
Details for the file buchanan_solutions_pytools-0.2.3-py3-none-any.whl.
File metadata
- Download URL: buchanan_solutions_pytools-0.2.3-py3-none-any.whl
- Upload date:
- Size: 44.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.9 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc1b2b954a74b5ba3ba87244d881e9b5ba4473dd992374a020a5ae77b92253ad
|
|
| MD5 |
2364387483be7fc82e2469d139e235e7
|
|
| BLAKE2b-256 |
e301192ded1c6b0ca671824fa2828952d0f2fef266db2c84322dcccbb7451441
|