मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)40k · #7352

python-pypi-package-builder

यह क्या करती है

यह guide आपको Python libraries बनाने, test करने और PyPI (Python package 'marketplace') पर publish करने में मदद करती है। इसमें code को व्यवस्थित करने से लेकर आख़िरी release तक सब कुछ शामिल है, ताकि आपका package ठीक से काम करे और दूसरे developers के लिए इस्तेमाल करना आसान हो।

कब इस्तेमाल करें

  • ✓जब आप पहली बार कोई Python library बनाकर दूसरों के साथ साझा करना चाहते हों।
  • ✓जब आपको कोई Python package PyPI पर publish करना हो।
  • ✓मौजूदा Python project को व्यवस्थित करने और test करने के लिए।

Skill का लिंक

https://github.com/github/awesome-copilot/blob/main/skills/python-pypi-package-builder/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/github/awesome-copilot/blob/main/skills/python-pypi-package-builder/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“'my_utility' नाम की Python library कैसे बनाऊँ और publish करूँ?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह guide आपको अपने code को व्यवस्थित करने का सबसे अच्छा तरीका और package बनाने, test करने और publish करने के लिए सही tools चुनने में मदद करती है। यह बताती है कि package का version कैसे रखें और 'type hints' जैसे आधुनिक features कैसे इस्तेमाल करें।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Python PyPI Package Builder Skill

A complete, battle-tested guide for building, testing, linting, versioning, typing, and publishing a production-grade Python library to PyPI — from first commit to community-ready release.

AI Agent Instruction: Read this entire file before writing a single line of code or creating any file. Every decision — layout, backend, versioning strategy, patterns, CI — has a decision rule here. Follow the decision trees in order. This skill applies to any Python package type (utility, SDK, CLI, plugin, data library). Do not skip sections.


Quick Navigation

Section in this file What it covers
1. Skill Trigger When to load this skill
2. Package Type Decision Identify what you are building
3. Folder Structure Decision src/ vs flat vs monorepo
4. Build Backend Decision setuptools / hatchling / flit / poetry
5. PyPA Packaging Flow The canonical publish pipeline
6. Project Structure Templates Full layouts for every option
7. Versioning Strategy PEP 440, semver, dynamic vs static
Reference file What it covers
references/pyproject-toml.md All four backend templates, setuptools_scm, py.typed, tool configs
references/library-patterns.md OOP/SOLID, type hints, core class design, factory, protocols, CLI
references/testing-quality.md conftest.py, unit/backend/async tests, ruff/mypy/pre-commit
references/ci-publishing.md ci.yml, publish.yml, Trusted Publishing, TestPyPI, CHANGELOG, release checklist
references/community-docs.md README, docstrings, CONTRIBUTING, SECURITY, anti-patterns, master checklist
references/architecture-patterns.md Backend system (plugin/strategy), config layer, transport layer, CLI, backend injection
references/versioning-strategy.md PEP 440, SemVer, pre-release, setuptools_scm deep-dive, flit static, decision engine
references/release-governance.md Branch strategy, branch protection, OIDC, tag author validation, prevent invalid tags
references/tooling-ruff.md Ruff-only setup (replaces black/isort), mypy config, pre-commit, asyncio_mode=auto

Scaffold script: run python skills/python-pypi-package-builder/scripts/scaffold.py --name your-package-name to generate the entire directory layout, stub files, and pyproject.toml in one command.


1. Skill Trigger

Load this skill whenever the user wants to:

  • Create, scaffold, or publish a Python package or library to PyPI
  • Build a pip-installable SDK, utility, CLI tool, or framework extension
  • Set up pyproject.toml, linting, mypy, pre-commit, or GitHub Actions for a Python project
  • Understand versioning (setuptools_scm, PEP 440, semver, static versioning)
  • Understand PyPA specs: py.typed, MANIFEST.in, RECORD, classifiers
  • Publish to PyPI using Trusted Publishing (OIDC) or API tokens
  • Refactor an existing package to follow modern Python packaging standards
  • Add type hints, protocols, ABCs, or dataclasses to a Python library
  • Apply OOP/SOLID design patterns to a Python package
  • Choose between build backends (setuptools, hatchling, flit, poetry)

Also trigger for phrases like: "build a Python SDK", "publish my library", "set up PyPI CI", "create a pip package", "how do I publish to PyPI", "pyproject.toml help", "PEP 561 typed", "setuptools_scm version", "semver Python", "PEP 440", "git tag release", "Trusted Publishing".


2. Package Type Decision

Identify what the user is building before writing any code. Each type has distinct patterns.

Decision Table

Type Core Pattern Entry Point Key Deps Example Packages
Utility library Module of pure functions + helpers Import API only Minimal arrow, humanize, boltons, more-itertools
API client / SDK Class with methods, auth, retry logic Import API only httpx or requests boto3, stripe-python, openai
CLI tool Command functions + argument parser [project.scripts] or [project.entry-points] click or typer black, ruff, httpie, rich

…

अक्सर पूछे जाने वाले सवाल

PyPI क्या है?

PyPI का मतलब है Python Package Index। यह एक online repository है जहाँ Python developers libraries (packages) publish और share करते हैं, ताकि दूसरे उन्हें अपने projects में install करके इस्तेमाल कर सकें।

'build backends' (setuptools, hatchling, flit, poetry) क्या हैं?

ये अलग-अलग tools हैं जिनसे Python आपके code को package में बदलता है, ताकि उसे pip से install किया जा सके और PyPI पर publish किया जा सके। हर tool के अपने फ़ायदे हैं।

'type hints' क्या होते हैं?

'Type hints' वे annotations हैं जो आप Python code में जोड़ते हैं ताकि पता चले कि कोई variable या function किस data type की उम्मीद करता है या लौटाता है। इससे गलतियाँ जल्दी पकड़ में आती हैं और code समझना आसान होता है।

जानकारी

लेखक का मूल विवरण

End-to-end skill for building, testing, linting, versioning, and publishing a production-grade Python library to PyPI. Covers all four build backends (setuptools+setuptools_scm, hatchling, flit, poetry), PEP 440 versioning, semantic versioning, dynamic git-tag versioning, OOP/SOLID design, type hints (PEP 484/526/544/561), Trusted Publishing (OIDC), and the full PyPA packaging flow. Use for: creat

repo: github/awesome-copilot

लोकप्रियता

GitHub स्टार
40k
रैंकिंग में स्थान
#7352
लाइसेंस
MIT
अपडेट की गई
15/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

acquire-codebase-knowledge

40k

आपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

acreadiness-assess

40k

आपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

acreadiness-generate-instructions

40k

आपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

acreadiness-policy

40k

आपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।

AI और एजेंटएजेंट

मिलती-जुलती skills