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.7.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.7.0
File Size Uploaded Provenance Actions
sharedbox-0.7.0.tar.gz 693.8 kB With provenance Details for sharedbox-0.7.0.tar.gz

Built distributions (wheels)

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

Total release size: 6.7 MB

Release files / sharedbox-0.7.0.tar.gz

Download URL sharedbox-0.7.0.tar.gz
Size 693.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cb7334b9c47fb34d84a2222690ba812d41bd21144a719a6aac11e9de104e3d7a
BLAKE2b-256 checksum
How to use checksums
3a392d88d44366c0386e21f1fe9d7f0e8895401c362df8aec05d3946ba1c3310
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 Oct 28, 2026.

Transparency log

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

Download URL sharedbox-0.7.0-cp314-cp314t-win_amd64.whl
Size 745.7 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
bb53aea64a8652000505c771afe9efc6dfa94f91f0a110a4281ee04c78d88ee9
BLAKE2b-256 checksum
How to use checksums
de0ffc478ab66cd384ebbdf6bbc64bb3b89a36a687cbc21a6cc6659bf0d7920a
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 Oct 28, 2026.

Transparency log

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

Download URL sharedbox-0.7.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 691.4 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
47c4452e3fe22aa2e00bf4774a88a914f99bca01965ba6e011ef38ce5c556c25
BLAKE2b-256 checksum
How to use checksums
df501209b59ebe02b4cdbc8c7a7020608745cdc6535ae01ec3da6be6723d3aec
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 Oct 28, 2026.

Transparency log

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

Download URL sharedbox-0.7.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 591.0 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
7dbddbae9753a6eb1c61f90350b4b39e245e13739d989d00c2950a6902806bb4
BLAKE2b-256 checksum
How to use checksums
7310b07a33d6f2d0c960356bdc48c815361f77581ea2d924cb47901947e59e68
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 Oct 28, 2026.

Transparency log

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

Download URL sharedbox-0.7.0-cp312-abi3-win_amd64.whl
Size 720.4 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b5ee30a33a421fe4163fd4862788e658d086cb86c8b42490884ca2385bff2f9e
BLAKE2b-256 checksum
How to use checksums
ca0a0bac64403a9e8bba7981fb545354eff90ec633bf37c025ceb51d5556152d
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 Oct 28, 2026.

Transparency log

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

Download URL sharedbox-0.7.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 683.9 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
3f75ea2237e0c1a297d8a26fedfd24eb8e00e1307cb41aa6be75c36844d8ba3e
BLAKE2b-256 checksum
How to use checksums
bcd659f1669b445861aee831ca815e8373c1b11754707f33b73612255a02861f
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 Oct 28, 2026.

Transparency log

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

Download URL sharedbox-0.7.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 584.5 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
cf8280e911f7c39a2913a667d5742fc75a2b6b5017bcb57f541e1c9dc8e5f6a2
BLAKE2b-256 checksum
How to use checksums
7e7423255d9f03f8a1b5e67b33f0b7ce8ad6de05a3e7e07a443e33337f475986
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 Oct 28, 2026.

Transparency log

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

Download URL sharedbox-0.7.0-cp311-cp311-win_amd64.whl
Size 719.3 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
62ef9890abde8992f3a176b042786ccf5024c8fa4783b0e102730903accdb897
BLAKE2b-256 checksum
How to use checksums
266ab1387f1b674d45d61d6fd0e9dbe1487a856c80283d94621b5e40bdcdb94b
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 Oct 28, 2026.

Transparency log

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

Download URL sharedbox-0.7.0-cp311-cp311-musllinux_1_2_x86_64.whl
Size 680.8 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
1ac1e8f98fe8845c0fc61e2f9a7237acb3f15cabf98f03cbeadd4bfff58839fd
BLAKE2b-256 checksum
How to use checksums
68b9a8450b49857e80fa2a7f1ff666a39415959bc1082e7000ae79a6814fe43e
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 Oct 28, 2026.

Transparency log

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

Download URL sharedbox-0.7.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 582.4 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1f8dd7e801c6c06e3888c1748c6e5c2018c7fecab444c32ae4fdee19c8827dcd
BLAKE2b-256 checksum
How to use checksums
8bddd6b771917b6bb9e06029a555d5d1b447eefd402786776846648af38ded30
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 Oct 28, 2026.

Transparency log

Security for sharedbox 0.7.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.7.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 Oct 28, 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