Skip to main content

Creates a relational query language that is easy to use and 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. This serves as a front end to other query languages like sql or prolog.

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 and equal check to another value is just how you expect:

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 = an(entity(body:=Body, domain=world.bodies), body.name == "Body2")
assert results[0][body].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 = {0.0.1},
}

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-0.0.1.tar.gz (55.7 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-0.0.1-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for entity_query_language-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dbbb7a3b354b093f8cfa94c0256673d96623606100410db0fff0b3409b106355
MD5 6d29b3526c2a87c5756e0dae9ce773d4
BLAKE2b-256 7e282e6753ce442bc408c07ff6aa0e154ff48bf69d944dbc34c66257a30a40ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for entity_query_language-0.0.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-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for entity_query_language-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf646c788d15bb080929d64c73638dc5dcd59adf22f7dd672d9b7aa6b8f3d18b
MD5 6d93443279cd35e4466545350fd75f10
BLAKE2b-256 c0e8ee63a53b2fbf1f90fa1ca828d54219a635c64313c1723fb7b251d906309d

See more details on using hashes here.

Provenance

The following attestation bundles were made for entity_query_language-0.0.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