Skip to main content

The official wrapper for Dataspike API

Project description

Dataspike python client library

The official wrapper for Dataspike API

Installation

pip install dataspike

Getting started

Library offers well typed async API powered by pydantic and aiohttp.

from dataspike import *

async with Api("<YOUR_API_TOKEN>") as api:
    verification = await api.verification.create(checks=[CheckType.Passport, CheckType.Selfie])
    await api.document.upload(verification.applicant_id, DocumentType.Passport, open('passport.jpg', 'rb'))
    await api.document.upload(verification.applicant_id, DocumentType.Selfie, open('selfie.jpg', 'rb'))
    await api.verification.proceed(verification.id)
    applicants = await api.applicant.list()
    verifications = await api.verification.list()

Resources

Full reference and documentation about available resources can be found at our official documentation

Currently library provides following resources

  • AML api.aml
  • Applicant api.applicant
  • Verification api.verification
  • SDK api.sdk
  • Documents api.document

Timeouts

Library uses aiohttp ClientSession. To pass timeouts use keyword arguments which will passed to ClientSession constructor

Check out aiohttp client reference for details.

Example

from dataspike import Api
async with Api('<API_TOKEN>', read_timeout=2) as api:
    ...

Errors

  • pydantic.ValidationError is raised when type parameters not match with expected for API func.
  • asyncio.TimeoutError is raised if a timeout occurs.
  • dataspike.errors.UnexpectedResponseStatus is raised whenever dataspike returns unexpected response status.

Sync API wrapper

We recommend use async api directly. But if you really want to use sync api library offers SyncApi wrapper. Take note it build on top of async API and still use asyncio under the hood.

Example

from dataspike import SyncApi
with SyncApi("<API_TOKEN>") as api:
    applicants = api.applicant.list()

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

dataspike-0.0.10.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

dataspike-0.0.10-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file dataspike-0.0.10.tar.gz.

File metadata

  • Download URL: dataspike-0.0.10.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.7.4 CPython/3.11.3

File hashes

Hashes for dataspike-0.0.10.tar.gz
Algorithm Hash digest
SHA256 d9a9c139634c64b0979e08f19f3c57768b457c34c16ac5f46e987ed883f4eb61
MD5 56418458e373dd93044de0297d4422fa
BLAKE2b-256 3fe668708f61256ee6769ccf65e9eb35742d50483be3d3e9941923f1e77aeec4

See more details on using hashes here.

File details

Details for the file dataspike-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: dataspike-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.7.4 CPython/3.11.3

File hashes

Hashes for dataspike-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 5e00acb0192e6993317142ee5e111afb3e74c47047e51b4c97079efa8d2638c5
MD5 420b1877201e8520d78dd1862cd54b0b
BLAKE2b-256 ccfc745a6af34ca5df7bf805570f9f7e7c6732e092e22b225126fd7642558098

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