Skip to content

Latest commit

 

History

History
227 lines (167 loc) · 4.52 KB

PUBLISHING_GUIDE.md

File metadata and controls

227 lines (167 loc) · 4.52 KB

PyPI Publishing Quick Guide

📦 Ready to Publish Your Package!

Your FastAPI Payload Shield package is now ready to be published to PyPI.


🚀 Quick Start (2 Steps)

Step 1: Windows Users

cd C:\Users\kandu\OneDrive\Desktop\GitHub\FastAPIPS
publish.batch

Step 1: Linux/macOS Users

cd ~/Desktop/GitHub/FastAPIPS
chmod +x publish.sh
./publish.sh

Step 2: Enter PyPI Credentials

When prompted:

  • Username: Your PyPI username
  • Password: Your PyPI password or API token

✅ What Gets Published

The publish script automatically:

  1. ✅ Checks Python and build tools
  2. ✅ Cleans old build artifacts
  3. ✅ Builds distribution packages (wheel + source)
  4. ✅ Verifies package contents
  5. ✅ Uploads to PyPI

📋 Package Details

Name: fastapi_payloadshield
Version: 1.2.0
License: Apache-2.0
Author: Ganesh Kandu
Repository: https://github.com/PayloadShield/FastAPIPS
PyPI: https://pypi.org/project/fastapi_payloadshield/

🔐 First Time Setup (One-Time)

Create PyPI Account

  1. Go to https://pypi.org/account/register/
  2. Create your account
  3. Verify email
  4. (Optional) Create API token at https://pypi.org/account/manage

For 2FA Enabled Accounts

Username: __token__
Password: [Your API token from https://pypi.org/account/manage]

📂 What's Included in Distribution

fastapi_payloadshield/
├── fastapi_payloadshield/
│   ├── __init__.py
│   ├── config.py
│   ├── crypto.py
│   ├── decorators.py
│   ├── EncryptionHandler.py
│   ├── Base64EncryptionHandler.py
│   ├── FernetEncryptionHandler.py
│   ├── AESGCM256EncryptionHandler.py
│   └── HybridRSAEncryptionHandler.py
├── examples/
│   ├── example_app.py
│   └── test_client.py
├── README.md
├── LICENSE (Apache-2.0)
├── pyproject.toml
├── setup.py
└── requirements.txt

PLUS all files from document/ folder:
├── document/DEVELOPMENT.md
├── document/PUBLISHING_GUIDE.md
└── document/PROJECT_JOURNEY.md

🔍 Pre-Publish Checklist

Before running publish script:

# 1. Verify package structure
ls -la  # or dir on Windows

# 2. Test imports
python -c "from fastapi_payloadshield import PayloadShield; print('✅ OK')"

# 3. Check version
python -c "import fastapi_payloadshield; print(f'Version: {fastapi_payloadshield.__version__}')"

# 4. Verify setup.py
python setup.py --version

# 5. Check license
cat LICENSE | head -5

🎯 Installation After Publishing

Once published, users can install with:

pip install fastapi_payloadshield

Or with optional dev tools:

pip install fastapi_payloadshield[dev]

📊 Project Statistics

  • Total Files: 15+
  • Python Modules: 9
  • Example Applications: 2
  • Documentation Files: 3 (in document/)
  • Configuration Files: 5
  • Publication Scripts: 2

🆘 Troubleshooting

Error: "setup.py not found"

Solution: Make sure you're in the project root directory

# Correct location:
C:\Users\kandu\OneDrive\Desktop\GitHub\FastAPIPS\

Error: "Python is not installed"

Solution: Install Python or add to PATH

# Verify Python is installed:
python --version

# Or:
python3 --version

Error: "Authentication failed"

Solution: Check PyPI credentials

- Username: Correct PyPI username
- Password: Correct password or API token (not your login password!)
- 2FA: Use __token__ as username if 2FA enabled

Error: "Package already exists"

Solution: Update version number in:

  • setup.py (line 12)
  • pyproject.toml (line 7)

Then republish with new version.


🔄 Update Workflow

To publish updates:

  1. Make code changes
  2. Update version in:
    • setup.py
    • pyproject.toml
  3. Run: publish.batch or ./publish.sh
  4. Confirm new version on PyPI

📞 Support


✨ After Publishing

Once published to PyPI:

  1. ✅ Available for download: pip install fastapi_payloadshield
  2. ✅ Listed on PyPI: https://pypi.org/project/fastapi_payloadshield/
  3. ✅ Discoverable via: pip search (if enabled)
  4. ✅ Accessible from: conda-forge (optional)
  5. ✅ Linked to: GitHub repository

Happy Publishing! 🚀

Next command:

publish.batch    # Windows
./publish.sh     # Linux/macOS