This respository is to build any python package and push it ot PyPI repository
Procedure (Detailed):
1. Project Structure
Organize your project like this:
your_project/
│
├── src/your_package/ # Your actual Python code
│ ├── __init__.py
│ ├── module1.py
│ └── module2.py
│
├── tests/ # Optional tests
│ └── test_module1.py
│
├── pyproject.toml # Modern way to declare build system
├── setup.cfg # Metadata & configs
├── README.md # Description (shown on PyPI)
├── LICENSE # License (MIT, Apache2, etc.)
└── MANIFEST.in # (optional) include non-Python files
2. pyproject.toml
This tells pip how to build your package. Example:
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "your-package-name" # must be unique on PyPI
version = "0.1.0"
description = "A short description of your package"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "MIT"}
authors = [
{name = "Your Name", email = "you@example.com"}
]
dependencies = [
"requests>=2.0",
]
[project.urls]
Homepage = "https://github.com/yourusername/your_project"
3. setup.cfg (optional, metadata in pyproject.toml is enough, but you can split)
[metadata]
name = your-package-name
version = 0.1.0
author = Your Name
author_email = you@example.com
description = A short description
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/yourusername/your_project
license = MIT
[options]
package_dir =
= src
packages = find:
python_requires = >=3.8
[options.packages.find]
where = src
4. Build the Package
First install the tools:
pip install build twine
Then build your distribution:
python -m build
This creates:
dist/
your_package_name-0.1.0.tar.gz
your_package_name-0.1.0-py3-none-any.whl
5. Install Locally (test before uploading)
pip install dist/your_package_name-0.1.0-py3-none-any.whl
or for development mode:
pip install -e .
6. Upload to PyPI
Create a PyPI account: https://pypi.org/account/register/
Upload with Twine:
python -m twine upload dist/*
If you want to test before real PyPI, use TestPyPI:
python -m twine upload --repository testpypi dist/*
✅ Now your module is pip install your-package-name ready!
Procedure (Simplified):
🔹 1. Install Required Tools
Make sure you have the build & upload tools installed:
pip install build twine
🔹 2. Build Your Package
From your project root (where pyproject.toml / setup.cfg lives):
python -m build
This creates a dist/ folder with files like:
dist/
your_package-0.1.0-py3-none-any.whl
your_package-0.1.0.tar.gz
🔹 3. Upload With Twine
Upload to PyPI (public)
twine upload dist/*
Upload to TestPyPI (sandbox)
twine upload --repository testpypi dist/*
🔹 4. Authentication
The first time, Twine will ask for your PyPI username and password. Best practice now is to use API tokens instead of your account password.
Go to your PyPI account → Account settings → API tokens.
Create a token with scope “Entire account” (or project-specific).
Copy the token (looks like pypi-AgENdGVzdC5weXBpLm9yZw...).
Then use it when prompted:
username = __token__
password = <your-api-token>
🔹 5. Store Credentials Securely (Optional)
Instead of typing credentials every time, you can set them up in ~/.pypirc:
[pypi]
username = __token__
password = pypi-AgENdGVzd...
[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
password = pypi-AgENdGVzd...
Now you can upload with:
twine upload -r pypi dist/*
or
twine upload -r testpypi dist/*
🔹 6. Verify Upload
After a successful upload:
PyPI: https://pypi.org/project/your-package-name/
TestPyPI: https://test.pypi.org/project/your-package-name/
Users can then install:
pip install your-package-name
or from TestPyPI:
pip install --index-url https://test.pypi.org/simple/ your-package-name
✅ That’s the complete flow: build → upload with twine → authenticate → verify.
Metadata
Release files for encryptcode 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| encryptcode-0.1.2.tar.gz | 5.5 kB | Without provenance | Details for encryptcode-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| encryptcode-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for encryptcode-0.1.2-py3-none-any.whl |
Total release size: 11.5 kB
Release files / encryptcode-0.1.2.tar.gz
| Download URL | encryptcode-0.1.2.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f241078ffb3719fcdb11ddabedda499a605e914ec29544406dc254368e2d8f9a
|
|
BLAKE2b-256 checksum How to use checksums |
4075b1c2fecdd966c4a672946af0ac532765e8f6b9c01dd350ad72c86f241cac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / encryptcode-0.1.2-py3-none-any.whl
| Download URL | encryptcode-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd7e05aadeaa8c94951a9823ea792bff659acbc7d29dc2b9d8d0af59023c9ec7
|
|
BLAKE2b-256 checksum How to use checksums |
1d3503329a75c9dee1b01b6e5d8737c26b5dffc2b66af690340e26974df60a0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Security for encryptcode 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.