Software development kit for the Data Stewardship Wizard.
Project description
DSW SDK
Introduction
This projects aims at providing unified and easy-to-use Python library for communicating with the Data Stewardship Wizard API. For more info about the DSW project itself, see official webpage or the API documentation.
Installation
You can install this library via PyPI:
pip install dsw-sdk
Quickstart
The only mandatory step need in order to get going is to initialize the whole SDK and tell it, where is the DSW API located and how to connect to it:
from dsw_sdk import DataStewardshipWizardSDK
dsw_sdk = DataStewardshipWizardSDK(
api_url='http://localhost:3000',
email='albert.einstein@example.com',
password='password',
)
Now you are ready to go.
Note that this is only illustrative example and we encourage you not to store secrets like passwords in the source code. There are better mechanisms (env variables) introduced in the docs.
Basic usage
Most actions should be done via the high-level interfaces provided on an
instance of the DataStewardshipWizardSDK
class. These interfaces operate with
subclasses of Model
class (e.g. user.User
) -- these are the DSW data
entities. Basically they are just data classes with bunch of attributes and
methods for saving the entity (save()
) on the server and deleting it
(delete()
).
import os
user = dsw_sdk.users.create_user(
first_name='John',
last_name='Doe',
email='john.doe@example.com',
)
user.password = os.getenv('SECRET_PASSWORD')
user.save()
...
user.delete()
For more advanced usage, see the docs.
Contributing
Want to fix a bug or help with implementing new features? Don't hesitate to contact us and read the contributing doc.
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 dsw-sdk-3.8.0.tar.gz
.
File metadata
- Download URL: dsw-sdk-3.8.0.tar.gz
- Upload date:
- Size: 46.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f7f3f78bdd0774d85726380f58cf25a0f1b16925aea08384acd38e95ca062a0 |
|
MD5 | 4329c63b58133aa7c95257cd36d9f532 |
|
BLAKE2b-256 | 3450e811d54ac30e4a81e4ab742f99449769b40fd8af9273da785a902e6d2b30 |
File details
Details for the file dsw_sdk-3.8.0-py3-none-any.whl
.
File metadata
- Download URL: dsw_sdk-3.8.0-py3-none-any.whl
- Upload date:
- Size: 58.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b22c5d7fd94a59da6dbf23b72c8241929342025424720ff133e65cd0bed0701d |
|
MD5 | f4e5cbb4b427d7cfbf9f3a774baf7f97 |
|
BLAKE2b-256 | 4004a5c5339f91b3707b56d2534bbb5f112405728149c7dd4bc1c753920912b7 |