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
Release history Release notifications | RSS feed
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.2.tar.gz
(5.1 kB
view hashes)