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.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.1.tar.gz.
File metadata
- Download URL: counterajm-0.1.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 |
0a1784c1bc078d9a48551b3d726e0173a6528d16b6764aa9cffe0eb15e12d712
|
|
| MD5 |
05dcdb705cf74dea2ec278000fb82e50
|
|
| BLAKE2b-256 |
6a9f3e8123ee0a75b0a2d1e8f729d0a7d4a8b2d4e05b64b007e8b1ed619bad3d
|
File details
Details for the file counterajm-0.1.1-py3-none-any.whl.
File metadata
- Download URL: counterajm-0.1.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 |
b62d0e917abb1ccc7495da5cd679d068807b4b7fd590f5e9da18be278497f3ff
|
|
| MD5 |
78c54f78b711fac150123a6d375ff913
|
|
| BLAKE2b-256 |
a7fac288b4f7513b8b2985b15cbcff9f5893ea3fff39861196eea3e039924f8c
|