Nm Parseltongue Python Packaging
by @athola
Python package creation and PyPI distribution via pyproject.toml and entry points
clawhub install nm-parseltongue-python-packagingπ About This Skill
name: python-packaging description: | Python package creation and distribution: pyproject.toml, entry points, PyPI publishing, CI/CD version: 1.9.4 triggers: - python - packaging - pyproject.toml - uv - pip - pypi - distribution metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/parseltongue", "emoji": "\ud83e\udd9e"}} source: claude-night-market source_plugin: parseltongue
> Night Market Skill β ported from claude-night-market/parseltongue. For the full experience with agents, hooks, and commands, install the Claude Code plugin.
Table of Contents
Python Packaging
Modern Python packaging with pyproject.toml, uv, and best practices for distribution.
Quick Start
# Create new project with uv
uv init my-package
cd my-packageAdd dependencies
uv add requests clickBuild package
uv buildPublish to PyPI
uv publish
Verification: Run the command with --help flag to verify availability.When To Use
When NOT To Use
Core Decisions
1. Layout Choice
# Source layout (recommended)
src/my_package/
__init__.py
module.pyFlat layout (simple)
my_package/
__init__.py
module.py
Verification: Run the command with --help flag to verify availability.Source layout benefits:
2. Project Structure
Minimal Project:
Verification: Run pytest -v to verify tests pass.
my-project/
βββ pyproject.toml
βββ README.md
βββ src/
β βββ my_package/
β βββ __init__.py
βββ tests/
βββ test_init.py
Verification: Run pytest -v to verify tests pass.Complete Project:
Verification: Run the command with --help flag to verify availability.
my-project/
βββ pyproject.toml
βββ README.md
βββ LICENSE
βββ .gitignore
βββ src/
β βββ my_package/
β βββ __init__.py
β βββ cli.py
β βββ core.py
β βββ utils.py
βββ tests/
β βββ conftest.py
β βββ test_core.py
βββ docs/
βββ index.md
Verification: Run pytest -v to verify tests pass.Detailed Topics
See modules for detailed information:
Best Practices
1. Use source layout for anything beyond simple packages 2. Pin direct dependencies with minimum versions 3. Use optional dependency groups for dev/docs/test 4. Include py.typed for type hint support 5. Add detailed README with usage examples 6. Use semantic versioning (MAJOR.MINOR.PATCH) 7. Test on multiple Python versions before publishing
Exit Criteria
β‘ When to Use
π‘ Examples
# Create new project with uv
uv init my-package
cd my-packageAdd dependencies
uv add requests clickBuild package
uv buildPublish to PyPI
uv publish
Verification: Run the command with --help flag to verify availability.π Tips & Best Practices
1. Use source layout for anything beyond simple packages 2. Pin direct dependencies with minimum versions 3. Use optional dependency groups for dev/docs/test 4. Include py.typed for type hint support 5. Add detailed README with usage examples 6. Use semantic versioning (MAJOR.MINOR.PATCH) 7. Test on multiple Python versions before publishing