Bramble GraphQL
A GraphQL library for Python, with parsing, validation, and query lowering implemented in Rust and exposed through a thin PyO3 extension. The schema-declaration API (decorators, type resolution, directives) is pure Python and dataclass-based.
Features
- Decorator-based schema definition:
@bramble.type,@bramble.interface,@bramble.input,@bramble.union,@bramble.scalar - Real dataclasses under the hood —
@bramble.type-decorated classes are ordinary dataclasses, not a parallel object model - Custom scalars, schema directives, and operation directives (
@skip,@include, and user-defined directives), each with location validation - Async and sync execution (
Schema.execute/Schema.execute_async), with spec-correct null bubbling, fragment/field merging, and concurrent field and list-item resolution (mutations execute their root fields serially, per spec) - SDL rendering (
Schema.to_sdl()) and Automatic Persisted Queries - Rust-based parsing and validation for performance and spec conformance
Installation
Requires Python 3.10+.
pip install bramble-graphql
The distribution is named bramble-graphql on PyPI; the import package is
bramble:
import bramble
Prebuilt wheels are published for Linux (x86_64, aarch64), macOS (Apple silicon), and Windows (x64). Other platforms fall back to the sdist, which needs a Rust toolchain to build.
To pull in an HTTP framework's dependencies alongside Bramble, install the
matching extra — asgi, starlette, fastapi, flask, django, or cli:
pip install "bramble-graphql[fastapi]"
Quickstart
import bramble
@bramble.type
class Query:
@bramble.field
def hello(name: str = "world") -> str:
return f"Hello, {name}!"
schema = bramble.Schema(query=Query)
result = schema.execute("{ hello }")
# {'data': {'hello': 'Hello, world!'}}
print(schema.to_sdl())
# schema {
# query: Query
# }
#
# type Query {
# hello(name: String! = "world"): String!
# }
See examples/blog for a fuller schema covering
interfaces, unions, custom scalars, schema/operation directives, mutations,
and async resolvers.
Development
Working on Bramble itself needs a Rust toolchain. maturin builds the extension in place:
pip install -e ".[dev]"
# Rust
cargo test --workspace
cargo clippy --workspace --all-targets
# Python (rebuild the extension after any Rust change)
maturin develop
pytest
Project layout
crates/bramble-core— pure Rust: parsing, validation, lowering, SDL rendering, error types. No Python dependency.crates/bramble-py— PyO3 bindings exposingbramble-coreto Python.bramble/— the Python package: schema-declaration decorators, execution engine, and the public API.tests/— Python test suite.examples/— example schemas.
License
Dual-licensed under MIT or Apache 2.0, at your option.
Metadata
Release files for bramble-graphql 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bramble_graphql-0.3.0.tar.gz | 223.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| bramble_graphql-0.3.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| bramble_graphql-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| bramble_graphql-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| bramble_graphql-0.3.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 4.0 MB
Release files / bramble_graphql-0.3.0.tar.gz
| Download URL | bramble_graphql-0.3.0.tar.gz |
|---|---|
| Size | 223.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3e7ee9e102ddcfdf60c20724c9a1bb7d5b58b5bbcd86d36f847819b66e695e6
|
|
BLAKE2b-256 checksum How to use checksums |
a839e77ddd562167a4cfae33c33dcb867c2d6f7666476dba81b14914e140dcfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 7, 2026.
Transparency logRelease files / bramble_graphql-0.3.0-cp310-abi3-win_amd64.whl
| Download URL | bramble_graphql-0.3.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 839.6 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5970fd4c8c335ddbe29938a54cc345256002f980bce849eb8386b5b702b2f8d3
|
|
BLAKE2b-256 checksum How to use checksums |
55957073d5ec64622003ac186a827a01542511aa7d05c4a86d72110cd5cb19ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 7, 2026.
Transparency logRelease files / bramble_graphql-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bramble_graphql-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0c4941b6775ad6df532897d4b3a4fdee1d9d8e42f4052041db3080450db33666
|
|
BLAKE2b-256 checksum How to use checksums |
bdf7b8dfe49159d3f07d7c7ff4b2a274fb578f4b6bd8f52c940c55ddabf11c01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 7, 2026.
Transparency logRelease files / bramble_graphql-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bramble_graphql-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
83477e827a0b26b9d0164bf9661406c8971c55e9f78411d45fa92756456ff6d2
|
|
BLAKE2b-256 checksum How to use checksums |
094a147233cfec0ea7ada84862ba4110a330b95a6509df05f42ad744ff8d8cbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 7, 2026.
Transparency logRelease files / bramble_graphql-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | bramble_graphql-0.3.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 931.7 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
67f0dcb3c3effab203a768ae86ec07451ef863322db59b4972d0764f29a6ebe1
|
|
BLAKE2b-256 checksum How to use checksums |
440aecb756edc7f3f313d8f18c8882f0eed76eefdf36c44d8207eb91a6c01fbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 7, 2026.
Transparency log