{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/3"},{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/6"},{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/3"},{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/2"},{"label":"Debuggers","url":"https://skillfed.io/packages/category/software-development-debuggers"},{"label":"Hardware","url":"https://skillfed.io/packages/category/system-hardware"}],"enrichment":{"capability":"CircularDict is a Python dictionary that automatically removes oldest entries when it reaches a size limit (by item count or total bytes), acting as a bounded circular buffer for memory-controlled caching and data storage.","skillfed_tags":["caching","circular-buffer","memory-management"],"use_cases":["Build a time-series cache that keeps only recent measurements without manual cleanup.","Implement a bounded cache for expensive computations with a fixed memory budget.","Store recent log entries or events in memory while preventing unbounded growth.","Cache numpy arrays or large objects with a strict byte-size limit to avoid memory leaks.","Maintain a fixed-size buffer of recent API responses or database query results."],"what_it_does":"CircularDict wraps Python's OrderedDict to create a self-managing cache that enforces size limits. You can constrain it by maximum item count (maxlen), total memory footprint in bytes (maxsize_bytes), or both. When a new entry would exceed the limit, the oldest items are automatically removed to make room, keeping memory usage predictable.\n\nIt behaves like a standard Python dictionary in all other respects\u2014you use it with normal dict syntax (subscript access, iteration, keys/values/items methods). The main use case is building bounded caches where you want the most recent items or a fixed memory budget without manually evicting old entries. If you try to add a single item larger than maxsize_bytes, it raises MemoryError rather than silently failing.","worth_installing":"Yes, if you need a simple, zero-dependency bounded cache. The package is stable (Production/Stable classifier, no known vulnerabilities), installs cleanly, and solves a real problem. The dormant maintenance status is not a concern for a narrow, well-defined utility\u2014there is little reason to change it. Use it when you want automatic FIFO eviction with either item-count or memory-size limits; avoid it if you need LRU semantics (evict least recently used, not oldest) or active development support."},"id":"circular-dict","links":{"html":"https://skillfed.io/packages/circular-dict","md":"https://skillfed.io/packages/circular-dict.md","pypi":"https://pypi.org/project/circular-dict/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-05-12","license_spdx":null,"license_treatment":"permissive","name":"circular-dict","python_support":"supports_current","summary":"CircularDict is a high-performance Python data structure that blends the functionality of dictionaries and circular buffers. Inheriting the usage of traditional dictionaries, it allows you to define constraints on size and memory usage. This way, the CircularDict will be always up-to-date with the last N added elements, ensuring that neither the maximum length nor the memory usage limit is exceeded. It is ideal for caching large data structures while maintaining control over memory footprint."},"popularity":{"monthly_downloads":2073794,"position":3320,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.9"}
