CounterAJM
A basic Python counter class for simple incrementing and value tracking.
Installation
pip install CounterAJM
Usage
from CounterAJM import Counter
# Initialize a counter
c = Counter(start=0, counter_name="MyCounter")
# Increment the counter
c.increment(5)
print(c.value) # Output: 5
# String representation
print(c) # Output: 5 (formatted)
print(repr(c)) # Output: MyCounter: 5
# Reset counter (using deleter)
del c.value
print(c.value) # Output: 0
Features
- Custom Start Value: Initialize the counter at any integer.
- Counter Naming: Assign a name to your counter for better logging/representation.
- Safe Incrementing: Prevents negative increments and non-integer values.
- Easy Reset: Use
del counter.valueto reset the count to 0. - Formatted Output: Built-in
__str__and__repr__for clean display.
License
MIT License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
counterajm-0.1.tar.gz
(3.5 kB
view details)
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 counterajm-0.1.tar.gz.
File metadata
- Download URL: counterajm-0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d7d9e70af88feb0125aae38a57a82b367c02911be98da7444805a478245e938
|
|
| MD5 |
50265ea3fb768421787859ee9cad385b
|
|
| BLAKE2b-256 |
e983b931fe1ccbf8ed78d80b4856b4ab4d906562fc1eaa09431e6ca2ef1ec287
|
File details
Details for the file counterajm-0.1-py3-none-any.whl.
File metadata
- Download URL: counterajm-0.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f5f3efe3fd767222ccb3615e77873e66ff93ab7b0f9679afbd75f6ceb745c11
|
|
| MD5 |
9e9e41062695d265af5c931d877ee85e
|
|
| BLAKE2b-256 |
7bbea0ea940e6a290f871f548723996044105823d2c22b1c87e29e4cce2f1e8e
|