Pythion
Pythion is a command-line interface (CLI) tool designed to assist Python developers by generating documentation strings using AI. With an easy-to-use interface built on the Click library, Pythion provides a seamless way to enhance your Python projects with well-structured docstrings and documentation management.
Features
- Generate documentation strings for Python functions and classes.
- Create and manage documentation in batches
- Flexible options to include or exclude already documented functions.
- Automatically generate intelligent commit messages based on staged changes.
- Easily bump version numbers in your projects.
Table of Contents
Installation
You can install Pythion via pip. Open your terminal and enter:
pip install pythion
Usage
After installing Pythion, you can invoke the command-line tool as follows:
pythion [OPTIONS] COMMAND [ARGS]…
Commands
1. docs
Generates and manages docstrings for Python projects.
pythion docs <root_dir> [--custom-instruction <instruction>] [--profile <profile>]
- Arguments:
root_dir: The path to the root directory containing the Python files to analyze.
- Options:
--custom-instruction: Custom instructions for generating docstrings.--profile: Choose a predefined instruction set such asfastapiorcli.
Example:
pythion docs /path/to/project --custom-instruction "Use concise language."
2. module_docs
Generates documentation for Python modules.
pythion module_docs <root_dir> [--custom-instruction <instruction>]
- Arguments:
root_dir: The root directory of the Python project.
- Options:
--custom-instruction: Custom instructions for module documentation generation.
Example:
pythion module_docs /path/to/project --custom-instruction "Include examples in docstrings."
3. build-cache
Creates a documentation cache for functions and methods in a specified directory.
pythion build-cache <root_dir> [--use_all] [--dry]
- Arguments:
root_dir: The directory path containing Python files.
- Options:
--use_all: Generates docstrings for all functions, or only those without docstrings.--dry: Performs a dry run without generating any documentation.
Example:
pythion build-cache /path/to/dir --use_all --dry
4. iter-docs
Iterates through the docstring cache and apply them to objects
pythion iter-docs <root_dir></root_dir>
- Arguments:
root_dir: The path to the directory containing documents to be iterated.
Example:
pythion iter-docs /path/to/dir
5. make-commit
Generates a commit message based on staged changes.
pythion make-commit [--custom-instruction <instruction>] [--profile <profile>]
- Options:
--custom-instruction: Custom instructions for generating the commit message.--profile: (Optional) Select a predefined instruction set.
Example:
pythion make-commit --custom-instruction "Don't mention version updates"
6. bump-version
Bumps version numbers in a specified version file.
pythion bump-version --version-regex <pattern> --file-path <file>
- Arguments:
--version-regex: Regex pattern to match the version string.--file-path: Full path to the file containing the version string.
Example:
pythion bump-version --version-regex 'version="(.\*?)"' --file-path '/path/to/version_file.txt'
NOTES
- You must have an OpenAI API key saved on your environment for the key
OPENAI_API_KEY.
Metadata
Release files for pythion 1.0.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pythion-1.0.27.tar.gz | 30.2 kB | Without provenance | Details for pythion-1.0.27.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pythion-1.0.27-py3-none-any.whl | Python 3 | none | any | Details for pythion-1.0.27-py3-none-any.whl |
Total release size: 64.8 kB
Release files / pythion-1.0.27.tar.gz
| Download URL | pythion-1.0.27.tar.gz |
|---|---|
| Size | 30.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2d01aa6c99a1dad44d87963dd24ad64ea6e99f169796073acfb9458925fa403
|
|
BLAKE2b-256 checksum How to use checksums |
8917161a7f373089b0680f6631555e276fb33f393af4240f4a6dea2957e4057c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / pythion-1.0.27-py3-none-any.whl
| Download URL | pythion-1.0.27-py3-none-any.whl |
|---|---|
| Size | 34.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd4a072b33d21b3a0610f4070972c6e0508503ba017efae73dd3b494e19ac739
|
|
BLAKE2b-256 checksum How to use checksums |
658446982ca0c5dcdc491138610016ff52bc3c26a8f1d9c183b1e120e0fbed44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for pythion 1.0.27
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.