Skip to main content

PyPackHelper

A comprehensive command-line tool for Python package management that simplifies creating, validating, versioning, and uploading Python packages to PyPI.

🚀 Features

  • Package Initialization: Create new Python packages with proper structure
  • Code Validation: Automated linting and testing with flake8, black, isort, mypy, and pytest
  • Version Management: Semantic version bumping (major.minor.patch)
  • Automated Upload: Upload to PyPI and TestPyPI with twine
  • GitHub Actions: Generate CI/CD workflows
  • Environment Management: Support for .env files and credentials

📦 Installation

pip install pypackhelper

For development features:

pip install pypackhelper[dev]

For all features:

pip install pypackhelper[full]

🛠️ Usage

Initialize a New Package

pyph init mypackage --author "Your Name" --email "your@email.com"

Options:

  • --path, -p: Target directory (default: current)
  • --author, -a: Package author
  • --email, -e: Author email
  • --description, -d: Package description
  • --license, -l: License type (default: MIT)
  • --github-actions/--no-github-actions: Generate GitHub Actions workflow

Validate Package

pyph validate

Options:

  • --path, -p: Package directory (default: current)
  • --lint-only: Run only linting checks
  • --test-only: Run only tests
  • --strict: Strict validation mode

Version Management

# Show current version
pyph version

# Bump version
pyph bump patch    # 1.0.0 -> 1.0.1
pyph bump minor    # 1.0.0 -> 1.1.0  
pyph bump major    # 1.0.0 -> 2.0.0

Options:

  • --path, -p: Package directory (default: current)
  • --dry-run: Show what would be changed without making changes

Build Package

pyph build

Options:

  • --path, -p: Package directory (default: current)
  • --clean/--no-clean: Clean build directories before building

Upload to PyPI

# Upload to TestPyPI (for testing)
pyph upload --test

# Upload to PyPI
pyph upload

Options:

  • --test: Upload to TestPyPI instead of PyPI
  • --path, -p: Package directory (default: current)
  • --skip-validation: Skip validation before upload
  • --skip-build: Skip building package
  • --clean/--no-clean: Clean build directories after upload

Clean Build Files

pyph clean

⚙️ Configuration

Environment Variables

Create a .env file in your package root:

# PyPI credentials
PYPI_USERNAME=__token__
PYPI_TOKEN=your_pypi_token_here

# TestPyPI credentials  
TESTPYPI_USERNAME=__token__
TESTPYPI_TOKEN=your_testpypi_token_here

Package Structure Created

mypackage/
├── mypackage/
│   ├── __init__.py
│   ├── main.py
│   └── cli.py
├── tests/
│   ├── __init__.py
│   ├── conftest.py
│   └── test_main.py
├── .github/
│   └── workflows/
│       └── ci.yml
├── setup.py
├── pyproject.toml
├── requirements.txt
├── requirements-dev.txt
├── README.md
├── LICENSE
├── .gitignore
├── .env.example
└── setup.cfg

🔧 Development

Setup Development Environment

# Clone the repository
git clone https://github.com/Okymi-X/PyPackHelper.git
cd PyPackHelper

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

Running Tests

pytest

Code Quality

# Format code
black pyph/
isort pyph/

# Lint code
flake8 pyph/

# Type checking
mypy pyph/

📋 Requirements

  • Python 3.8+
  • Dependencies automatically managed

Optional Dependencies

For full functionality, install:

  • build: For building packages
  • twine: For uploading to PyPI
  • flake8: For linting
  • black: For code formatting
  • isort: For import sorting
  • mypy: For type checking
  • pytest: For testing

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Typer for the excellent CLI framework
  • setuptools and build for packaging
  • twine for PyPI uploads
  • The Python packaging community

📞 Support


Made with ❤️ for the Python community

Metadata

Release files for pypackhelper 0.1.0

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

Source distribution (sdist)

Source distribution for pypackhelper 0.1.0
File Size Uploaded
pypackhelper-0.1.0.tar.gz 27.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypackhelper 0.1.0
File Interpreter ABI Platform
pypackhelper-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 49.1 kB

Release files / pypackhelper-0.1.0.tar.gz

Download URL pypackhelper-0.1.0.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b81483df599da10707c841c480dfe2c8e8057002a12907dc16f94b531e104cda
BLAKE2b-256 checksum
How to use checksums
7b712d9ea361755eca4a24fdb0c689c6b058dc7e66c28d8ef0d9d320b6732611
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pypackhelper-0.1.0-py2.py3-none-any.whl

Download URL pypackhelper-0.1.0-py2.py3-none-any.whl
Size 21.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f80d85ca89e7093e5ef94a28a167dea62c2ddc8e8d13795a61d3bd143c292312
BLAKE2b-256 checksum
How to use checksums
d524828b66e239db45f1b01bb6cd4261b61d28fe820a6faf624dfd6a236fed48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

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