np-shared-array
Utility for sharing numpy arrays between processes. This can be useful if you have a background process performing a calculation and main process on an API which can query the array.
Usage:
from np_shared_array import create_shared_array, SharedNumpyArray
from multiprocessing import Process
def worker(shared_array: SharedNumpyArray):
array = shared_array.to_numpy()
with shared_array.lock:
array[0][0] = 1
def main():
shape = [10, 10]
shared_array = create_shared_array(shape)
array = shared_array.to_numpy()
p = Process(
target=worker,
args=(shared_array,)
)
p.start()
p.join()
with shared_array.lock:
print(array[0][0])
if __name__ == "__main__":
main()
Metadata
Release files for np-shared-array 1.0.0
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 |
|---|---|---|---|---|
| np_shared_array-1.0.0.tar.gz | 3.5 kB | Without provenance | Details for np_shared_array-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| np_shared_array-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for np_shared_array-1.0.0-py3-none-any.whl |
Total release size: 6.8 kB
Security for np-shared-array 1.0.0
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.