{"id":27735,"library":"fastcounter","title":"FastCounter","description":"A Python library providing fast, thread-safe counter implementations. Currently at version 1.2.0 with type hints added. Active development on GitHub.","status":"active","version":"1.2.0","language":"python","source_language":"en","source_url":"https://github.com/jd/fastcounter","tags":["thread-safe","counter","concurrency"],"install":[{"cmd":"pip install fastcounter","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Main fast counter class for write-heavy workloads.","symbol":"FastWriteCounter","correct":"from fastcounter import FastWriteCounter"},{"note":"Optimized for read-heavy workloads.","symbol":"FastReadCounter","correct":"from fastcounter import FastReadCounter"}],"quickstart":{"code":"from fastcounter import FastWriteCounter\n\ncounter = FastWriteCounter()\ncounter.increment()\ncounter.add(5)\nprint(counter.value())","lang":"python","description":"Create and use a FastWriteCounter."},"warnings":[{"fix":"Update your code to match the type signatures. For example, `increment()` now returns `None` explicitly.","message":"Version 1.2.0 added type hints; if you were relying on dynamic attribute access or duck typing, your code may break under strict type checkers.","severity":"breaking","affected_versions":">=1.2.0"},{"fix":"Replace `from fastcounter import Counter` with `from fastcounter import FastWriteCounter` (or FastReadCounter) and adjust usage accordingly.","message":"The `Counter` base class (if exists) is deprecated in favor of `FastWriteCounter` and `FastReadCounter`.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure you import the correct counter type: use `FastWriteCounter` for counting operations, `FastReadCounter` for read-only access.","message":"`FastReadCounter` does not support `increment()`; it only provides `value()`. Trying to call `increment()` will raise an AttributeError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Replace `FastReadCounter` with `FastWriteCounter`.","cause":"Using FastReadCounter in a context where incrementing is needed.","error":"AttributeError: 'FastReadCounter' object has no attribute 'increment'"},{"fix":"Use `from fastcounter import FastWriteCounter` or `FastReadCounter`.","cause":"The module was renamed or removed. There is no `Counter` in fastcounter.","error":"ImportError: cannot import name 'Counter' from 'fastcounter'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}