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.8.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.8.0
File Size Uploaded Provenance Actions
sharedbox-0.8.0.tar.gz 769.1 kB With provenance Details for sharedbox-0.8.0.tar.gz

Built distributions (wheels)

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

Total release size: 7.2 MB

Release files / sharedbox-0.8.0.tar.gz

Download URL sharedbox-0.8.0.tar.gz
Size 769.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0272b3c7f5f40d4983554df991aad25f028412cf8ff7a04453742bbb1418edf7
BLAKE2b-256 checksum
How to use checksums
2835dd054423d0afd6e1a7b7f7197eaf78338b5b130a028b49a89f9011423115
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 30, 2026.

Transparency log

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

Download URL sharedbox-0.8.0-cp314-cp314t-win_amd64.whl
Size 794.9 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
8aa55a32e16835a747fa2c727667b6b07b63a4498738e8200abfe30c328b636d
BLAKE2b-256 checksum
How to use checksums
3ddd553602712cf51d81c3b77de5b12cccc9618c71eef04731ec2d75c57f4fa5
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 30, 2026.

Transparency log

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

Download URL sharedbox-0.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 745.5 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
a7fcb760399d530084299eccb5b469214691751f16f1cbd7648feb237245bd82
BLAKE2b-256 checksum
How to use checksums
0ed2fb41366d815ea129dab2a4d3893c877c9c07b5fdf4bf566b96e93ac960de
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 30, 2026.

Transparency log

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

Download URL sharedbox-0.8.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 645.7 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
7c3b4432bca0aacad52652a69f2634a83019c1dd1aeeb91e9937110f7bd3e56f
BLAKE2b-256 checksum
How to use checksums
646cbbf587de6a2bb11f2d52027aa8fdf343f1317afd3fe7de658f23855c9aa9
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 30, 2026.

Transparency log

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

Download URL sharedbox-0.8.0-cp312-abi3-win_amd64.whl
Size 767.5 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
eca5ef2016ed2d01f712c11f102508674d9a7d9970921eeb7a60778930581598
BLAKE2b-256 checksum
How to use checksums
185bbee0484ac331da8989340080de6f7971af73e1ab2607e1a0dec2472e2579
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 30, 2026.

Transparency log

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

Download URL sharedbox-0.8.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 737.9 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
82f6cd1d1e2da6a66e8a17ae169524424f6a48c5d9b4667ef8da7ce0b45108d3
BLAKE2b-256 checksum
How to use checksums
0014f4876c491a8db39842b46b48fe0b37dfa046947a6bb3a06738e4929c30de
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 30, 2026.

Transparency log

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

Download URL sharedbox-0.8.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 639.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
8159db36b717600fb8ecf21a9f3a6f75b4de33f48a063e2f8218642feb1a74f2
BLAKE2b-256 checksum
How to use checksums
de317d7f93390b8669343945043b74c95616aa04ed065af85ddbcf12d4cdba35
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 30, 2026.

Transparency log

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

Download URL sharedbox-0.8.0-cp311-cp311-win_amd64.whl
Size 766.1 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
2e6e416813df8688fd7f2af7c6c3e9140c4244d84fd2762f50e099fa530ec595
BLAKE2b-256 checksum
How to use checksums
541dd9382c1839de622e65c319ec85d78e50828bd68f0736eab458979badc56a
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 30, 2026.

Transparency log

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

Download URL sharedbox-0.8.0-cp311-cp311-musllinux_1_2_x86_64.whl
Size 735.1 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
a1cdd815057b301ab6564282ebcb1a449ad0312f7e2a48ce3dc496c6865a8eec
BLAKE2b-256 checksum
How to use checksums
a4743738c905ee7d52d0ded9093963082508a8981b218f808a940c76e504d3e3
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 30, 2026.

Transparency log

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

Download URL sharedbox-0.8.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 637.7 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
da404d50a2f2d883ce969970348e219af5dbf58ff21cc0f597940f6fcf6b4340
BLAKE2b-256 checksum
How to use checksums
b03698e0148509774106fbd174e9acc102749798e44959501bd9a41e8ef9ab77
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 30, 2026.

Transparency log

Security for sharedbox 0.8.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.8.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 30, 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