multicounter


Namemulticounter JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/thehale/multicounter
SummaryA simple, elegant counter with support for counting multiple things at once.
upload_time2024-04-29 16:53:16
maintainerNone
docs_urlNone
authorJoseph Hale
requires_python<4.0,>=3.8
licenseMPL-2.0
keywords counter statistics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--
 Copyright (c) 2022 Joseph Hale

 This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0. If a copy of the MPL was not distributed with this
 file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->

# MultiCounter

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

<!-- BADGES -->
[![](https://badgen.net/github/license/thehale/multicounter)](https://github.com/thehale/multicounter/blob/master/LICENSE)
[![](https://badgen.net/badge/icon/Sponsor/pink?icon=github&label)](https://github.com/sponsors/thehale)
[![Joseph Hale's software engineering blog](https://img.shields.io/badge/jhale.dev-black.svg?style=plastic&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNCIgaGVpZ2h0PSI0IiB2aWV3Qm94PSIwIDAgMS4wNTggMS4wNTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY29sb3I9IiMwMDAiIHBhaW50LW9yZGVyPSJmaWxsIG1hcmtlcnMgc3Ryb2tlIj48cGF0aCBkPSJNLjY0My43NTJhLjE1Ni4xNTYgMCAwMC0uMTMuMDU5Qy40NzYuODUuNDcuOTE3LjQ2OS45M2EuMDI1LjAyNSAwIDAwLjAyNi4wMjhoLjA2NmEuMDI1LjAyNSAwIDAwLjAyNC0uMDIuMTIuMTIgMCAwMS4wMi0uMDUyQy42MTguODcuNjMyLjg2OS42NTUuODY5aC4xMjJjMC0uMDAyLjA3Ni4wMDcuMTI5LS4wNUEuMTQzLjE0MyAwIDAwLjkyOC43ODcuMDI1LjAyNSAwIDAwLjkwNi43NTJILjY0M3oiIGZpbGw9IiMwNTAiLz48cGF0aCBkPSJNLjM5My40MWEuMDIuMDIgMCAwMC0uMDIuMDJ2LjI2YzAgLjAxMi4wMDEuMDI5LS4wMTQuMDQ0Qy4zMy43NTkuMjgyLjc1LjI2Ny43MzYuMjU3LjcyOC4yNS43MTMuMjQ0LjY4N0EuMDI1LjAyNSAwIDAwLjIyLjY3SC4xNTNhLjAyNC4wMjQgMCAwMC0uMDI1LjAyNmMuMDA0LjA1Mi4wMjUuMDkuMDUxLjExOWEuMTY3LjE2NyAwIDAwLjExMy4wNTJoLjAzNWEuMTg0LjE4NCAwIDAwLjExNS0uMDVBLjE4Mi4xODIgMCAwMC40OS42OTRWLjQzMUEuMDIuMDIgMCAwMC40Ny40MXpNLjc4Ny4zOWEuMDIuMDIgMCAwMC0uMDIuMDJ2LjI0MmMwIC4wMTEuMDA5LjAyLjAyLjAyaC4wNzdhLjAyLjAyIDAgMDAuMDItLjAyVi40MTFhLjAyLjAyIDAgMDAtLjAyLS4wMnpNLjM5My4yMThhLjAyLjAyIDAgMDAtLjAyLjAydi4wNzdjMCAuMDExLjAwOC4wMi4wMi4wMkguNDdhLjAyLjAyIDAgMDAuMDItLjAyVi4yMzhhLjAyLjAyIDAgMDAtLjAyLS4wMnpNLjU5LjFhLjAyLjAyIDAgMDAtLjAyLjAydi41MzJjMCAuMDExLjAwOS4wMi4wMi4wMmguMDc3YS4wMi4wMiAwIDAwLjAyLS4wMlYuMTJBLjAyLjAyIDAgMDAuNjY3LjF6IiBmaWxsPSIjMDBkNDAwIi8+PC9nPjwvc3ZnPg==)](https://jhale.dev)
[![](https://img.shields.io/badge/Follow-thehale-0A66C2?logo=linkedin)](https://www.linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&followMember=thehale)

## Installation

### Pip
```bash
pip install multicounter
```

### Poetry
```bash
poetry add multicounter
```

## Usage
```python
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](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](https://www.mozilla.org/en-US/MPL/2.0/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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/thehale/multicounter",
    "name": "multicounter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "counter, statistics",
    "author": "Joseph Hale",
    "author_email": "me@jhale.dev",
    "download_url": "https://files.pythonhosted.org/packages/21/43/4d54629b4e6e313cb0fc9f4155daacc161b86cd682f8a0595d224aa28db4/multicounter-0.2.0.tar.gz",
    "platform": null,
    "description": "<!--\n Copyright (c) 2022 Joseph Hale\n\n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at http://mozilla.org/MPL/2.0/.\n-->\n\n# MultiCounter\n\nA simple, elegant counter with support for counting multiple things at once.\n\n<!-- BADGES -->\n[![](https://badgen.net/github/license/thehale/multicounter)](https://github.com/thehale/multicounter/blob/master/LICENSE)\n[![](https://badgen.net/badge/icon/Sponsor/pink?icon=github&label)](https://github.com/sponsors/thehale)\n[![Joseph Hale's software engineering blog](https://img.shields.io/badge/jhale.dev-black.svg?style=plastic&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNCIgaGVpZ2h0PSI0IiB2aWV3Qm94PSIwIDAgMS4wNTggMS4wNTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY29sb3I9IiMwMDAiIHBhaW50LW9yZGVyPSJmaWxsIG1hcmtlcnMgc3Ryb2tlIj48cGF0aCBkPSJNLjY0My43NTJhLjE1Ni4xNTYgMCAwMC0uMTMuMDU5Qy40NzYuODUuNDcuOTE3LjQ2OS45M2EuMDI1LjAyNSAwIDAwLjAyNi4wMjhoLjA2NmEuMDI1LjAyNSAwIDAwLjAyNC0uMDIuMTIuMTIgMCAwMS4wMi0uMDUyQy42MTguODcuNjMyLjg2OS42NTUuODY5aC4xMjJjMC0uMDAyLjA3Ni4wMDcuMTI5LS4wNUEuMTQzLjE0MyAwIDAwLjkyOC43ODcuMDI1LjAyNSAwIDAwLjkwNi43NTJILjY0M3oiIGZpbGw9IiMwNTAiLz48cGF0aCBkPSJNLjM5My40MWEuMDIuMDIgMCAwMC0uMDIuMDJ2LjI2YzAgLjAxMi4wMDEuMDI5LS4wMTQuMDQ0Qy4zMy43NTkuMjgyLjc1LjI2Ny43MzYuMjU3LjcyOC4yNS43MTMuMjQ0LjY4N0EuMDI1LjAyNSAwIDAwLjIyLjY3SC4xNTNhLjAyNC4wMjQgMCAwMC0uMDI1LjAyNmMuMDA0LjA1Mi4wMjUuMDkuMDUxLjExOWEuMTY3LjE2NyAwIDAwLjExMy4wNTJoLjAzNWEuMTg0LjE4NCAwIDAwLjExNS0uMDVBLjE4Mi4xODIgMCAwMC40OS42OTRWLjQzMUEuMDIuMDIgMCAwMC40Ny40MXpNLjc4Ny4zOWEuMDIuMDIgMCAwMC0uMDIuMDJ2LjI0MmMwIC4wMTEuMDA5LjAyLjAyLjAyaC4wNzdhLjAyLjAyIDAgMDAuMDItLjAyVi40MTFhLjAyLjAyIDAgMDAtLjAyLS4wMnpNLjM5My4yMThhLjAyLjAyIDAgMDAtLjAyLjAydi4wNzdjMCAuMDExLjAwOC4wMi4wMi4wMkguNDdhLjAyLjAyIDAgMDAuMDItLjAyVi4yMzhhLjAyLjAyIDAgMDAtLjAyLS4wMnpNLjU5LjFhLjAyLjAyIDAgMDAtLjAyLjAydi41MzJjMCAuMDExLjAwOS4wMi4wMi4wMmguMDc3YS4wMi4wMiAwIDAwLjAyLS4wMlYuMTJBLjAyLjAyIDAgMDAuNjY3LjF6IiBmaWxsPSIjMDBkNDAwIi8+PC9nPjwvc3ZnPg==)](https://jhale.dev)\n[![](https://img.shields.io/badge/Follow-thehale-0A66C2?logo=linkedin)](https://www.linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&followMember=thehale)\n\n## Installation\n\n### Pip\n```bash\npip install multicounter\n```\n\n### Poetry\n```bash\npoetry add multicounter\n```\n\n## Usage\n```python\nfrom multicounter import MultiCounter\nmc = MultiCounter()\n\n# Choose a name for your counter and start counting!\nmc.foo += 1\n\n# You can choose an initial value for a counter ...\nmc.bar = 42\n# ... and increment or decrement it however you like.\nmc.bar -= 4\n\nprint(mc.get_counters())\n# {'foo': 1, 'bar': 38}\n```\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## The Legal Stuff\n\n```\n`MultiCounter` by Joseph Hale is licensed under the terms of the Mozilla\nPublic License, v 2.0, which are available at https://mozilla.org/MPL/2.0/.\n\nYou can download the source code for `MultiCounter` for free from\nhttps://github.com/jhale1805/multicounter.\n```\n\n### TL;DR\n\nYou can use files from this project in both open source and proprietary\napplications, provided you include the above attribution. However, if\nyou modify any code in this project, or copy blocks of it into your own\ncode, you must publicly share the resulting files (note, not your whole\nprogram) under the MPL-2.0. The best way to do this is via a Pull\nRequest back into this project.\n\nIf you have any other questions, you may also find Mozilla's [official\nFAQ](https://www.mozilla.org/en-US/MPL/2.0/FAQ/) for the MPL-2.0\nlicense insightful.\n\nIf you dislike this license, you can contact me about negotiating a\npaid contract with different terms.\n\n**Disclaimer:** This TL;DR is just a summary. All legal questions\nregarding usage of this project must be handled according to the\nofficial terms specified in the `LICENSE` file.\n\n### Why the MPL-2.0 license?\n\nI believe that an open-source software license should ensure that code\ncan be used everywhere.\n\nStrict copyleft licenses, like the GPL family of licenses, fail to\nfulfill that vision because they only permit code to be used in other\nGPL-licensed projects. Permissive licenses, like the MIT and Apache\nlicenses, allow code to be used everywhere but fail to prevent\nproprietary or GPL-licensed projects from limiting access to any\nimprovements they make.\n\nIn contrast, the MPL-2.0 license allows code to be used in any software\nproject, while ensuring that any improvements remain available for\neveryone.\n",
    "bugtrack_url": null,
    "license": "MPL-2.0",
    "summary": "A simple, elegant counter with support for counting multiple things at once.",
    "version": "0.2.0",
    "project_urls": {
        "Documentation": "https://github.com/thehale/multicounter",
        "Homepage": "https://github.com/thehale/multicounter",
        "Repository": "https://github.com/thehale/multicounter"
    },
    "split_keywords": [
        "counter",
        " statistics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "29fcb2e43753a5711409d6f0cc25af6a702315c80accb8e369a4e7f428020b5f",
                "md5": "b90d07517aea3e961e73c771d699882e",
                "sha256": "243f391967d3062f99d6723bcc36fc9d47d481cf14b9214f11e93291ce7a0cea"
            },
            "downloads": -1,
            "filename": "multicounter-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b90d07517aea3e961e73c771d699882e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 10131,
            "upload_time": "2024-04-29T16:53:15",
            "upload_time_iso_8601": "2024-04-29T16:53:15.326546Z",
            "url": "https://files.pythonhosted.org/packages/29/fc/b2e43753a5711409d6f0cc25af6a702315c80accb8e369a4e7f428020b5f/multicounter-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21434d54629b4e6e313cb0fc9f4155daacc161b86cd682f8a0595d224aa28db4",
                "md5": "2518013f2c0b815fbf01893442b8cb68",
                "sha256": "78aba4fd67ee85f6b20a0942b406f8bfb64c7f05072b9fe3ba21c7b843417616"
            },
            "downloads": -1,
            "filename": "multicounter-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2518013f2c0b815fbf01893442b8cb68",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 8697,
            "upload_time": "2024-04-29T16:53:16",
            "upload_time_iso_8601": "2024-04-29T16:53:16.278500Z",
            "url": "https://files.pythonhosted.org/packages/21/43/4d54629b4e6e313cb0fc9f4155daacc161b86cd682f8a0595d224aa28db4/multicounter-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 16:53:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thehale",
    "github_project": "multicounter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "multicounter"
}
        
Elapsed time: 1.32068s