Skip to main content

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

  1. Create accounts on:

  2. Install required tools:

pip install twine build

Steps to Publish

  1. Update version number in setup.py and pyproject.toml if needed

  2. Build the distribution files:

python -m build
  1. Test on TestPyPI first (recommended):
python -m twine upload --repository testpypi dist/*

You'll be prompted for credentials.

  1. Test installation from TestPyPI:
pip install --index-url https://test.pypi.org/simple/ prac-codes-dwm
  1. 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:

  1. Go to your PyPI account settings: https://pypi.org/manage/account/token/
  2. Generate an API token (for the entire account or a specific project)
  3. When prompted by twine upload, use:
    • Username: __token__
    • Password: pypi-<your-token-here> (include the pypi- prefix)

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:

  1. Update the version number in setup.py and pyproject.toml
  2. Build the package: python -m build
  3. Upload: python -m twine upload dist/*

License

MIT License

Author

Your Name (your.email@example.com)

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

prac_codes_dwm-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

prac_codes_dwm-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

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

Hashes for prac_codes_dwm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4835ec4d0eafc3345961222a434b5b8a4cb8112b04c95f2a52bee99984a3f941
MD5 7c5a59add2ea3f63cbb4fc672832c87c
BLAKE2b-256 834113068859022b9f94436865b464fe5b17a25e291a5c1dc4e3bc780c71a1fe

See more details on using hashes here.

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

Hashes for prac_codes_dwm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fa9a29da292680b079c2c610ba88bb532b637a175a2939f6f374442e20f02a9
MD5 f83c56a03f7dad9529cefe264286a5b2
BLAKE2b-256 e8d94dae1e55acb9629a35b23d3a3be21dfa161a9589eea86befb05eee517e54

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