Skip to main content

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 exposing bramble-core to 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bramble-graphql 0.3.1
File Size Uploaded
bramble_graphql-0.3.1.tar.gz 224.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for bramble-graphql 0.3.1
File
bramble_graphql-0.3.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
bramble_graphql-0.3.1-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.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
bramble_graphql-0.3.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 4.1 MB

Release files / bramble_graphql-0.3.1.tar.gz

Download URL bramble_graphql-0.3.1.tar.gz
Size 224.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b2cfcc1e0629092a69455f64d5002bea5174cb95a5b18de3bee8bc67ec7a1461
BLAKE2b-256 checksum
How to use checksums
c718856c2cb20a90128e7468d45546ead1ba554ea1daac5754cbf512e2dcbb28
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 Oct 14, 2026.

Transparency log

Release files / bramble_graphql-0.3.1-cp310-abi3-win_amd64.whl

Download URL bramble_graphql-0.3.1-cp310-abi3-win_amd64.whl
Size 853.4 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3fc3acd632628fbe396daebd32428fbc7e72e018485773adf1424bacfad46e89
BLAKE2b-256 checksum
How to use checksums
a405c0de5d4ab4b6e2f3d1f9c3ce45ce11a55b9494c4c340057a612c2e726ed4
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 Oct 14, 2026.

Transparency log

Release files / bramble_graphql-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL bramble_graphql-0.3.1-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
2a66d8d23d01ad74980e0bbf7f84a11b9d94cd5aecee7e4ac83ccd982dc0df93
BLAKE2b-256 checksum
How to use checksums
94d60ac75dd01c849b3e2a73840eb6cfe30dc38eb7048032120937df6c29596f
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 Oct 14, 2026.

Transparency log

Release files / bramble_graphql-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL bramble_graphql-0.3.1-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
e59e0fb2d79597736258da72bbe27886641c627cbc33350161a48f755f8f59c9
BLAKE2b-256 checksum
How to use checksums
e54a48f75d7b706ac45f4fa5fbfcedd587580855593e7646fe0277a7ab817632
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 Oct 14, 2026.

Transparency log

Release files / bramble_graphql-0.3.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL bramble_graphql-0.3.1-cp310-abi3-macosx_11_0_arm64.whl
Size 939.6 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2eec1e9a5a6848261727be07e526a7ce85a94a5a5120bf0b61bff7dd92147e4e
BLAKE2b-256 checksum
How to use checksums
44907c8a4d35d65904b2710a2d6df2cd9aad7e86b9308efb7ffeff563ab7b894
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 Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

5 release files

0.3.0

5 release files

0.2.0

5 release files

0.1.0

5 release files

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