Skip to main content

No project description provided

Project description

This is a simple example of getting data from a server Polymatica Platform

from polymatica_api import PolymaticaAPI
from polymatica_api.data_option import FilterAnd
from polymatica_api.types import DataOptionMethod, FilterMethod, SortDirection
import pandas as pd


p = PolymaticaAPI('{SERVER_URL}', 'Token {TOKEN}')
response = p.get_data([
    p.from_dataset('world_population.csv').
    method(DataOptionMethod.Aggregate).
    group("Country/Territory").
    sum(
        '2000 Population', 
        '2010 Population', 
        '2015 Population',
        '2020 Population',
        '2022 Population',
    ).
    sort("Country/Territory", SortDirection.Desc).
    sort("2010 Population", SortDirection.Desc).
    set_filter(
        FilterAnd("Country/Territory", FilterMethod.Equal, "Jamaica")
    )
])

data = response.get('default')
frame = pd.DataFrame(data.rows)
frame.rename(columns=data.column_map, inplace=True)
print(frame)

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

polymatica_api-0.2.4.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file polymatica_api-0.2.4.tar.gz.

File metadata

  • Download URL: polymatica_api-0.2.4.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for polymatica_api-0.2.4.tar.gz
Algorithm Hash digest
SHA256 299031c23316565c461b0332c1f14ddc26d06185f1200b2e3e687766e76f2414
MD5 65c0c803856a46a0cc204cbd2b98203d
BLAKE2b-256 5a9a402bb92c75f23d27ac93d42d39c3a1ecf8eb0abde81cd75a5b692d65a1a0

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