Skip to main content

ageqrp

Query Results Parser (QRP) for Apache AGE database queries using psycopg

Urls

Features

  • Easy to use
  • Transforms the augmented AGE JSON into regular JSON

Quick start

Installation

$ pip install ageqrp

Use

import json

from ageqrp import QueryResultParser

import psycopg_pool

...

# This example is from a FastAPI web application

async def post_query(req: Request, query_type):
    form_data = await req.form()
    cypher_query = form_data.get("cypher_query").replace("\r\n", "").strip()
    result_objects = list()
    qrp = QueryResultParser()
        
    try:
        async with req.app.async_pool.connection() as conn:
            async with conn.cursor() as cursor:
                try:
                    await asyncio.wait_for(cursor.execute(cypher_query), timeout=10.0)
                    results = await cursor.fetchall()
                    for row in results:
                        # psycopg results parsed into regular JSON objects here
                        result_objects.append(qrp.parse(row))

The above cypher_query may look something like this:

select * from ag_catalog.cypher('legal_cases',
  $$ MATCH (c:Case {id: 999494})-[r:cites*1..2]->(c2:Case) RETURN c,r limit 100 $$)
  as (c agtype, r agtype);

Also see file sample-program.py in the GitHub repo as well as the unit tests in the tests/ directory.


Changelog

Current version: 0.2.0

  • 2024/12/12, version 0.2.0, Docs and tests enhanced
  • 2024/12/01, version 0.1.0, Initial Production release

Metadata

Release files for ageqrp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ageqrp 0.2.0
File Size Uploaded Provenance Actions
ageqrp-0.2.0.tar.gz 6.1 kB Without provenance Details for ageqrp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ageqrp 0.2.0
File Interpreter ABI Platform Actions
ageqrp-0.2.0-py3-none-any.whl Python 3 none any Details for ageqrp-0.2.0-py3-none-any.whl

Total release size: 10.7 kB

Release files / ageqrp-0.2.0.tar.gz

Download URL ageqrp-0.2.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d37632f31d17cda76d68b9ccd55d30e02e66203097f09b6bd05e144427d9feeb
BLAKE2b-256 checksum
How to use checksums
66de4f37d35d70cd1e22839b2c881e1d83ef28dc1daeb45e94564b090a795ecd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.1

Release files / ageqrp-0.2.0-py3-none-any.whl

Download URL ageqrp-0.2.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
781379afdab125fd00f9da79279c67aca9533ff6b73fa90000aee415b696e143
BLAKE2b-256 checksum
How to use checksums
9e8c180ccf6d074379e4c1750f5bd6c9fdc8b220f075bdda3a9c238813cdb793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.1

Security for ageqrp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page