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, among them sending items through a stream, 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.9.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.9.0
File Size Uploaded Provenance Actions
sharedbox-0.9.0.tar.gz 842.6 kB With provenance Details for sharedbox-0.9.0.tar.gz

Built distributions (wheels)

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

Total release size: 7.9 MB

Release files / sharedbox-0.9.0.tar.gz

Download URL sharedbox-0.9.0.tar.gz
Size 842.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ceb43377c856ac76ecdd1a5ff8343ae0b7f8c911672889b8b70ea1e8f80f3df5
BLAKE2b-256 checksum
How to use checksums
c98070850dfd22ee7518baf6a048c9527ebe0546605b4b35be383bb84cd7b1c9
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 4, 2026.

Transparency log

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

Download URL sharedbox-0.9.0-cp314-cp314t-win_amd64.whl
Size 850.8 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
7b1e662a89882803492bf4dc2ff54da3cba057d0e290cacf7d9b60aae6801686
BLAKE2b-256 checksum
How to use checksums
031db2575950ece86690541d1b69b484b785cb8034f89ad91590a2007fbacc68
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 4, 2026.

Transparency log

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

Download URL sharedbox-0.9.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 809.3 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
5558ee05d403ea3c4271f34d6b54c3af4ed5a4ed10960c045563391bb9079e90
BLAKE2b-256 checksum
How to use checksums
9d2a834329f7abd39483f485f6f6d94f7a30ec7ce42b95023151ed588f52e94f
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 4, 2026.

Transparency log

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

Download URL sharedbox-0.9.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 708.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
f4609b6de3b1a2e33af86935ea865381551980847b63763a22213afe5a24371e
BLAKE2b-256 checksum
How to use checksums
3bef778fc420fe3e1812f4f8bb6e9cf707e7e2bc1a1164473fb7115871319756
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 4, 2026.

Transparency log

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

Download URL sharedbox-0.9.0-cp312-abi3-win_amd64.whl
Size 822.6 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b66d089fff213b7f8f8f9a3e012883baa123f532715951f4dc8a54ce67ad088d
BLAKE2b-256 checksum
How to use checksums
9504586fb911985e63ceed79748f97fe32ad10f21bd2584192f225d4270d1ec7
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 4, 2026.

Transparency log

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

Download URL sharedbox-0.9.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 802.2 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
7365861e3fdf13956252ad348ee25b98d7e3731776520bf4ebb2f2fe5c84fae0
BLAKE2b-256 checksum
How to use checksums
9718254f807f4835ad56351d0ff2deb27ced601f9fbd65669856e6224a41247a
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 4, 2026.

Transparency log

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

Download URL sharedbox-0.9.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 703.3 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
cc22122f4a25a7d17b57e2cc94dc8eb467e02c25789a543d0950b1a32cc77339
BLAKE2b-256 checksum
How to use checksums
9f06bbd07c12a501acc426aa4d156d72dee665577efeb7bd11486b491843288a
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 4, 2026.

Transparency log

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

Download URL sharedbox-0.9.0-cp311-cp311-win_amd64.whl
Size 821.4 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
59e8fe7b11fb03a61eb3f59efd22bb06cf0514d881da8748c9cc34b4f082d816
BLAKE2b-256 checksum
How to use checksums
b3fdc53dada46b925d27dbb25167eef80ae81a83a0d71b6d7b0e0efb90111af6
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 4, 2026.

Transparency log

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

Download URL sharedbox-0.9.0-cp311-cp311-musllinux_1_2_x86_64.whl
Size 800.8 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
8e0c4fb062bbeae176bf2636bbb328e06d4b949ad69fb1b92ed82fca8dfb6380
BLAKE2b-256 checksum
How to use checksums
c78fa76e23260c69db6589cb93173d12eb4f0a6b9986994cc6688218840a4d35
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 4, 2026.

Transparency log

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

Download URL sharedbox-0.9.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 700.5 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
18b711151051fefc4a4b20e3c92b0f9f26ea27f265c4d85b8cfe44d6bd5eca2f
BLAKE2b-256 checksum
How to use checksums
1aa3e5b74608ab8ec63e7dd328e0ef0054a20975029b22053252809383a50896
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 4, 2026.

Transparency log

Security for sharedbox 0.9.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.9.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 4, 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