Skip to main content

pandas_gdc_agent

This project explores the Hasura Graphql Data Connectors (GDC) using pandas Dataframe as backend.

To quickly get started, please go through a sample app in example.py.

GDCAgent

Link to pip package: https://pypi.org/project/pandas-gdc-agent/

The GDCAgent constructor takes a list of tuples, where the first element is the table name and the second element is the DataFrame which corresponds to the table name. To setup a GDCAgent, run the following:

# setting up GDC Agent
agent = GDCAgent([("table1",df1),("table2", df2)])

Please note that the dataframe must have the primary key as index.

After setting up the GDCAgent, start the GDCAgent server by running the following:

# starting the GDC Agent
agent.run_agent()

When you run the GDCAgent, it starts a flask server and exposes the required endpoints explained here.

Run example

The example.py uses the chinook database. To run the example, first create a virtual environment:

python3 -m venv gdc_env 

Now, activate the virtual environment and install the requirements

source gdc_env/bin/activate
pip install -r requirements.txt

Next, start the GDC agent:

python example.py

Now start a Hasura Graphql Engine:

curl https://raw.githubusercontent.com/hasura/graphql-engine/stable/install-manifests/docker-compose/docker-compose.yaml -o docker-compose.yml

docker-compose up

Now apply the following metadata:

POST /v1/metadata
{
  "type": "replace_metadata",
  "args": {
    "metadata": {
      "version": 3,
      "backend_configs": {
        "dataconnector": {
          "reference": {
            "uri": "http://localhost:5000/"
          }
        }
      },
      "sources": [
        {
          "name": "chinook",
          "kind": "reference",
          "tables": [
            {
              "table": "Album",
              "object_relationships": [
                {
                  "name": "Artist",
                  "using": {
                    "manual_configuration": {
                      "remote_table": "Artist",
                      "column_mapping": {
                        "ArtistId": "ArtistId"
                      }
                    }
                  }
                }
              ]
            },
            {
              "table": "Artist",
              "array_relationships": [
                {
                  "name": "Album",
                  "using": {
                    "manual_configuration": {
                      "remote_table": "Album",
                      "column_mapping": {
                        "ArtistId": "ArtistId"
                      }
                    }
                  }
                }
              ]
            }
          ],
          "configuration": {
            "tables": [ "Artist", "Album" ]
          }
        }
      ]
    }
  }
}

Metadata

Release files for pandas-gdc-agent 0.0.3

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

Source distribution (sdist)

Source distribution for pandas-gdc-agent 0.0.3
File Size Uploaded Provenance Actions
pandas_gdc_agent-0.0.3.tar.gz 15.5 kB Without provenance Details for pandas_gdc_agent-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pandas-gdc-agent 0.0.3
File Interpreter ABI Platform Actions
pandas_gdc_agent-0.0.3-py3-none-any.whl Python 3 none any Details for pandas_gdc_agent-0.0.3-py3-none-any.whl

Total release size: 22.6 kB

Release files / pandas_gdc_agent-0.0.3.tar.gz

Download URL pandas_gdc_agent-0.0.3.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a06f2514ed3b93f2a940701a5a9e3cb0bea8b016c570e05f3b21d109619c2617
BLAKE2b-256 checksum
How to use checksums
c6443412b4f5d1f4d533412093a1fdb2cf0ce4206493f7c227b1465c558dd90f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / pandas_gdc_agent-0.0.3-py3-none-any.whl

Download URL pandas_gdc_agent-0.0.3-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4462cdc94a699e88f844b8e05fe6f12062fb4b683df937b7d7b7b3a1ad48cd5b
BLAKE2b-256 checksum
How to use checksums
6458e82e11fa8425b73471064c365331b2586a6fa08dd79633e8498c3edee2bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Security for pandas-gdc-agent 0.0.3

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.0.3 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