Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waikato-datamining/pydex
Python client for the Data Exchange Server REST service (DEX) provided by ADAMS.
https://github.com/waikato-datamining/pydex
python rest
Last synced: 5 days ago
JSON representation
Python client for the Data Exchange Server REST service (DEX) provided by ADAMS.
- Host: GitHub
- URL: https://github.com/waikato-datamining/pydex
- Owner: waikato-datamining
- License: mit
- Created: 2019-09-10T20:47:05.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-15T00:15:42.000Z (over 1 year ago)
- Last Synced: 2024-10-04T07:38:09.704Z (about 1 month ago)
- Topics: python, rest
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
# pydex
Python client for the *Data Exchange Server* REST service provided
by [ADAMS](https://adams.cms.waikato.ac.nz/).## Example usage
In the following example, a file is uploaded to the server.
Then, the data is downloaded from the server using the obtained token.
Lastly, the data is removed from the server using the token again.```python
from pydex import upload_file, download, remove# upload a file
token = upload_file("/some/where/file.txt", "http://localhost:8080/upload")
print("token for upload", token)# download data associated with token
data = download(token, "http://localhost:8080/download")
print("data received for token", token)
print(data.decode())# remove data from server
code = remove(token, "http://localhost:8080/remove")
print("status code for removing token", token, "is", code)
```## Authentication
Depending on the DEX backend in use, you might have to provide credentials
as well in your calls. For instance, when using the `BasicAuthentication`
backend, you can provide user/password in your calls like this:```python
from pydex import upload_file, download, removeparams = {
'user': 'someuser',
'password': 'itspassword'
}token = upload_file("/some/where/file.txt", "http://localhost:8080/upload", params=params)
print("token for upload", token)
```## Installation
```commandline
pip install pydex-client
```