memorywrapper
MemoryWrapper provides a slice-able front-end for a list of non-continuous memory backends, and only
joins the needed area into a bytes object as needed.
It uses the new __buffer__ protocol that is implementable in python starting with python 3.12.
Installing
pip install memorywrapper
Using
>>> from memorywrapper import MemoryWrapper
>>> import struct
>>> memory = MemoryWrapper([b"\x01\x02\x03", bytes([4,5,6])])
>>> part = memory[1:-1]
>>> (value,) = struct.unpack(">I", part)
>>> f"0x{value:08x}"
'0x02030405'
make_slices
make_slices provides a way to cut something like bytes, memoryview, or memorywrapper into equal-sized chunks.
>>> from memorywrapper import make_slices
>>> list(make_slices([1,2,3,4,5,6,7,8,9], 3))
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
Metadata
Release files for memorywrapper 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| memorywrapper-0.0.1.tar.gz | 7.6 kB | Without provenance | Details for memorywrapper-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| memorywrapper-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for memorywrapper-0.0.1-py3-none-any.whl |
Total release size: 12.9 kB
Release files / memorywrapper-0.0.1.tar.gz
| Download URL | memorywrapper-0.0.1.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54299d3b0c104a76c467a91df55f164aa47329f6ec7a25101cd5c6b1fdfceb08
|
|
BLAKE2b-256 checksum How to use checksums |
3c6675a947f44cd04fcb37b898e6bc4e5e051fdd8b4fc16761a2f55723d772d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / memorywrapper-0.0.1-py3-none-any.whl
| Download URL | memorywrapper-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f45600d9f5758723ce9489335c42c35462dc6eb81079aa2c8c60fae3e62629c
|
|
BLAKE2b-256 checksum How to use checksums |
660f51d3ba4249e8fe0881bc5fcca656374c473455e51f44000eba875e9b6292
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for memorywrapper 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.