Skip to main content

gramps-object-query-language

A small, closed query AST and SQL compiler for fast object queries against Gramps genealogy data.

This is not a general query language, not GraphQL, and not a raw-SQL passthrough. It compiles a structured Query (select/where/order_by/ limit/after) -- or an "almost Python" expression string -- into parameterized SQL against Gramps' flattened secondary columns, with every column checked against a fixed per-type whitelist before the compiler ever touches it.

It is standalone and privacy-agnostic: it carries no knowledge of proxies, permissions, or any particular web API. An evaluator/proxied_query path is also included for evaluating the same query AST directly against real (possibly proxied) Gramps objects, for callers that can't run raw SQL against an unproxied database.

Install

pip install gramps-object-query-language

Modules

  • gramps_object_query_language.query -- the query AST and SQL compiler.
  • gramps_object_query_language.query_lang -- an "almost Python" expression parser that translates into the same where shape.
  • gramps_object_query_language.evaluator -- evaluates the AST directly against real Gramps objects (no SQL), for use with a proxied database.
  • gramps_object_query_language.proxied_query -- runs a where expression through Gramps' own Filter/Rule machinery against a possibly-proxied database.

Development

pip install -e ".[test]"
pytest

License

GNU Affero General Public License v3 or later (AGPL-3.0-or-later). See LICENSE.

Download files

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

Source Distribution

gramps_object_query_language-0.1.1.tar.gz (37.8 kB view details)

Uploaded Source

Built Distribution

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

gramps_object_query_language-0.1.1-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

Details for the file gramps_object_query_language-0.1.1.tar.gz.

File metadata

File hashes

Hashes for gramps_object_query_language-0.1.1.tar.gz
Algorithm Hash digest
SHA256 98f3ae5e9c6cc71f2f04f1d9909d7dead2419447a7a289c9ed6da37b0e7bd872
MD5 5a20bb303baaf50965d8c187cffe5f2a
BLAKE2b-256 ae6a53811eb78a0741fb0892cc233b21b16583f234fe6732e52609913be4cca5

See more details on using hashes here.

File details

Details for the file gramps_object_query_language-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gramps_object_query_language-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba719f624c9beacf7add0da53d87ac2fb33c28c799d0c3770294a38a93d3e927
MD5 beef7d91e6636174a5024c51fb080ed0
BLAKE2b-256 8af9bc8dd16eba8b326352f01e86e80e6b5e036d1783fc93a65ef2429ac8b4ae

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 Sentry Error logging StatusPage Status page