Skip to main content

Object query language for dictionary-like data

Project description

object-ql

An Object Query Language, for the Gramps Project and other objects.

This project is designed to be a drop-in replacement for https://github.com/DavidMStraub/gramps-ql

Rather than having to build, and learn, a new query language, the idea is to build on top of Python, the native language of the Gramps Project. And, rather than having to convert the Gramps raw data into objects, then dicts, and then back again to objects (when needed), this query system can operate directly on the objects.

Each object can be identified by its lower-case class type, eg person, note, family, etc.

Examples:

Find the person with a particular gramps_id:

person.gramps_id == 'person001'

Find all of the people with notes:

person.get_note_list()

Find all of the people with notes that mention 'vote':

any([('vote' in str(get_note(handle).text)) for handle in person.get_note_list()])

Usage

If you don't know what the type is, you can use obj, like:

"23" in obj.gramps_id

You can use standard dot notation to reference any object. Refer to Gramps Primary Objects for the structure of Gramps objects.

You can also use the SimpleAccess methods that make access to some data much easier. The SimpleAccess is available as sa, as shown below.

Select all of the people that have are married to a person named "Donna":

sa.first_name(sa.spouse(person)) == "Donna"

Project details


Download files

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

Source Distribution

object_ql-0.1.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

object_ql-0.1.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file object_ql-0.1.3.tar.gz.

File metadata

  • Download URL: object_ql-0.1.3.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for object_ql-0.1.3.tar.gz
Algorithm Hash digest
SHA256 89ceeb73b704f25f4afe73d8351afeb6d66f8735702701b505c02b159d213d12
MD5 6299f9028aecd0d67d5abef36659df7a
BLAKE2b-256 6ee8e6b6bf7fa0280d4f14c87333c6f7fe48cc85de5fb880910cd7a785a95b9f

See more details on using hashes here.

File details

Details for the file object_ql-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: object_ql-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for object_ql-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8d5b4ed9a298e8e6a9641819e517cc500b339a6121df4bdbbb61feeaa31e98d5
MD5 062e0fb49f2299e14fafbc1aef0cee97
BLAKE2b-256 fe3f168017dd72c21dcc2e81c90f42c3294302b4f226c3b4e56a705b44c6bf1d

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