Skip to main content

Piano API SDK

Project description

Piano API SDK

This is simple wrapper for Piano API.

Requirements

Python 3.7+

Examples

VX API

from pianosdk import Client, AccessTokenStorage

host = 'sandbox' # use 'production', 'sandbox' or custom endpoint here, like 'https://api-ap.piano.io'
client = Client(api_host=host, api_token='TOKEN', private_key='PRIVATE_KEY')
response = client.access_api.list('AID')
print(response)
response = client.publisher_term_api.list('AID')
print(response)
response = client.userref_create('UID', 'EMAIL')
print(f'User ref for [uid=UID, email=EMAIL]: {response}')
response = client.parse_webhook_data('WEBHOOK_DATA')
print(f'Webhook event: [{type(response)}] {response}')
token_storage = AccessTokenStorage(client.config)
response = token_storage.get_access_token('UNKNOWN_RID')
print(f'Access token for unknown rid: {response}')
token_storage.parse_access_tokens('TAC_VALUE')
# or use
token_storage.parse_access_tokens_from_cookies_string('ALL_COOKIES_STRING')
response = token_storage.get_access_token('RID')
print(f'Access token for known rid: {response}')

ID API

from pianosdk import Client
from pianosdk.id import PublisherLoginRequest
client = Client(environment='sandbox', api_token='TOKEN')
request = PublisherLoginRequest(aid='AID', email='test@example.com', password='1234')
response = client.publisher_identity_api.login(authorization=client.config.api_token, body=request)
print(response)

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

pianosdk-16.285.0.tar.gz (99.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pianosdk-16.285.0-py3-none-any.whl (326.1 kB view details)

Uploaded Python 3

File details

Details for the file pianosdk-16.285.0.tar.gz.

File metadata

  • Download URL: pianosdk-16.285.0.tar.gz
  • Upload date:
  • Size: 99.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.9.2

File hashes

Hashes for pianosdk-16.285.0.tar.gz
Algorithm Hash digest
SHA256 4e79161959c87d0ef3f21d07683e4da1d35d83b54cb89536aac0d140282aeef6
MD5 b90f4fc42b57a092c9222a83e125d637
BLAKE2b-256 fe2e3599a222278d90df10cb305d47dfc0013103fe65a171d1435b88534841e7

See more details on using hashes here.

File details

Details for the file pianosdk-16.285.0-py3-none-any.whl.

File metadata

  • Download URL: pianosdk-16.285.0-py3-none-any.whl
  • Upload date:
  • Size: 326.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.9.2

File hashes

Hashes for pianosdk-16.285.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d9942b3590bdd6da31a881e73153881693342b75d1cec3654a53076e6d3385a
MD5 56c73624237d8cb4d66cd54966bebc2b
BLAKE2b-256 d154ed22c35b8391d60252a5ef1468ff225845acaa1d04b244cae44635f6d99b

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