Skip to main content

sharedbox

PyPI CI CodSpeed Ruff clang-format Checked with mypy

sharedbox lets Python processes on one machine share data in shared memory, without a server and without pickling. It gives you two things to share:

  • a box, one record that every process reads and writes, as if they all held the same dataclass;
  • a stream, a flow of typed items that one process sends and each reader receives once.

You declare the fields once, and every process that opens the box or the stream works on the same bytes in shared memory, so nothing passes through a pipe or a socket between the processes. That fits wherever separate processes need the same data at once: web workers sharing state with a dashboard, a GUI and the backend process that does its work, the stages of a data pipeline, the state of a game or a simulation, or lab instruments and the programs that show them.

Installation

sharedbox needs CPython 3.11 or newer on Windows x64 or Linux x86_64. PyPI has compiled wheels, so you don't need a compiler:

pip install sharedbox

or, in a project that uv manages:

uv add sharedbox

Quick start

import multiprocessing as mp
from typing import Annotated

from sharedbox import Capacity, SharedBox


class Mailbox(SharedBox):
    letters: int
    flag_up: bool
    owner: Annotated[str, Capacity(32)]


def deliver() -> None:
    mailbox = Mailbox.attach()  # finds the box by its class
    mailbox.letters = 1
    mailbox.close()


if __name__ == "__main__":
    with Mailbox(0, False, "Ada") as mailbox:
        mailbox.events.letters.connect(lambda new, old: print(old, "->", new))
        carrier = mp.Process(target=deliver)
        carrier.start()
        carrier.join()  # prints: 0 -> 1
    Mailbox.unlink()

The carrier process finds the box by its class alone, and the parent prints the change as soon as the carrier makes it.

Documentation

The documentation site starts with three tutorials, then has how-to guides for single tasks, such as sending items through a stream. After them come explanations of how a box works and the API reference. C and C++ code can use a box too, either handed over from Python or opened by name; the C and C++ guides show how.

Development

To change sharedbox itself you need git, uv, CMake 3.30 or newer and a C++20 compiler (MSVC or GCC):

git clone https://github.com/jacopoabramo/sharedbox.git
cd sharedbox
uv sync --dev
uv run pytest

How to set up a development environment has the details.

License

Licensed under Apache 2.0

Metadata

Release files for sharedbox 0.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sharedbox 0.11.1
File Size Uploaded Provenance Actions
sharedbox-0.11.1.tar.gz 994.5 kB With provenance Details for sharedbox-0.11.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for sharedbox 0.11.1
File Actions
sharedbox-0.11.1-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for sharedbox-0.11.1-cp314-cp314t-win_amd64.whl
sharedbox-0.11.1-cp314-cp314t-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 Details for sharedbox-0.11.1-cp314-cp314t-musllinux_1_2_x86_64.whl
sharedbox-0.11.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for sharedbox-0.11.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
sharedbox-0.11.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for sharedbox-0.11.1-cp312-abi3-win_amd64.whl
sharedbox-0.11.1-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details for sharedbox-0.11.1-cp312-abi3-musllinux_1_2_x86_64.whl
sharedbox-0.11.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for sharedbox-0.11.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
sharedbox-0.11.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for sharedbox-0.11.1-cp311-cp311-win_amd64.whl
sharedbox-0.11.1-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details for sharedbox-0.11.1-cp311-cp311-musllinux_1_2_x86_64.whl
sharedbox-0.11.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for sharedbox-0.11.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 8.5 MB

Release files / sharedbox-0.11.1.tar.gz

Download URL sharedbox-0.11.1.tar.gz
Size 994.5 kB
Tags Source
SHA-256 checksum
How to use checksums
13f1e6f521d18b51ec15abba8f105495f0ba58a7660de31792572476e8e9c935
BLAKE2b-256 checksum
How to use checksums
9b0101f753e5f92fe5d09afe5d365583c5c32be5a3273eb3489e4a71cf860a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / sharedbox-0.11.1-cp314-cp314t-win_amd64.whl

Download URL sharedbox-0.11.1-cp314-cp314t-win_amd64.whl
Size 901.1 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
3609d1781c317f0afac4a765c88045965f0b56a78bd14f577768e16cfb7413c3
BLAKE2b-256 checksum
How to use checksums
c45b6b75178385d6f0961d58270a7c06d134370a71663be48b756fcc77cd3dfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / sharedbox-0.11.1-cp314-cp314t-musllinux_1_2_x86_64.whl

Download URL sharedbox-0.11.1-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 862.1 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
5fa74c7cc65926c3fc9684e3d0d0b1be236ed8fa6e80f28d1c236795e643c803
BLAKE2b-256 checksum
How to use checksums
dc6abca3350d63850fe91c74b8d219e980ab422321e55c843e7bdbe8eb08f839
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / sharedbox-0.11.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL sharedbox-0.11.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 761.9 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
538f082369ecba56b3368d372e425c9d942b3db3979aac97e4c97b9ea6029956
BLAKE2b-256 checksum
How to use checksums
c894eb1d9ed3975f6a0c862c5e6744a604ed0647bf4a8fa91efefbe36b0f9bf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / sharedbox-0.11.1-cp312-abi3-win_amd64.whl

Download URL sharedbox-0.11.1-cp312-abi3-win_amd64.whl
Size 871.7 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
cbfb33f0650d1bd2cb07ff27d0d99cb431653e9d322d2f0dbaadbd6834b9aec7
BLAKE2b-256 checksum
How to use checksums
5cb39e4f094d504e1721eff84a47b8f14455008dac8acd73400d7a0b08b2d1c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / sharedbox-0.11.1-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL sharedbox-0.11.1-cp312-abi3-musllinux_1_2_x86_64.whl
Size 856.3 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
4ed8a33326a0d9f341d3e8da8cb2414010ad3238d0543aa14543f176bfcfccf4
BLAKE2b-256 checksum
How to use checksums
8bce589dbe3c00950cd614e851b0382c4afac59546eb72e8af4d50ee6b1deb44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / sharedbox-0.11.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL sharedbox-0.11.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 756.6 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
1b7e513e4dc28da64baa9f81bf74cc5c135502be1889cd7c76935062743eb1c9
BLAKE2b-256 checksum
How to use checksums
5db4ee1a0ae98d6b138bcefb40bd6a7e379c0983ba0e596192604f48156026f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / sharedbox-0.11.1-cp311-cp311-win_amd64.whl

Download URL sharedbox-0.11.1-cp311-cp311-win_amd64.whl
Size 871.1 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
1b36ea44631b3c790bd2b267488fbda5c04aee3254a18ad96677af3777e27698
BLAKE2b-256 checksum
How to use checksums
adfbf6242043e9cba7c2e583228910acf345d3cec4c17f0a3998cc9e9f594368
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / sharedbox-0.11.1-cp311-cp311-musllinux_1_2_x86_64.whl

Download URL sharedbox-0.11.1-cp311-cp311-musllinux_1_2_x86_64.whl
Size 855.6 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
7c1db005f24434abb0959bebdee66f855d6015f76649876882534178db817e33
BLAKE2b-256 checksum
How to use checksums
473635296a041646603cb65697e95da6ba9b7ba9156b01705915ab0786b3e852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / sharedbox-0.11.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL sharedbox-0.11.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 755.8 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d540261985e01afb9e1287a1bb994577eec88d7d36b33ae3354e172c531fb5f3
BLAKE2b-256 checksum
How to use checksums
f4908328174fd67038a78b46c375523041d292428b425ffdfd355793ae43b95d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for sharedbox 0.11.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.

Full provenance

All 10 files in this release have been uploaded with provenance metadata.

Select from 10 files

Attestation for sharedbox-0.11.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page