How-to Guides¶
Each guide walks you through one task. Pick the one that matches what
you're trying to do; if sharedbox is new to you, the
tutorials are a better place to start.
Install¶
- How to install sharedbox: the wheels, the
platforms and the
benchmarksextra
Use a box¶
Name, fill, share and remove a box.
- How to name a box: let the class name it, or choose the name
- How to store text and bytes: pick a capacity and handle values that do not fit
- How to store records: dataclasses, named tuples and typed dicts as one field
- How to store lists, sets and dicts: collections with a capacity in elements
- How to store arrays: a shape, a dtype and any DLPack library
- How to set defaults and check values:
defaults, keyword-only fields and
__post_init__ - How to change several fields at once:
write with
updateand read withsnapshot - How to send a box to another process: as an argument, by name, or to a pool
- How to clean up segments: close, unlink, and recover after a crash
- How to follow a whole reference graph: one callback for changes in every box a box refers to
C and C++¶
Read and write a box from compiled code, with or without Python.
- How to accept a box in a C++ extension: take
the box a Python caller passes, through
sharedbox.hpp - How to accept a box in a C extension: the same
through
sharedbox_c.h - How to open a box from a program: open a box by name from a program with no Python
Measure¶
- How to run the benchmarks: time sharedbox on your
own machine with
benchbox
To change sharedbox itself, see Contributing.