pyring-buffer


Namepyring-buffer JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttp://github.com/rhasspy/pyring-buffer
SummaryA pure Python ring buffer for bytes
upload_time2023-12-07 17:34:36
maintainer
docs_urlNone
authorMichael Hansen
requires_python
license
keywords ring circular buffer
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyRing Buffer

A pure Python ring/circular buffer for bytes.

``` sh
pip install pyring-buffer
```

``` python
from pyring_buffer import RingBuffer

rb = RingBuffer(10)  # max 10 bytes

# Put only 5 bytes in
rb.put(bytes([1, 2, 3, 4, 5]))

# Everything is there
assert rb.getvalue() == bytes([1, 2, 3, 4, 5])

# Put a total of 12 bytes in
rb.put(bytes([6, 7, 8, 9, 10, 11, 12]))

# First 2 bytes are gone
assert rb.getvalue() == bytes([3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
```


            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/rhasspy/pyring-buffer",
    "name": "pyring-buffer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ring circular buffer",
    "author": "Michael Hansen",
    "author_email": "mike@rhasspy.org",
    "download_url": "",
    "platform": null,
    "description": "# pyRing Buffer\n\nA pure Python ring/circular buffer for bytes.\n\n``` sh\npip install pyring-buffer\n```\n\n``` python\nfrom pyring_buffer import RingBuffer\n\nrb = RingBuffer(10)  # max 10 bytes\n\n# Put only 5 bytes in\nrb.put(bytes([1, 2, 3, 4, 5]))\n\n# Everything is there\nassert rb.getvalue() == bytes([1, 2, 3, 4, 5])\n\n# Put a total of 12 bytes in\nrb.put(bytes([6, 7, 8, 9, 10, 11, 12]))\n\n# First 2 bytes are gone\nassert rb.getvalue() == bytes([3, 4, 5, 6, 7, 8, 9, 10, 11, 12])\n```\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A pure Python ring buffer for bytes",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "http://github.com/rhasspy/pyring-buffer"
    },
    "split_keywords": [
        "ring",
        "circular",
        "buffer"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cd3e09b108df06309ecb8eeb012f6206aae7c0d5bc596e8e51fcbe7486c7e30e",
                "md5": "81b95bcd04e83c81708b26dbe0d7c22e",
                "sha256": "7f63e05307a0412e9dabfa1dad8e7223462153c96f5a1e2759a7316d3aaeeb6e"
            },
            "downloads": -1,
            "filename": "pyring_buffer-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "81b95bcd04e83c81708b26dbe0d7c22e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6380,
            "upload_time": "2023-12-07T17:34:36",
            "upload_time_iso_8601": "2023-12-07T17:34:36.501228Z",
            "url": "https://files.pythonhosted.org/packages/cd/3e/09b108df06309ecb8eeb012f6206aae7c0d5bc596e8e51fcbe7486c7e30e/pyring_buffer-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-07 17:34:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rhasspy",
    "github_project": "pyring-buffer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyring-buffer"
}
        
Elapsed time: 0.19062s