Safie API client library for Python
Project description
pysafie
Safie API client library for Python
Requirement
A subscription is required to use the Safie API. Please refer to this link for details.
https://developers.safie.link/
Installation
pip install pysafie
Usage
By receiving authentication code, you can use it as follows.
import pysafie
client_id = 'hogehoge'
client_secret = 'hogehoge'
redirect_uri = 'https://hoge.com/'
authentication_code = 'hogehoge' # Need to get it from the redirected URL
safie = pysafie.Safie(client_id, client_secret, redirect_uri)
safie.get_access_token(authentication_code)
res = safie.get_device_list() # Returns requests' response object
print(res.json())
If you have already stored token information, you can set it when you create an instance.
import pysafie
client_id = 'hogehoge'
client_secret = 'hogehoge'
redirect_uri = 'https://hoge.com/'
access_token = 'hogehoge'
refresh_token = 'hogehoge'
expires_at = 1624247730 # Set the token expiration in unix time
safie = pysafie.Safie(client_id, client_secret, redirect_uri,
access_token, refresh_token, expires_at)
res = safie.get_device_list() # Returns requests' response object
print(res.json())
Note
For now, this library only supports auth, devices, and media_files APIs.
Author
- kndt84
- Future Standard Co., Ltd.
License
pysafie is under MIT license.
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysafie-0.3-py3-none-any.whl.
File metadata
- Download URL: pysafie-0.3-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
549584b8741b0bd8cc9b3f0d5e678d0092139686bc6faa4ad0f77249b756a86e
|
|
| MD5 |
d820fc59da250a2351f45b1b8d4c8797
|
|
| BLAKE2b-256 |
f170e708c3316fbee2ee40625e7fb2ae92e6d4492af4d4c8404992f9b1f1e9e8
|