General-purpose development tools for Python projects.
pip install apdevFor development:
pip install apdev[dev]Validate that files contain only allowed characters (ASCII, common emoji, and technical symbols like arrows and box-drawing characters).
# Check specific files
apdev check-chars src/mypackage/*.py
# Use with pre-commit (see below)Detect circular imports in a Python package.
# Specify package explicitly
apdev check-imports --package mypackage --src-dir src
# Or configure in pyproject.toml (see below)
apdev check-importsInteractive release automation for publishing Python packages to PyPI and GitHub. Auto-detects project name from pyproject.toml and GitHub repo from git remote.
# Run with auto-detected version from pyproject.toml
apdev release
# Or specify version explicitly
apdev release 0.2.0The command provides an interactive menu with steps:
- Version verification (checks
pyproject.tomland__init__.pymatch) - Status check (tag, build files, PyPI)
- Clean build files
- Build package (
python -m build) - Check package (
twine check) - Create git tag and push
- Create GitHub release (via
ghCLI or API) - Upload to PyPI (
twine upload)
Override auto-detection with environment variables:
PROJECT_NAME=mypackage GITHUB_REPO=owner/repo apdev releaseAdd to your project's pyproject.toml:
[tool.apdev]
base_package = "mypackage"
src_dir = "src"repos:
- repo: https://github.com/aipartnerup/apdev
rev: python/v0.1.0
hooks:
- id: check-chars
- id: check-importsOr use as a local hook with the pip-installed package:
repos:
- repo: local
hooks:
- id: check-chars
name: apdev check-chars
entry: apdev check-chars
language: system
types_or: [text, python]
- id: check-imports
name: apdev check-imports
entry: apdev check-imports
language: system
pass_filenames: false
always_run: trueApache-2.0