A simple example package
Project description
This is pkg-test-random
NOTE: before giving the name to packge please check whether package name is available or not to upload
- Install Required Tools Make sure you have twine and build installed:
bash pip install -f twine build
- Build Your Package Navigate to your project folder and run:
python -m build
-
Create a PyPI Account Go to PyPI and sign up.
- Enable 2FA on PyPI Go to PyPI Account Settings.
Under "Two-factor Authentication", enable TOTP (Time-based One-Time Passwords).
Scan the QR code with an authenticator app (like Google Authenticator or Authy).
Enter the generated 6-digit code to confirm.
- Generate an API Token After enabling 2FA, go back to Account Settings.
Scroll down to "API tokens" and click "Add API Token".
Give it a name (e.g., mypackage-publish).
Copy the generated token immediately, as it won’t be shown again.
Generate an API token under Account Settings.
-
Upload the Package
-
Run the following command and enter your credentials when prompted: bash twine upload dist/*
-
If using an API token, run: bash twine upload dist/* -u token -p YOUR_API_TOKEN
-
For security, you can store the token in ~/.pypirc:
[distutils] index-servers = pypi
[pypi] username = token password = YOUR_API_TOKEN
Once you've stored the API token in ~/.pypirc, you can upload your package without manually entering credentials by running: bash twine upload dist/*
Since twine automatically reads the credentials from ~/.pypirc, it will use the stored API token without requiring manual input.
-
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pkg_test_random-0.1.0.tar.gz.
File metadata
- Download URL: pkg_test_random-0.1.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8fb228aaebec3f5240c56dc1f3de526fe076e6d1c05a2e633f28dfb0950ab37
|
|
| MD5 |
ed095fb9e2a2e5208912d256a759fe2b
|
|
| BLAKE2b-256 |
94a94f1fc66009504c74248b022cc04a71099f542915e8991b0ff1c48726c34c
|
File details
Details for the file pkg_test_random-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pkg_test_random-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ab451721f55575034339a7066b1d54640c36036710bb5f13fea9025a5a2bdde
|
|
| MD5 |
9d392460f40cfb70e8b4d90f5ebe2efb
|
|
| BLAKE2b-256 |
33ae7fba28fdcca0107198c5cbc608e2dc6e7d8b7a11798e0ec1f7802afb53c1
|