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.1.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.1.0
File Size Uploaded
bramble_graphql-0.1.0.tar.gz 221.1 kB Details

Built distributions (wheels)

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

Download URL bramble_graphql-0.1.0.tar.gz
Size 221.1 kB
Tags Source
SHA-256 checksum
How to use checksums
50cd396b78293466cf64841b430a78c58fa03aff4639ee228437b112112ab312
BLAKE2b-256 checksum
How to use checksums
f2ae048f4cb550baed504764569fc020b060f4274a93c9afaab9dd42fc22a656
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 17, 2026.

Transparency log

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

Download URL bramble_graphql-0.1.0-cp310-abi3-win_amd64.whl
Size 837.1 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5a505dd72dd40e07fcf38e8d61d84aefe43150f96989900b81dfb0c98801ede2
BLAKE2b-256 checksum
How to use checksums
0e9e98d0f151b53d17cc37cade93badb574fbea4fc4589f8a10b999196d239be
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 17, 2026.

Transparency log

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

Download URL bramble_graphql-0.1.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
4531c1f6a57a0ae134c4887b2e8ea954afbe1b2ac567b8575ec550b5a9e5a68e
BLAKE2b-256 checksum
How to use checksums
d2966c32ac6f44f34a4d4abfe08466506a06d51940ef1da196ab8c93551be3e5
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 17, 2026.

Transparency log

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

Download URL bramble_graphql-0.1.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
74127157264a9083d41c5e61a597c04bd72310cc7df9922423273510eb8a86ed
BLAKE2b-256 checksum
How to use checksums
3c11e9520f11c55650af2c4e7bf0d2155a49cdb1b1f1da835d0e37e961b0568e
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 17, 2026.

Transparency log

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

Download URL bramble_graphql-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 928.4 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c3167cfc4715f7bd94a1a9a98a8b0b5a23f69c61085a4468a7b12afd9a8c4384
BLAKE2b-256 checksum
How to use checksums
8804575cf27d3d101198c93c5e462ad68b3627c12128090286311e3f76466e29
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 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

5 release files

0.3.0

5 release files

0.2.0

5 release files

This release

0.1.0 This release

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