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.2.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.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdgrid-0.1.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.5

File hashes

Hashes for pdgrid-0.1.2.tar.gz
Algorithm Hash digest
SHA256 77eb8d8aa3aa16f9b784d03e6a05dbfa602467878ca7027798679861a3279142
MD5 d0387dfbf9e4ba32f4b6ecda46227fb1
BLAKE2b-256 fce5d0fc7e5f2bc45fef0de19615b5fda995e60db81b2d8657f817670c5cdadf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdgrid-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.5

File hashes

Hashes for pdgrid-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d820c8e81b05386b08af51508ae3d6845a2051ec6eed64190da672b91279fb9d
MD5 c7cc2c72c4b79d6dbec0ea6a80834276
BLAKE2b-256 f54e346d477727eac3cbcd0473dced60e65694d103cd05ae453cf88ff4f66829

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