Skip to main content

MultiCounter

A simple, elegant counter with support for counting multiple things at once.

Joseph Hale's software engineering blog

Quickstart

pip install multicounter
from multicounter import MultiCounter
mc = MultiCounter()

# Choose a name for your counter and start counting!
mc.foo += 1

# You can choose an initial value for a counter ...
mc.bar = 42
# ... and increment or decrement it however you like.
mc.bar -= 4

print(mc.get_counters())
# {'foo': 1, 'bar': 38}

Contributing

See CONTRIBUTING.md

License

Copyright (c) 2026 Joseph Hale, All Rights Reserved

Provided under the terms of the Mozilla Public License, version 2.0

What does the MPL-2.0 license allow/require?

TL;DR

You can use files from this project in both open source and proprietary applications, provided you include the above attribution. However, if you modify any code in this project, or copy blocks of it into your own code, you must publicly share the resulting files (note, not your whole program) under the MPL-2.0. The best way to do this is via a Pull Request back into this project.

If you have any other questions, you may also find Mozilla's official FAQ for the MPL-2.0 license insightful.

If you dislike this license, you can contact me about negotiating a paid contract with different terms.

Disclaimer: This TL;DR is just a summary. All legal questions regarding usage of this project must be handled according to the official terms specified in the LICENSE file.

Why the MPL-2.0 license?

I believe that an open-source software license should ensure that code can be used everywhere.

Strict copyleft licenses, like the GPL family of licenses, fail to fulfill that vision because they only permit code to be used in other GPL-licensed projects. Permissive licenses, like the MIT and Apache licenses, allow code to be used everywhere but fail to prevent proprietary or GPL-licensed projects from limiting access to any improvements they make.

In contrast, the MPL-2.0 license allows code to be used in any software project, while ensuring that any improvements remain available for everyone.

Metadata

Release files for multicounter 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multicounter 0.3.1
File Size Uploaded Provenance Actions
multicounter-0.3.1.tar.gz 13.4 kB Without provenance Details for multicounter-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for multicounter 0.3.1
File Interpreter ABI Platform Actions
multicounter-0.3.1-py3-none-any.whl Python 3 none any Details for multicounter-0.3.1-py3-none-any.whl

Total release size: 22.5 kB

Release files / multicounter-0.3.1.tar.gz

Download URL multicounter-0.3.1.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2093ca744ef4b6595932022ea249eca872ade920b40934fdd6cd6c2b85109900
BLAKE2b-256 checksum
How to use checksums
b930629cee85908b84994621735936a32be89cf141e42b46615579dd07432d63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.0 {"ci":null,"cpu":"x86_64","distro":{"id":"jammy","libc":{"lib":"glibc","version":"2.35"},"name":"Ubuntu","version":"22.04"},"implementation":{"name":"CPython","version":"3.13.2"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.0.2 15 Mar 2022","python":"3.13.2","system":{"name":"Linux","release":"6.18.33.2-microsoft-standard-WSL2"}} HTTPX2/2.12.0

Release files / multicounter-0.3.1-py3-none-any.whl

Download URL multicounter-0.3.1-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96bd384b26b0f907f3419bc13a39ad250147ebd3e39a26c0e5dabff821aa33b2
BLAKE2b-256 checksum
How to use checksums
5201df896726829e0944a3c5f8b9d8ab350ede3a4b184b2f34bcaf314909b0d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.0 {"ci":null,"cpu":"x86_64","distro":{"id":"jammy","libc":{"lib":"glibc","version":"2.35"},"name":"Ubuntu","version":"22.04"},"implementation":{"name":"CPython","version":"3.13.2"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.0.2 15 Mar 2022","python":"3.13.2","system":{"name":"Linux","release":"6.18.33.2-microsoft-standard-WSL2"}} HTTPX2/2.12.0

Security for multicounter 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page