Skip to content

Instantly share code, notes, and snippets.

@fijiaaron
Created February 11, 2021 23:19
Show Gist options
  • Save fijiaaron/209b3accf3b6b54827180edf587e52e4 to your computer and use it in GitHub Desktop.
Save fijiaaron/209b3accf3b6b54827180edf587e52e4 to your computer and use it in GitHub Desktop.
## podio_api_example.py
## Download podio python library from https://github.com/podio/podio-py
## copy podio-py/pypodio into your project directory (pip package not available on pypi)
from pypodio2 import api
## Get environment variables for Podio Credentials
from os import environ as env
client_id = env.get('PODIO_CLIENT_ID')
client_secret = env.get('PODIO_CLIENT_SECRET')
username = env.get('PODIO_USERNAME')
password = env.get('PODIO_PASSWORD')
## Create Podio client instance and authorize
podio = api.OAuthClient(
client_id,
client_secret,
username,
password,
)
## Get workspace information
workspace = podio.Space.find(7459832)
workspace.get('name')
workspace.get('created_by')
### Get application information
app = podio.Application.find(25803866)
fields = app.get('fields')
print(len(fields)
for i in range(len(fields))
field = fields[i]
print(field['label'] + "," + field['type'])
category = app.get('fields')[2]
category.get('config').get('settings').get('options')
### Get item information
item = podio.Item.find(1651505553)
item.get('comments')[0].get('value')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment