Skip to main content

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.value to 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)

Uploaded Source

Built Distribution

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

counterajm-0.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

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

Hashes for counterajm-0.1.tar.gz
Algorithm Hash digest
SHA256 7d7d9e70af88feb0125aae38a57a82b367c02911be98da7444805a478245e938
MD5 50265ea3fb768421787859ee9cad385b
BLAKE2b-256 e983b931fe1ccbf8ed78d80b4856b4ab4d906562fc1eaa09431e6ca2ef1ec287

See more details on using hashes here.

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

Hashes for counterajm-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f5f3efe3fd767222ccb3615e77873e66ff93ab7b0f9679afbd75f6ceb745c11
MD5 9e9e41062695d265af5c931d877ee85e
BLAKE2b-256 7bbea0ea940e6a290f871f548723996044105823d2c22b1c87e29e4cce2f1e8e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page