A simple package to display codes from codes.txt
Project description
prac-codes-dwm
A simple Python package that displays codes from a codes.txt file using a command-line interface.
Installation
Install the package using pip:
pip install prac-codes-dwm
Usage
After installation, you can display the codes using the following command:
show-codes-dwm
This will display all the content from the codes.txt file in your terminal.
Package Structure
prac-codes-dwm/
├── prac_codes_dwm/
│ ├── __init__.py
│ ├── main.py
│ └── codes.txt
├── setup.py
├── pyproject.toml
├── MANIFEST.in
└── README.md
Development
Building the Package
To build the package locally:
python setup.py sdist bdist_wheel
Or using build:
pip install build
python -m build
This will create distribution files in the dist/ directory.
Testing Locally
To test the package locally before publishing:
pip install -e .
Then test the command:
show-codes-dwm
Publishing to PyPI
Prerequisites
pip install twine build
Steps to Publish
-
Update version number in
setup.pyandpyproject.tomlif needed -
Build the distribution files:
python -m build
- Test on TestPyPI first (recommended):
python -m twine upload --repository testpypi dist/*
You'll be prompted for credentials.
- Test installation from TestPyPI:
pip install --index-url https://test.pypi.org/simple/ prac-codes-dwm
- Publish to PyPI (production):
python -m twine upload dist/*
You'll be prompted for credentials.
Using API Tokens (Recommended)
IMPORTANT: Never put your API key in any package files! API keys are only used during upload, not in your code.
To use an API token:
- Go to your PyPI account settings: https://pypi.org/manage/account/token/
- Generate an API token (for the entire account or a specific project)
- When prompted by
twine upload, use:- Username:
__token__ - Password:
pypi-<your-token-here>(include thepypi-prefix)
- Username:
Alternative: Use environment variables (more secure):
# For PyPI
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=pypi-your-token-here
# Then upload without prompts
python -m twine upload dist/*
Or use a .pypirc file (in your home directory, NOT in the package):
Create ~/.pypirc:
[pypi]
username = __token__
password = pypi-your-token-here
[testpypi]
username = __token__
password = pypi-your-test-token-here
⚠️ Security Note: Never commit .pypirc or API keys to version control. Add it to .gitignore if storing locally.
Updating the Package
When you need to publish an update:
- Update the version number in
setup.pyandpyproject.toml - Build the package:
python -m build - Upload:
python -m twine upload dist/*
License
MIT License
Author
Your Name (your.email@example.com)
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 prac_codes_dwm-0.1.0.tar.gz.
File metadata
- Download URL: prac_codes_dwm-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4835ec4d0eafc3345961222a434b5b8a4cb8112b04c95f2a52bee99984a3f941
|
|
| MD5 |
7c5a59add2ea3f63cbb4fc672832c87c
|
|
| BLAKE2b-256 |
834113068859022b9f94436865b464fe5b17a25e291a5c1dc4e3bc780c71a1fe
|
File details
Details for the file prac_codes_dwm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: prac_codes_dwm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fa9a29da292680b079c2c610ba88bb532b637a175a2939f6f374442e20f02a9
|
|
| MD5 |
f83c56a03f7dad9529cefe264286a5b2
|
|
| BLAKE2b-256 |
e8d94dae1e55acb9629a35b23d3a3be21dfa161a9589eea86befb05eee517e54
|