metapkg – Simplify Python Project Metadata Management
metapkg is a fast, intuitive CLI tool designed to streamline Python project metadata management. It simplifies creating, updating, and maintaining pyproject.toml, managing dependencies, and preparing your project for PyPI publishing.
Whether you're starting a new project or maintaining an existing one, metapkg keeps your metadata organized and your workflow efficient.
🚀 Features
- Initialize Projects: Create a
pyproject.tomlfile withmetapkg init. - Manage Dependencies: Add or remove dependencies with
metapkg addandmetapkg remove. - Scan Imports: Detect missing dependencies in your code with
metapkg scan. - Generate Requirements: Auto-generate
requirements.txtwithmetapkg reqs. - Sync Environment: Install dependencies from
pyproject.tomlwithmetapkg sync. - Check PyPI Readiness: Validate
pyproject.tomlfor publishing withmetapkg check.
🔧 Installation
metapkg requires Python 3.12 or higher. It is recommended to use a virtual environment.
Install via PyPI
pip install metapkg
Install from Source
git clone https://github.com/yourusername/metapkg.git
cd metapkg
python -m pip install -e .
Verify Installation
metapkg --help
📋 Usage
Run metapkg --help to see all available commands.
Initialize a New Project
metapkg init
Example Interaction:
/path/to/project/pyproject.toml already exists. Overwrite? [y/N]: y
Project name [my-project]: my-project
Version [0.1.0]:
Description []: My Python project
Author []: Jane Doe
License [MIT]:
Minimum Python version (e.g., >=3.8, ==3.12) [>=3.8]: >=3.12
Build backend (setuptools, hatchling, flit) [setuptools]:
Writing to /path/to/project/pyproject.toml
Successfully created /path/to/project/pyproject.toml
Add a Dependency
metapkg add requests>=2.28.1
Output:
Checking for pyproject.toml at /path/to/project/pyproject.toml
Writing to /path/to/project/pyproject.toml
Added requests>=2.28.1 to pyproject.toml
Remove a Dependency
metapkg remove requests
Output:
Checking for pyproject.toml at /path/to/project/pyproject.toml
Writing to /path/to/project/pyproject.toml
Removed requests from pyproject.toml
Scan Code for Imports
echo 'import pandas' > analysis.py
metapkg scan
Output:
Checking for pyproject.toml at /path/to/project/pyproject.toml
Missing dependencies detected:
- pandas
Add missing dependencies to pyproject.toml? [y/N]: y
Writing to /path/to/project/pyproject.toml
Updated /path/to/project/pyproject.toml with missing dependencies.
Generate requirements.txt
metapkg reqs
Output:
Checking for pyproject.toml at /path/to/project/pyproject.toml
Generated requirements.txt
Generated requirements.txt:
requests>=2.28.1
pandas>=2.0.0
Sync Dependencies
metapkg sync
Output:
Checking for pyproject.toml at /path/to/project/pyproject.toml
Successfully installed missing dependencies.
Check PyPI Readiness
metapkg check
Output:
Checking for pyproject.toml at /path/to/project/pyproject.toml
pyproject.toml is ready for PyPI publishing!
If issues are found:
Warnings found in pyproject.toml:
- Missing recommended field: classifiers (useful for PyPI categorization)
🛠️ Example Workflow
Set up a new Python project with metapkg:
mkdir my-project
cd my-project
python -m venv venv
source venv/bin/activate
pip install metapkg
metapkg init
metapkg add flask>=2.0.0
echo 'import pandas' > app.py
metapkg scan
metapkg sync
metapkg reqs
metapkg check
This will:
- Create a project
- Add
flask - Detect
pandas - Install dependencies
- Generate
requirements.txt - Verify PyPI readiness
🤝 Contributing
We welcome contributions! To get started:
-
Fork the repository: github.com/yourusername/metapkg
-
Create a branch:
git checkout -b feature/your-feature
-
Commit changes:
git commit -m "Add your feature"
-
Push to your fork:
git push origin feature/your-feature
-
Open a pull request
See our CONTRIBUTING.md for more details.
📬 Feedback & Issues
Found a bug or have a feature request? Open an issue on GitHub: github.com/yourusername/metapkg/issues
Please use the issue templates to provide clear and actionable reports.
📝 License
metapkg is licensed under the MIT License.
Let’s make Python project management simpler, together!
Metadata
Release files for metapkg 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| metapkg-0.1.3.tar.gz | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metapkg-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.9 kB
Release files / metapkg-0.1.3.tar.gz
| Download URL | metapkg-0.1.3.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bee3f0c56c2ecbb2190bf86335ab3c336b039ea5c3fde5fc44e33ddc7377efdb
|
|
BLAKE2b-256 checksum How to use checksums |
cafc96b9375651fa47703fd076606e3ce18d3b026d9b96ea3887cc4ca01cb4c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / metapkg-0.1.3-py3-none-any.whl
| Download URL | metapkg-0.1.3-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e51f9f50f2a03bbf8836e28ef6c4059af786ceb861bd85ca632590de9e433c3
|
|
BLAKE2b-256 checksum How to use checksums |
393d42b74c505d1eeb4891fbc27ea8a5e0089e05a3a6b85cf2d941eba6186cba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|