Skip to main content

apdev (Python)

General-purpose development tools for Python projects.

Installation

pip install apdev

For development:

pip install apdev[dev]

Tools

check-chars

Validate that files contain only allowed characters (ASCII, common emoji, and technical symbols like arrows and box-drawing characters).

# Check default project directories (src/, tests/, examples/) and config files
apdev check-chars

# Check a directory recursively
apdev check-chars src/

# Check specific files
apdev check-chars src/mypackage/*.py

# Enable extra charset (e.g. Chinese characters)
apdev check-chars --charset chinese src/

Options:

  • --charset <name> — Enable a built-in charset preset (repeatable, e.g. chinese)
  • --charset-file <path> — Load a custom charset JSON file (repeatable)
  • Environment variable APDEV_EXTRA_CHARS — Comma-separated list of charset names or file paths, used when no --charset/--charset-file is given

check-imports

Detect circular imports in a Python package.

# Specify package explicitly
apdev check-imports --package mypackage --src-dir src

# Or configure in pyproject.toml (see Configuration below)
apdev check-imports

release

Interactive release automation for publishing Python packages to PyPI and GitHub. Auto-detects project name from pyproject.toml and GitHub repo from git remote.

From the project root, apdev release uses the project's .venv automatically when no virtual environment is active. Install build, pip, and twine in the environment used for release.

# Run with auto-detected version from pyproject.toml
apdev release

# Or specify version explicitly
apdev release 0.2.0

# Upload to a named .pypirc section (default: [tool.apdev] pypi_repository, or "pypi")
apdev release --repository reachreel
apdev release -r testpypi 0.3.0

The command provides an interactive menu with steps:

  1. Version verification (checks pyproject.toml and __init__.py match)
  2. Status check (tag, build files, PyPI)
  3. Clean build files
  4. Build package (python -m build)
  5. Check package (twine check)
  6. Create git tag and push
  7. Create GitHub release (via gh CLI or API)
  8. Upload to PyPI (twine upload -r <repository> dist/*)

Which ~/.pypirc section is used, in order of precedence:

  1. --repository NAME / -r NAME
  2. PYPI_REPOSITORY environment variable
  3. [tool.apdev] pypi_repository in pyproject.toml
  4. the default [pypi] section

The resolved section is printed in the header before anything is uploaded, so a second PyPI account is never a guess:

# ~/.pypirc
[distutils]
index-servers =
    pypi
    reachreel

[pypi]
username = __token__
password = pypi-A...        # account A

[reachreel]
repository = https://upload.pypi.org/legacy/
username = __token__
password = pypi-B...        # account B

Override auto-detection with environment variables:

PROJECT_NAME=mypackage GITHUB_REPO=owner/repo apdev release

Configuration

Add to your project's pyproject.toml so commands can run without CLI arguments:

[tool.apdev]
base_package = "mypackage"    # Required by check-imports
src_dir = "src"               # Source directory (default: "src")
pypi_repository = "mypackage" # .pypirc section for `apdev release` (default: "pypi")

With this config, the commands work out of the box:

apdev check-chars    # Checks default project directories and config files
apdev check-imports  # Reads base_package / src_dir from pyproject.toml
apdev release        # Reads pypi_repository, so the right PyPI account is used

Pre-commit Integration

repos:
  - repo: https://github.com/aiperceivable/apdev
    rev: python/v0.1.0
    hooks:
      - id: check-chars
      - id: check-imports

Or 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: true

License

Apache-2.0

Metadata

Release files for apdev 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apdev 0.2.6
File Size Uploaded Provenance Actions
apdev-0.2.6.tar.gz 27.9 kB Without provenance Details for apdev-0.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apdev 0.2.6
File Interpreter ABI Platform Actions
apdev-0.2.6-py3-none-any.whl Python 3 none any Details for apdev-0.2.6-py3-none-any.whl

Total release size: 50.0 kB

Release files / apdev-0.2.6.tar.gz

Download URL apdev-0.2.6.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9bc5a22217854160539e0039f165ca60ff5e4b9d964556b07df288c9778dbcca
BLAKE2b-256 checksum
How to use checksums
4b055600adbf6af59abe653ec454d2957da94c9be3aec23c9b5ed164ea38b8ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / apdev-0.2.6-py3-none-any.whl

Download URL apdev-0.2.6-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcb840738413dc40713428fb72873ef4a3011970873350315dffa143c8fdb92c
BLAKE2b-256 checksum
How to use checksums
cd6685f6f89d169c6a25aa66f99efb08197298e52ac80f888d211949a13e4c77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for apdev 0.2.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page