Skip to main content

A query engine for any combination of data sources. Query your files and APIs as if they were databases!

Project description

trustfall — Python bindings

Use the Trustfall query engine from Python.

API

Create a schema object:

from trustfall import Schema

my_schema = Schema(
    """
    Your schema text here, written in GraphQL SDL.

    See an example schema here:
    https://github.com/obi1kenobi/trustfall/blob/main/pytrustfall/numbers.graphql
    """
)

Create an adapter with which to query the schema:

from typing import Any, Dict

from trustfall import Adapter

# Choose the type that is used to represent data vertices:
Vertex = Dict[str, Any]

class MyAdapter(Adapter[Vertex]):
    # Implement the four abstract methods from Adapter.
    ...

Execute queries:

from trustfall import execute_query

my_adapter = MyAdapter(...)

my_query = """
query {
    # your query here
}
"""
args = {
    # query arguments here
}

results_iterator = execute_query(
    my_adapter,
    my_schema,
    my_query,
    args,
)
for result in results_iterator:
    print(result)

Installing trustfall

This package is a wrapper around the Trustfall query engine, which is written in Rust.

Wheels are available for Windows, macOS (both x86 and ARM), and Linux (manylinux), for each supported version of CPython (3.10+).

This package should work on other platforms as well, in which case its Rust components may need to be compiled from source as part of the installation process.

If you get errors while installing this package, please report your OS and architecture info in an issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

trustfall-0.3.0-cp312-cp312-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

trustfall-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

trustfall-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

trustfall-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

trustfall-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

trustfall-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file trustfall-0.3.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for trustfall-0.3.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4f41749d9222f50df944b9b1f7814e2e1cc67d11cb9b2a0c73fb3023324abae2
MD5 6be9cf1d90d14c7092fcfe8be8b40c70
BLAKE2b-256 2d3c6ce71c9f861386da988a53eed73d0d222cadb532293e4aed366478f313fb

See more details on using hashes here.

File details

Details for the file trustfall-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for trustfall-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 15207f6b52ed0e85a1a7db1fce84f053b43bd12a40f7a0e0ee92fca363c57242
MD5 3c0de66e8bc0855b30fef574308ba788
BLAKE2b-256 7351c1513c7c65babc8f42ad34a846119e09e26591747a4c3e7abd5664d65cf0

See more details on using hashes here.

File details

Details for the file trustfall-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for trustfall-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 699bba90fc82737b03f4b7411c7ef7fd95134a37073e97313b16e83ef701ac9f
MD5 7e76c5d1ce3dd2544f0f282e5361256a
BLAKE2b-256 3812eaf0a427901e5790dbc48604a17784dafc2adefdd22efa5b50fccb647fe1

See more details on using hashes here.

File details

Details for the file trustfall-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for trustfall-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 683919f27e45c88ef9538b9bed42bc48b92113e0128830efba203dc139412f63
MD5 a27f2a0150c536fbed8654cfee94b785
BLAKE2b-256 b70e4890258bceadc225fbcdb0ae85f9b2cc8ed60d0bdcf0ab5909d7d5275349

See more details on using hashes here.

File details

Details for the file trustfall-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for trustfall-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 49d73f2a07ddd22776b2181c2621f83042f86549ea8c434de5f5227b2994171a
MD5 31c9b00a1a529b3db69f7573881b23e1
BLAKE2b-256 2acdf959d212c2f5f52e50f54de946ac51b6d1179999116406fc1df12baf1e64

See more details on using hashes here.

File details

Details for the file trustfall-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for trustfall-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c9a4adc8bc3be88f6ab4d2a0de27de6986a4259c5a58f39ebcba0963b5baa4e7
MD5 b50abf10e0be5a1398b585e2ab23956a
BLAKE2b-256 064b159c4b596220eaeb55b824d832c53244522bbc883baa9aa12ad0e0813973

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page