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.2.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 bramble-graphql 0.2.0
File Size Uploaded
bramble_graphql-0.2.0.tar.gz 221.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for bramble-graphql 0.2.0
File
bramble_graphql-0.2.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
bramble_graphql-0.2.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.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
bramble_graphql-0.2.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.2.0.tar.gz

Download URL bramble_graphql-0.2.0.tar.gz
Size 221.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2e40da4baf1fcba1d958f7b6cf3721785ceffd6ef6c681b0581cef4acd424688
BLAKE2b-256 checksum
How to use checksums
1c3ea216163b831343fb458cd93160466b38e5cd34eabd9f198e684ffe714c6d
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 Aug 24, 2026.

Transparency log

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

Download URL bramble_graphql-0.2.0-cp310-abi3-win_amd64.whl
Size 838.2 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a04c8430e92bd66ad91cd4bdf06e943c5648628a582768ff7ea48265a057a049
BLAKE2b-256 checksum
How to use checksums
e0eb450d0f9476f8cc13973ec9011acbe4662b6d1779dcdf07ee33b5680ee654
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 Aug 24, 2026.

Transparency log

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

Download URL bramble_graphql-0.2.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
4f29de177dec41d063c5438e266935582db63cfa58663d1951be5daf619c44fa
BLAKE2b-256 checksum
How to use checksums
73a509b8d7c5b77e92716b1826d3c9b4bb32c061fd4c4bd7565dc1079edd82e9
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 Aug 24, 2026.

Transparency log

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

Download URL bramble_graphql-0.2.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
c261caeeeaed51a039ef4752b584f7bdbfc833221c004c8e1884f1481c6cd271
BLAKE2b-256 checksum
How to use checksums
54d3cf2fac63c3029a796af5ccad9694efc9b799d28499e681da7076512559e5
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 Aug 24, 2026.

Transparency log

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

Download URL bramble_graphql-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Size 929.4 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5afa454401a2e6b1eb78e57aa02dcd4751055fb7f28ac65906ee44c496a9d01e
BLAKE2b-256 checksum
How to use checksums
fe5f27ef3feb32a3a0ff46f0f7f49b23f408d4b78822cff665460afdbdcb057b
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 Aug 24, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

5 release files

0.3.0

5 release files

This release

0.2.0 This release

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