Skip to main content

Pythonish query language for dictionary-like data

Project description

pythonish-ql

A Pythonish 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.

Originally, I had extended the syntax of language Python and therefore called this Pythonish. However, currently, the language is pure Python without any change in syntax.

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

Each object can be identified by its type, eg person, note, family, etc. 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.

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 Distribution

pythonish_ql-0.0.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pythonish_ql-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pythonish_ql-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0d71f17e8d4a4a019d683e2ee2088f83b2b6d84d6835143e5db1a1cc1b56a5c4
MD5 574e5d9b5669e0a855ac87445bf3e2e2
BLAKE2b-256 2fa838157dbb2a42785f6ef8f0cf4f9e316fd7a167621bb91c74f4790916b99d

See more details on using hashes here.

Supported by

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