Skip to main content

Software development kit for the Data Stewardship Wizard.

Project description

PyPI Static analysis Tests Documentation Status License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dsw-sdk-3.8.0.tar.gz (46.7 kB view hashes)

Uploaded Source

Built Distribution

dsw_sdk-3.8.0-py3-none-any.whl (58.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page