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.

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

# Or specify version explicitly
apdev release 0.2.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)

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")

With this config, both 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

Pre-commit Integration

repos:
  - repo: https://github.com/aipartnerup/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.3

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.3
File Size Uploaded
apdev-0.2.3.tar.gz 25.3 kB Details

Built distribution (wheel)

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

Total release size: 46.4 kB

Release files / apdev-0.2.3.tar.gz

Download URL apdev-0.2.3.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
56f7e57dbfe729960a2e98b789eadaf77780fad6996b3694ad99f6d946bbdeb1
BLAKE2b-256 checksum
How to use checksums
3d9d217c4a4b853d0e760caf0f67cb3b591ca40e8266db1319a0d07009b33890
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

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

Download URL apdev-0.2.3-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5062eac2ce4eb291ab98e6470fd01334d4c4e62aee530e55c93bb725a22b7600
BLAKE2b-256 checksum
How to use checksums
0b720d4f8d13a8a7a5c878f71d31286037ba5e543b798f509835e512ec51fed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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