Skip to main content

An interface to pandas for grid data server.

Project description

A higly performant back end for AG-Grid front end.

This API is written to deliver fast responses to requests from a grid front end client on data sets that are too big to be effectively transformed on the front end.

The ag-grid endpoint takes a Pandas dataframe and the corresponding ag-grid request and performs the transformations to the dataframe specified in the request, returning a dictionary formatted as expected by ag-grid.

The source code is available here

Performance

When benchmarked against a purpose-built Java server PDGrid generally outperformed Java. In some cases by a large factor, depending on the size of the data set. Pandas is extremely performant when performing grouping, aggregation, filtering and sorting commands. The biggest bottleneck in most cases will be the loading of the data from db or otherwise. By caching the data in Apache Parquet format this can be speeded up significantly (see example here).

Supported ag-grid features

Pivoting, Pagination, Grouping, Sorting, Aggregrations, Filtering, Asynchronous fetching of set filter values.

Requirements

Python 3.8 or 3.9.

Installation:

From source:

$ git clone git@github.com:slindal/pdgrid.git
$ cd pdgrid
$ python3.9 -m venv env
$ . env/bin/activate
$ python setup.py install

Using package manager (in a python3 venv):

$ python -m pip install pdgrid

Running a test server

Set up mysql database and add a table:

$ cd examples
$ msyql -u root
$ mysql> create database sample_data;
$ mysql> source ./create_athletes.sql;

Install the python packages needed to run the server:

$ python -m pip install -r server_requirements.txt

Finally start up the server (from example directory):

$ export FLASK_APP=server
$ python -m flask run --port=8000

If you have started up a front end client (follow these steps you should be able to see the data set http://localhost:4000

Using other data

No changes are necessary on the server side, beyond changing the function that loads the data from database or elsewhere. The front end client must be updated to handle any changes to the data set.

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

pdgrid-0.1.3.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

pdgrid-0.1.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file pdgrid-0.1.3.tar.gz.

File metadata

  • Download URL: pdgrid-0.1.3.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for pdgrid-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c87895d953dd7205efd3749069e57393d27fae5baa4eb50548fe4e7ad8a79661
MD5 15d5f8f14a42be53c1c2e2406424b607
BLAKE2b-256 1870bfa3ff9b8eb06c25c7ea42548f8ced7d5aa8a09d7b728756d3b4f87a7ba1

See more details on using hashes here.

File details

Details for the file pdgrid-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pdgrid-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for pdgrid-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 38c8aa595f8c8a87e56b9d60a418344268dcc81f2b82f3090d97a52a564b7057
MD5 e9eec4b4e1b303516d96ca7df7710c62
BLAKE2b-256 9e948821835431961e9106cf7d73f1cd8cbaaf5d145e8d7fd125c3f30edd27ba

See more details on using hashes here.

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