Skip to main content

A friendly CLI tool to check and publish Python packages to TestPyPI/PyPI

Project description

KX-Publish-PyPI Logo

KX-Publish-PyPI

The Professional CLI Tool for Python Package Publishing

PyPI version Python 3.9+ License: MIT Build Status GitHub stars

โšก Publish Python packages to PyPI in under 30 seconds! โšก

Author: ABUELTAYEF Khader | Python 3.9+


๐ŸŽฏ Why Choose KX-Publish-PyPI?

Feature KX-Publish-PyPI Traditional Methods
Setup Time โšก 30 seconds โฐ 30+ minutes
Security ๐Ÿ” System keyring ๐Ÿ“ Plain text files
User Experience ๐ŸŽจ Rich CLI + Progress bars ๐Ÿ“Ÿ Basic terminal output
Error Handling ๐Ÿ›ก๏ธ Smart validation โŒ Manual debugging
Version Management ๐Ÿ“ˆ Intelligent bumping ๐Ÿ”ข Manual editing
Build Backend Support ๐Ÿ› ๏ธ All modern backends โš™๏ธ Limited support

๐Ÿ’ป Installation

โšก Quick Install

pip install kx-publish-pypi

โœ… Verify Installation

kx-publish-pypi --version

๐Ÿ’ป Account Setup & Token Generation

๐Ÿ”‘ Get Started with PyPI Publishing

1. Create PyPI Account

  1. ๐ŸŒ Visit pypi.org
  2. ๐Ÿ“ Click "Register" in the top right
  3. โœ‰๏ธ Fill out the registration form
  4. โœ… Verify your email address

2. Create TestPyPI Account

  1. ๐ŸŒ Visit test.pypi.org
  2. ๐Ÿ“ Click "Register" in the top right
  3. โœ‰๏ธ Fill out the registration form
  4. โœ… Verify your email address

3. Generate API Tokens

For PyPI Production:

  1. ๐Ÿ”‘ Log in to pypi.org
  2. โš™๏ธ Go to Account Settings โ†’ API tokens
  3. โž• Click "Add API token"
  4. ๐Ÿท๏ธ Give it a name (e.g., "kx-publish-pypi")
  5. ๐Ÿ’พ Copy & Save the token (you won't see it again!)

For TestPyPI:

  1. ๐Ÿ”‘ Log in to test.pypi.org
  2. โš™๏ธ Go to Account Settings โ†’ API tokens
  3. โž• Click "Add API token"
  4. ๐Ÿท๏ธ Give it a name (e.g., "kx-publish-pypi-test")
  5. ๐Ÿ’พ Copy & Save the token

4. Store Tokens Securely

Use the CLI to store your tokens securely:

kx-publish-pypi setup-tokens

This will prompt you to enter your TestPyPI and PyPI tokens, which will be stored in your system's keyring.

๐Ÿ’ก Pro Tip: You can also store tokens directly during the guided workflow:

kx-publish-pypi run

๐Ÿš€ Quick Start

Choose Your Publishing Journey

๐ŸŽฏ Option 1: Complete Guided Workflow (Recommended)

kx-publish-pypi run
โœจ One command handles everything: checks, tokens, version bump, build, and publish

๐Ÿ› ๏ธ Option 2: Individual Commands

# ๐Ÿ” Pre-flight check your package
kx-publish-pypi check

# ๐Ÿ” Setup API tokens securely
kx-publish-pypi setup-tokens

# ๐Ÿ“ˆ Bump version (patch/minor/major)
kx-publish-pypi bump patch

# ๐Ÿงช Publish to TestPyPI first
kx-publish-pypi publish-test

# ๐Ÿš€ Publish to production PyPI
kx-publish-pypi publish-prod

โœจ Key Features

๐ŸŽจ Rich Interface Rich, colorful output with progress bars
๐Ÿ” Smart Pre-checks Validates package structure and configuration
๐Ÿ” Secure Token Storage Uses system keyring for API tokens
๐Ÿ“ฆ Enhanced Version Detection Supports all modern Python build backends
๐Ÿ”ฅ Interactive Workflow Guided experience from check to publish
๐Ÿ“ˆ Version Management Intelligent version bumping
๐Ÿ› ๏ธ Build Integration Works with setuptools, flit, hatchling, etc.

๐Ÿ—๏ธ Supported Build Backends

Backend Status Version Detection
setuptools โœ… Full Support __version__ files
poetry โœ… Full Support pyproject.toml
flit โœ… Full Support pyproject.toml
hatchling โœ… Full Support pyproject.toml
pdm โœ… Full Support pyproject.toml
scikit-build โœ… Full Support Custom detection

๐Ÿš€ Programmatic API

from kx_publish_pypi import detect_package_version
from pathlib import Path

# Enhanced version detection
result = detect_package_version(Path("."))
if result.version_info:
    print(f"๐Ÿ“ฆ Version: {result.version_info.version}")
    print(f"๐Ÿ”ง Method: {result.version_info.method}")

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

๐Ÿ› Found a Bug?


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐ŸŒ Connect with Us

๐Ÿš€ Powered by KhaderX | ๐Ÿ‘จโ€๐Ÿ’ป Founder: ABUELTAYEF Khader

GitHub Website PyPI

โญ If you find this tool useful, please star this repo!

GitHub stars
KX-Publish-PyPI Logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kx_publish_pypi-1.0.3.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kx_publish_pypi-1.0.3-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file kx_publish_pypi-1.0.3.tar.gz.

File metadata

  • Download URL: kx_publish_pypi-1.0.3.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for kx_publish_pypi-1.0.3.tar.gz
Algorithm Hash digest
SHA256 ae018aa829e3b9e273a2a22f0866e9a2f43c716c75d75e6501bad7e9aaa2b46a
MD5 25f14ea35d90d5c97efd68fc21ed9057
BLAKE2b-256 afbe32a6118eec7dad312ead02185de6135f72ab53d4ad5b7f44f9770a6c6c26

See more details on using hashes here.

File details

Details for the file kx_publish_pypi-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for kx_publish_pypi-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ec8b231925de7f5d6c8409998b7fe433cda693e7d0e4adc424fce43b9d5a039b
MD5 84e789db4e92751aa4a34cf6e4908560
BLAKE2b-256 4f4daa6a19ad249b41b2edd99594081e6efb19ad8ecbc0b8259a33c887dccc51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page