Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
## 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