A python API wrapper for Akhenaten Plotly hoster
Project description
Akhenaten-py
Client to use the plotly hosting service at akhenaten.eu
This library can be used to upload Plotly plots to the akhenaten plotly hosting service!
To use this service first get an account by contacting frank (at) amunanalytics.eu
If you would like to use a GUI, simply use your client Id and key to login to https://console.akhenaten.eu
Installation
python3 -m pip install akhenaten-py
Usage
import os
# authentication can be done with environment variables or directly
# this example shows both, this is just to show the possibilities!
os.environ['AKHENATEN_ID'] = '<your client ID>'
os.environ['AKHENATEN_KEY'] = '<your client key'
from akhenaten import AkhenatenClient, MetadataClass
client_hoster = AkhenatenClient(
# not needed when using environment variables!
akhenaten_id ='<your client ID>',
akhenaten_key='<your client key>',
bucket_name='<bucketname>' # only applicable if you are using custom access key, otherwise deduced from client id
)
# get all current uploaded figs
print(client_hoster.list_figs())
# create some fig
fig = get_some_plotly_fig()
# upload it and display the urls
# if no slug is specified then a random uuid4 will be generated
result = client_hoster.upload_fig(fig, slug='<optional slug>',
meta_obj = MetadataClass(
title='some plot title',
author='some author'
))
print(result['json_url']) # the url to use in your own embedding
print(result['fig_url']) # direct html access
# to get back a fig to plotly
fig, meta_obj = client_hoster.download_fig('<slug>')
Alternative usage
This service is backed by minio which is fully AWS S3 compatible.
Thus if you would like more extensive features you can use the boto3
package.
The hosting url will then be https://s3.akheaten.eu/BUCKET_NAME/ITEM_NAME.json
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
Built Distribution
File details
Details for the file akhenaten-py-0.2.0.tar.gz
.
File metadata
- Download URL: akhenaten-py-0.2.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e980c5af845f0400a44a1fcff38a0350f614e60d640de89838a7ac10514cc7c |
|
MD5 | f632d6578302c1477fe146f5bf54ca24 |
|
BLAKE2b-256 | 335476bb3e0ed158c18d6517f9023a89ef2157f6afd4bc59829ab43e4dea2503 |
File details
Details for the file akhenaten_py-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: akhenaten_py-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3467f514052feabe4167d895b36ae1c16ee88fb0831a74df79622456b1a046e6 |
|
MD5 | be94f0bb2259f6da56a956e1394188c3 |
|
BLAKE2b-256 | 8795965c0f32ae80c84d8937b1331ee72283f1ff48b5104f85d9a861d47a67d5 |