A client library for Authentise open services
Project description
# authentise-services
A python client for Authentise's open services.
[![Build Status](https://travis-ci.org/DoWhileGeek/authentise-services.svg?branch=master)](https://travis-ci.org/DoWhileGeek/authentise-services)
##Installation:
```bash
pip install authentise-services
```
##Usage:
###User Creation:
```python
>>> from authentise_services.session import Session
>>> Session.create_user(username='my_user',
password='my_pass',
name='joe rod',
email='joe@domain.com')
```
###Model resource creation, upload, and download:
####Upload models on object creation:
```python
>>> from authentise_services.session import Session
>>> from authentise_services.model import Model
>>> session = Session('my_user', 'my_pass')
>>> model = Model(session, path='../stls/squirtle.stl')
>>> model.name
'squirtle.stl'
>>> model.model_uri
'http://models.authentise.com/model/some-uuid/'
>>> model.download_model('wartortle.stl')
```
####Upload models after object creation:
```python
>>> model2 = Model(session)
>>> model2.name
''
>>> model2.upload_model('../stls/charmander.stl')
>>> model2.name
'charmander.stl'
>>> model2.model_uri
'http://models.authentise.com/model/some-other-uuid/'
```
####Initialize objects with a model resource that already exists:
```python
>>> model3 = Model(session, uri='http://models.authentise.com/model/some-uuid/')
>>> model3.name
'squirtle.stl'
```
A python client for Authentise's open services.
[![Build Status](https://travis-ci.org/DoWhileGeek/authentise-services.svg?branch=master)](https://travis-ci.org/DoWhileGeek/authentise-services)
##Installation:
```bash
pip install authentise-services
```
##Usage:
###User Creation:
```python
>>> from authentise_services.session import Session
>>> Session.create_user(username='my_user',
password='my_pass',
name='joe rod',
email='joe@domain.com')
```
###Model resource creation, upload, and download:
####Upload models on object creation:
```python
>>> from authentise_services.session import Session
>>> from authentise_services.model import Model
>>> session = Session('my_user', 'my_pass')
>>> model = Model(session, path='../stls/squirtle.stl')
>>> model.name
'squirtle.stl'
>>> model.model_uri
'http://models.authentise.com/model/some-uuid/'
>>> model.download_model('wartortle.stl')
```
####Upload models after object creation:
```python
>>> model2 = Model(session)
>>> model2.name
''
>>> model2.upload_model('../stls/charmander.stl')
>>> model2.name
'charmander.stl'
>>> model2.model_uri
'http://models.authentise.com/model/some-other-uuid/'
```
####Initialize objects with a model resource that already exists:
```python
>>> model3 = Model(session, uri='http://models.authentise.com/model/some-uuid/')
>>> model3.name
'squirtle.stl'
```
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
Close
Hashes for authentise_services-0.4.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | be48bef3c688aa0ad5590131643bd3c096fde24138f75c9a7ff2fc3743b33fb6 |
|
MD5 | 5555b9f02c5f5ef1a8c7ed2987e0ef7b |
|
BLAKE2b-256 | 9b5fcb242045277737583529b63a9a067dea587d4028ddd7202b1bc7da8e6187 |