Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Python API client for Export Directory.

Project description

# directory-sso-api-client

[![code-climate-image]][code-climate]
[![circle-ci-image]][circle-ci]
[![codecov-image]][codecov]
[![gemnasium-image]][gemnasium]

**[Export Directory SSO API client](https://www.directory.exportingisgreat.gov.uk/)**

---

## Requirements

## Installation

```shell
pip install -e git+https://github.com/uktrade/directory-sso-api-client.git@v2.2.0#egg=directory-sso-api-client
```

### Can't import package in PyCharm
In case `PyCharm` compains about missing `directory-sso-api-client` requirements after installing it to your virtualenv, then you have to re-install it but without `-e` parameter.
```shell
pip uninstall directory-sso-api-client
pip install git+https://github.com/uktrade/directory-sso-api-client.git@v2.2.0#egg=directory-sso-api-client
```


## Usage

```python
from directory_sso_api_client.client import DirectorySSOAPIClient

directory_sso_client = DirectorySSOAPIClient(
base_url="https://account.trade.great.gov.uk/api",
api_key=api_key
)
```

### Get user by session ID

```python
directory_sso_client.user.get(
session_id=session_id
)
```

## Development

$ git clone https://github.com/uktrade/directory-sso-api-client
$ cd directory-ui
$ make

## Publish to PyPI

The package should be published to PyPI on merge to master. If you need to do it locally then get the credentials from rattic and add the environment variables to your host machine:

| Setting |
| --------------------------- |
| DIRECTORY_PYPI_USERNAME |
| DIRECTORY_PYPI_PASSWORD |

Then run the following command:

make publish


[code-climate-image]: https://codeclimate.com/github/uktrade/directory-sso-api-client/badges/issue_count.svg
[code-climate]: https://codeclimate.com/github/uktrade/directory-sso-api-client

[circle-ci-image]: https://circleci.com/gh/uktrade/directory-sso-api-client/tree/master.svg?style=svg
[circle-ci]: https://circleci.com/gh/uktrade/directory-sso-api-client/tree/master

[codecov-image]: https://codecov.io/gh/uktrade/directory-sso-api-client/branch/master/graph/badge.svg
[codecov]: https://codecov.io/gh/uktrade/directory-sso-api-client

[gemnasium-image]: https://gemnasium.com/badges/github.com/uktrade/directory-sso-api-client.svg
[gemnasium]: https://gemnasium.com/github.com/uktrade/directory-sso-api-client


Project details


Release history Release notifications

This version
History Node

2.5.1

History Node

2.5.0

History Node

2.4.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
directory_sso_api_client-2.5.1-py3-none-any.whl (6.0 kB) Copy SHA256 hash SHA256 Wheel py3 Mar 6, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page