A modern Python CLI tool to scaffold and configure new Python library projects with best practices.
Project description
prysa is a modern Python CLI tool that helps you quickly scaffold and configure new Python library projects with best practices and essential tools. It is designed for ease of use, flexibility, and extensibility, making it the perfect starting point for your next Python library.
Features
- 📦 Project Initialization: Scaffold a new Python library project with a standard structure (
src/,tests/,README.md, etc.). - 🛠️ Tool Selection: Choose your preferred dependency manager (Poetry, pip, or uv), linter (Ruff or Pylint), and test framework (Pytest or Unittest).
- ⚡ Automatic Config Generation: Instantly generate configuration files for your selected tools.
- 🧩 Extensible: Easily add support for new tools by implementing simple abstractions or by writing plugins.
- 🔌 Plugin System: Discover and load external tools or features via a plugin extension system. Write your own plugins or use community ones!
- 🏗️ CLI Simplicity: Minimal, intuitive commands with sensible defaults.
Quick Start
Installation
Note: prysa uses Poetry for dependency management. Make sure you have Poetry installed:
curl -sSL https://install.python-poetry.org | python3 -
Clone the repository and install dependencies:
git clone https://github.com/yourusername/prysa.git
cd prysa
poetry install
Usage
Create a new Python library project with a specific dependency manager:
poetry run prysa new mylib --manager pip
This will create a folder mylib/ with:
src/andtests/directoriesREADME.md,LICENSE, and a minimalpyproject.tomlorrequirements.txt(depending on manager)
Supported managers:
- Poetry (default): creates
pyproject.toml - pip: creates
requirements.txt - uv: creates
requirements.txt
You can specify author, license, and description:
poetry run prysa new mylib --author "Jane Doe" --license MIT --desc "A test library"
If the directory exists, use --force to overwrite:
poetry run prysa new mylib --force
Create a new project and specify tools:
poetry run prysa new mylib --manager poetry --linter ruff --tester pytest
Add a linter to an existing project:
poetry run prysa add linter pylint
List available tools:
poetry run prysa list-tools
Show help:
poetry run prysa --help
Command Reference
new <project_name>: Scaffold a new Python library project.add <category> <tool>: Add a new tool (linter, manager, tester) to an existing project.remove <category> <tool>: Remove a tool from the project configuration.list-tools: List all available tools for each category.show-config: Display the current project configuration and selected tools.help [command]: Show help message and usage instructions.version: Show the current version of prysa.
CLI Design
prysa uses the Typer library for its CLI. Each command is implemented in its own module for clarity and maintainability. The CLI is easily extensible by adding new command modules and registering them in the main entrypoint.
Example CLI entrypoint (simplified):
import typer
from prysa.cli.commands import new, add, remove, list_tools, show_config
app = typer.Typer(help="prysa: Python project quickstart tool")
app.command()(new.new)
app.command()(add.add)
app.command()(remove.remove)
app.command()(list_tools.list_tools)
app.command()(show_config.show_config)
@app.command()
def version():
"""Show the current version of prysa."""
import importlib.metadata
try:
v = importlib.metadata.version("prysa")
except importlib.metadata.PackageNotFoundError:
v = "(local)"
typer.echo(f"prysa version: {v}")
if __name__ == "__main__":
app()
Why prysa?
- Fast: Get started in seconds with a single command.
- Flexible: Choose the tools that fit your workflow.
- Extensible: Add new tools and commands as your needs grow.
- Best Practices: Start every project with a solid foundation.
Testing
This project uses pytest and Typer's testing utilities to ensure all CLI commands and integrations work as expected.
Run all tests with:
poetry run pytest
Unit tests cover:
- CLI commands
- Project scaffolding
- Dependency manager integration
Contributing
Contributions are welcome! Please see the CONTRIBUTING.md (to be created) for guidelines.
License
prysa is inspired by the needs of modern Python developers who want to focus on building, not boilerplate.
Linter Integration
prysa supports modular linter integration. You can specify your preferred linter when creating a project:
poetry run prysa new mylib --linter ruff
poetry run prysa new mylib --linter pylint
This will generate the appropriate configuration file (ruff.toml or .pylintrc) in your project directory.
Supported linters:
- Ruff (default): creates
ruff.toml - Pylint: creates
.pylintrc
You can also add or remove linters in existing projects:
poetry run prysa add linter pylint
poetry run prysa remove linter ruff
To view available linters:
poetry run prysa list-tools
And to show the current configuration:
poetry run prysa show-config
For help on linter commands:
poetry run prysa help linter
Plugin Extension System
prysa supports a plugin extension system that allows you to add new tools (managers, linters, testers, etc.) or features without modifying the core codebase.
- Plugins are Python packages that implement the
PrysaPlugininterface and register themselves with prysa. - Plugins can be discovered automatically if installed in your environment and named with the
prysa_pluginsnamespace (e.g.,prysa_plugins.myplugin). - To write a plugin, subclass
PrysaPluginand implement theregister()method.
Example plugin skeleton:
from prysa.core.plugins import PrysaPlugin, plugin_registry
class MyCustomManager(PrysaPlugin):
name = "my_manager"
type = "manager"
def register(self):
# Register with prysa's manager registry here
pass
plugin_registry.register(MyCustomManager())
Plugin discovery:
- prysa will automatically discover and load plugins in the
prysa_pluginsnamespace when started. - You can also call
discover_plugins()fromprysa.core.pluginsto force plugin discovery.
See tests/test_plugins.py for example plugin tests.
Project details
Release history Release notifications | RSS feed
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 prysa-0.1.1.tar.gz.
File metadata
- Download URL: prysa-0.1.1.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.0-15-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d0942701b4b95aa261fc0b4e49b628543ca4c33672a9d778033b1f6f95ab883
|
|
| MD5 |
d4ceb55cc74a06eb33475f54c6b499a9
|
|
| BLAKE2b-256 |
7216c59e9bd7060623634fac42cacb5ef63bff23b7252ae6ad3c3cc3d71b82e0
|
File details
Details for the file prysa-0.1.1-py3-none-any.whl.
File metadata
- Download URL: prysa-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.0-15-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad5d2dfe5a65444fea0f15ee767d463475e9245d83d41d2a44c62031603b3f4f
|
|
| MD5 |
a02a4e2d0ab4842ad593e13f304ae428
|
|
| BLAKE2b-256 |
fbd1bea26db500bc42dfe49fec149e4ea1e1081534237c490fda56ea7db3bab1
|