Skip to main content

Provides a relational query language that is pythonic and intuitive. Entity Query Language serves as a front end to other query languages like sql or prolog

Project description

Entity Query Language (EQL)

EQL is a relational query language that is pythonic, and intuitive.

The interface side of EQL is inspired by euROBIN entity query language white paper.

Installation

pip install entity_query_language

Documentation

Read the documentation here.

Example Usage

An important feature of EQL is that you do not need to do operations like JOIN in SQL, this is performed implicitly. EQL tries to mirror your intent in a query statement with as less boiler plate code as possiple. For example an attribute access with an equality check to another value is as simple as using python's dot notation with the equality operator. For example:

from entity_query_language import entity, an, let
from dataclasses import dataclass
from typing_extensions import List


@dataclass(unsafe_hash=True)
class Body:
    name: str


@dataclass(eq=False)
class World:
    id_: int
    bodies: List[Body]


world = World(1, [Body("Body1"), Body("Body2")])

results_generator = an(entity(body := let("body", type_=Body, domain=world.bodies), body.name == "Body2")).evaluate()
results = list(results_generator)
assert results[0].name == "Body2"

where this creates a body variable that gets its values from world.bodies, and filters them to have their att "name" equal to "Body1".

To Cite:

@software{bassiouny2025eql,
author = {Bassiouny, Abdelrhman},
title = {Entity-Query-Language},
url = {https://github.com/AbdelrhmanBassiouny/entity_query_language},
version = {1.3.0},
}

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

entity_query_language-1.4.1.tar.gz (84.8 kB view details)

Uploaded Source

Built Distribution

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

entity_query_language-1.4.1-py3-none-any.whl (55.2 kB view details)

Uploaded Python 3

File details

Details for the file entity_query_language-1.4.1.tar.gz.

File metadata

  • Download URL: entity_query_language-1.4.1.tar.gz
  • Upload date:
  • Size: 84.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for entity_query_language-1.4.1.tar.gz
Algorithm Hash digest
SHA256 6b71476bfed1e7334de309c036e83e91039d7a2b9a99836e3efb9352b88c3360
MD5 3d14be72cf69355ec3748ee87a962ab9
BLAKE2b-256 86291feaf32476bef88c0709a12b0ef4c9d6cfac4341422bec1cd1f8f5da7fba

See more details on using hashes here.

Provenance

The following attestation bundles were made for entity_query_language-1.4.1.tar.gz:

Publisher: publish-to-test-pypi.yml on AbdelrhmanBassiouny/entity_query_language

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file entity_query_language-1.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for entity_query_language-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4e1af1f85afa12cd52d76b43e9f40e3a5cde596328ae2534bc71b26fa4afbaa
MD5 181cac33d5de82a3bb56370421f1d967
BLAKE2b-256 0cd6d82fc1d01e169da33c3933be2491db135b28f17abb72f15fdb46d57f7659

See more details on using hashes here.

Provenance

The following attestation bundles were made for entity_query_language-1.4.1-py3-none-any.whl:

Publisher: publish-to-test-pypi.yml on AbdelrhmanBassiouny/entity_query_language

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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