A comprehensive tool for Python package management
Project description
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 packagestwine: For uploading to PyPIflake8: For lintingblack: For code formattingisort: For import sortingmypy: For type checkingpytest: For testing
๐ค Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
- ๐ Report Issues
- ๐ก Request Features
- ๐ Documentation
Made with โค๏ธ for the Python community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pypackhelper-0.1.0.tar.gz.
File metadata
- Download URL: pypackhelper-0.1.0.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b81483df599da10707c841c480dfe2c8e8057002a12907dc16f94b531e104cda
|
|
| MD5 |
a2063453cf6218c2e1da09bad2fb2a3c
|
|
| BLAKE2b-256 |
7b712d9ea361755eca4a24fdb0c689c6b058dc7e66c28d8ef0d9d320b6732611
|
File details
Details for the file pypackhelper-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: pypackhelper-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 21.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f80d85ca89e7093e5ef94a28a167dea62c2ddc8e8d13795a61d3bd143c292312
|
|
| MD5 |
5c8ce14ec71905000a641c78c2bba8e3
|
|
| BLAKE2b-256 |
d524828b66e239db45f1b01bb6cd4261b61d28fe820a6faf624dfd6a236fed48
|