# Package Python Projects for Distribution

Python packaging choices are easy to misconfigure. This skill gives structured examples for layouts, metadata, builds, publishing, and release checks.

## Install

```bash
npx skillstore add activeinferenceinstitute/python-packaging
```

## Metadata

- Status: approved
- Slug: activeinferenceinstitute-python-packaging
- Skillstore revision: r1
- Version status: missing
- Tree hash: 69fce35730164cf86562035c3a0e8f46f9134e838e53a6e66a3341218c5e12ee
- Author: ActiveInferenceInstitute
- GitHub username: ActiveInferenceInstitute
- License: MIT
- Repository: https://github.com/ActiveInferenceInstitute/Journal-Utilities/tree/main/.claude/skills/python-packaging
- Ref: d46e62089a6dfc9e14ea02eebd9b8e2ad2dfe1f4
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network, filesystem
- Quality score: 77
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/activeinferenceinstitute-python-packaging
- Manifest: https://skillstore.pages.dev/api/skills/activeinferenceinstitute-python-packaging/manifest

## Capabilities

- Compare source, flat, and multi-package Python project layouts.
- Provide pyproject.toml patterns for metadata, dependencies, tooling, and build backends.
- Show how to package command-line tools with Click or argparse entry points.
- Outline wheel and source distribution builds with build and twine checks.
- Describe PyPI, TestPyPI, private index, and GitHub Actions publishing flows.
- Include README, MANIFEST.in, versioning, and release checklist guidance.

## Use Cases

- Package a New Library: Plan a clean project layout, metadata, dependencies, and build configuration for a reusable Python library.
- Prepare a CLI Release: Define entry points, install behavior, release artifacts, and validation steps for a command-line package.
- Standardize Publishing Workflows: Create repeatable PyPI, TestPyPI, private index, and GitHub Actions release practices.

## Prompt Templates

### Create a Package Plan

```
Help me package a small Python library. Recommend a layout, metadata fields, dependencies, tests, and build steps.
```

### Convert a Script to a CLI

```
Turn my Python script into an installable CLI package. Include entry point guidance and release checks.
```

### Review Packaging Metadata

```
Review my Python package metadata and release checklist. Identify missing classifiers, files, dependencies, and publishing risks.
```

### Design Release Automation

```
Design a secure Python package release workflow for TestPyPI, PyPI, wheels, source distributions, and CI secrets.
```

## Limitations

- It provides guidance and examples; it does not publish packages automatically.
- Example names, URLs, tokens, and versions must be replaced before use.
- It does not audit dependencies for vulnerabilities or license conflicts.
- It is not a substitute for current PyPA documentation for policy changes.

## Best Practices

- Use a source layout for reusable packages and test installation in a clean environment.
- Keep package metadata, dependencies, classifiers, and project URLs current before release.
- Use scoped tokens, CI secrets, or trusted publishing for release credentials.

## Anti Patterns

- Copying example package names, URLs, or credentials without replacing placeholders.
- Publishing directly to PyPI before testing artifacts on TestPyPI.
- Shipping packages without a license, README, tests, or reproducible build steps.

## Security Audit

- Audited at: 2026-07-07T17:59:13.716\+00:00
- Summary: Static analysis mostly flagged Markdown backticks, code examples, placeholder URLs, and standard packaging guidance. Review found a documentation-only skill with no executable helper scripts, prompt injection text, or evidence of unauthorized secret access. Credential examples should still be clearer about safe token handling.

## Stats

- Views: 315
- Downloads: 10
- Favorites: 0
- Popularity score: 0
