Skip to main content

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

Project description

MultiCounter

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

Joseph Hale's software engineering blog

Installation

Pip

pip install multicounter

Poetry

poetry add multicounter

Usage

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

The Legal Stuff

`MultiCounter` by Joseph Hale is licensed under the terms of the Mozilla
Public License, v 2.0, which are available at https://mozilla.org/MPL/2.0/.

You can download the source code for `MultiCounter` for free from
https://github.com/jhale1805/multicounter.

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.

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

multicounter-0.2.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

multicounter-0.2.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file multicounter-0.2.0.tar.gz.

File metadata

  • Download URL: multicounter-0.2.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.2 Linux/6.5.0-1018-azure

File hashes

Hashes for multicounter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 78aba4fd67ee85f6b20a0942b406f8bfb64c7f05072b9fe3ba21c7b843417616
MD5 2518013f2c0b815fbf01893442b8cb68
BLAKE2b-256 21434d54629b4e6e313cb0fc9f4155daacc161b86cd682f8a0595d224aa28db4

See more details on using hashes here.

File details

Details for the file multicounter-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: multicounter-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.2 Linux/6.5.0-1018-azure

File hashes

Hashes for multicounter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 243f391967d3062f99d6723bcc36fc9d47d481cf14b9214f11e93291ce7a0cea
MD5 b90d07517aea3e961e73c771d699882e
BLAKE2b-256 29fcb2e43753a5711409d6f0cc25af6a702315c80accb8e369a4e7f428020b5f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page