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_languageS

If you want to use the visualization feature, you will also need to install rustworkx_utils.

pip install rustworkx_utils

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 dataclasses import dataclass

from typing_extensions import List

from entity_query_language import entity, an, contains, symbolic_mode, symbol, From


@symbol
@dataclass
class Body:
    name: str


@dataclass
class World:
    id_: int
    bodies: List[Body]


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

with symbolic_mode():
    body = Body(From(world.bodies))
    query = an(entity(body, contains(body.name, "2"),
                      body.name.startswith("Body"))
               )
results = list(query.evaluate())
assert len(results) == 1
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 = {3.1.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-3.1.0.tar.gz (108.9 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-3.1.0-py3-none-any.whl (69.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: entity_query_language-3.1.0.tar.gz
  • Upload date:
  • Size: 108.9 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-3.1.0.tar.gz
Algorithm Hash digest
SHA256 c51a314c64eed120a9ee70fbbddd68c826284b1fe7b13342bb11e83f6914804e
MD5 cad49e26aaf4e83f5102cc66afeb719f
BLAKE2b-256 b4353541871a67b248816c581d90a3774d50deb46eb8c4d434f2c7b84a797b70

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for entity_query_language-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db9b75958bed9f7aec2af5dfd2287ac9a687e46c9778133cbc3d988a2ddf50f1
MD5 7a8132c5b22002dc90929e59e0967929
BLAKE2b-256 8254c96fb554888885fe95b6debd6a92013d9399e3965b49ad6ef72b1eb29db8

See more details on using hashes here.

Provenance

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