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.0

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.0
File Size Uploaded Provenance Actions
sharedbox-0.11.0.tar.gz 989.9 kB With provenance Details for sharedbox-0.11.0.tar.gz

Built distributions (wheels)

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

Total release size: 8.4 MB

Release files / sharedbox-0.11.0.tar.gz

Download URL sharedbox-0.11.0.tar.gz
Size 989.9 kB
Tags Source
SHA-256 checksum
How to use checksums
156f421889e8e1cdad4563c739186c34472f883681da293659c63e3bc1080a5b
BLAKE2b-256 checksum
How to use checksums
34fe0f528ee44b921439477b631f110c1bc3437c2efb549ca4b990207ec031e3
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 20, 2026.

Transparency log

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

Download URL sharedbox-0.11.0-cp314-cp314t-win_amd64.whl
Size 890.7 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
ff54d1b6eff7f9f4b4e16f21a3344d1e43978888506e017fe14383ef59c00eba
BLAKE2b-256 checksum
How to use checksums
9b9df270f51629b9b3442d58b590c8e04e7731148fab0f54ae327834fc37bde7
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 20, 2026.

Transparency log

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

Download URL sharedbox-0.11.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 851.6 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
7db035f0397e2f118434ef2d4b11374a43d3bbae2d395a7d1433633aed33104a
BLAKE2b-256 checksum
How to use checksums
a282e2c005c908a20cc639e5204183ed6fbfc8ba345339a1e519c298125f2791
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 20, 2026.

Transparency log

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

Download URL sharedbox-0.11.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 751.4 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
21f062e94e79301379d60b00fb9a398f7709ecf133b6ff42e5868e80d3364350
BLAKE2b-256 checksum
How to use checksums
1440992f4589b909554ffb2ef503e1512528df097a0aa1e6866151b42d8bd608
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 20, 2026.

Transparency log

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

Download URL sharedbox-0.11.0-cp312-abi3-win_amd64.whl
Size 865.0 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a443fac03fe60e074307941d7376d2647790be6e259858ebd79603a41576e6c0
BLAKE2b-256 checksum
How to use checksums
6d7b49a4bc1f40ff4808f590c4f8d57c7c8566d6bddffccdca5fa102850debc6
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 20, 2026.

Transparency log

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

Download URL sharedbox-0.11.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 845.9 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
6c22b1715a61d1e6d9dfe94fe989670cd430c3aa1d230f1a93f2939d0c6e6931
BLAKE2b-256 checksum
How to use checksums
063710d0159eac6636f58f74c8870ca46206d2da3b553b68ca78e4e621c6c1f5
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 20, 2026.

Transparency log

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

Download URL sharedbox-0.11.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 746.0 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
2343d78be4a49ee663eed13cde22c95abaee4e704c42362f2389e0f5b6ed9f9f
BLAKE2b-256 checksum
How to use checksums
0705b4c47de12e89fb73ee753b0e70aa6aafbd93c7972e05d68adc57455473b4
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 20, 2026.

Transparency log

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

Download URL sharedbox-0.11.0-cp311-cp311-win_amd64.whl
Size 863.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
c15219fa8015108e24b217f2961075c746592b810489e9ea2fae96c1d4c0e39a
BLAKE2b-256 checksum
How to use checksums
624d47d9aa7cbb90cc74971279cdfe62997831b92c9534f0a53522f173d02cf6
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 20, 2026.

Transparency log

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

Download URL sharedbox-0.11.0-cp311-cp311-musllinux_1_2_x86_64.whl
Size 845.1 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
249802aef4f8d635330a05b28014c7daf3fb350d426458f9a86a52c55d335e85
BLAKE2b-256 checksum
How to use checksums
312705c6fac0c72e0b41badddf0a302ea7b096dd9c61ed4767d24a5ce37120f3
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 20, 2026.

Transparency log

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

Download URL sharedbox-0.11.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 744.1 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e07ad04330c8a51790f579954a37b8169caf76bd6b7b4a59d99263342f0d5b8d
BLAKE2b-256 checksum
How to use checksums
60af29adeda331003fb41459111573e2b64b703af6eefc4940eaaa02f6dcadb8
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 20, 2026.

Transparency log

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

Full provenance

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

Select from 10 files

Attestation for sharedbox-0.11.0.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 20, 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