Skip to main content

Python common code for Directory API clients.

Project description

directory-client-core

code-climate-image circle-ci-image codecov-image pypi-image snyk-image

Directory Client Core.

Common code for the Directory API clients.

Requirements

Installation

pip install directory-client-core

Usage

from directory_client_core.base import AbstractAPIClient


class MyAPIClient(AbstractAPIClient):

    version = 1  # passed as a header in all requests

    def get_something(self):
        return self.get(...)

    def create_sometime(self):
        return self.post(...)


client = MyAPIClient(
    base_url='https://example.com/',
    api_key='test',
    sender_id='test-sender-id',
    timeout=2,
)

response = client.get_something()

Development

$ git clone https://github.com/uktrade/directory-client-core
$ cd directory-client-core

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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

directory_client_core-4.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file directory_client_core-4.2.0-py3-none-any.whl.

File metadata

  • Download URL: directory_client_core-4.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/38.7.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.5

File hashes

Hashes for directory_client_core-4.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80ae8300ef3de664d76f99e115935b60e097ec9ef4452e48d0ac8c588b366fe8
MD5 90d43760d2b9731d45b85322c43ad01a
BLAKE2b-256 bb1351fcf04885e015bfff2198c6fc1f6ccdbb2ebbf373c12bcd71b759cde5b6

See more details on using hashes here.

Supported by

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