Name | dataspike JSON |
Version |
0.1.2
JSON |
| download |
home_page | |
Summary | The official wrapper for Dataspike API |
upload_time | 2023-09-28 07:18:19 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.8 |
license | MIT |
keywords |
dataspike
kyc
identity
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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.
```python
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](https://docs.dataspike.io)
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](https://docs.aiohttp.org/en/stable/client_reference.html) for details.
Example
```python
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
```python
from dataspike import SyncApi
with SyncApi("<API_TOKEN>") as api:
applicants = api.applicant.list()
```
Raw data
{
"_id": null,
"home_page": "",
"name": "dataspike",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "dataspike,kyc,identity",
"author": "",
"author_email": "Sergey Rublev <sergey.rublev@dataspike.io>",
"download_url": "https://files.pythonhosted.org/packages/7d/02/fedec191a4e559d796ec793ae41cd70cd0a2b13989857fe2cf1a0bce479f/dataspike-0.1.2.tar.gz",
"platform": null,
"description": "# Dataspike python client library\n\nThe official wrapper for Dataspike API\n\n## Installation\n\n`pip install dataspike`\n\n## Getting started\n\nLibrary offers well typed async API powered by pydantic and aiohttp.\n\n```python\nfrom dataspike import *\n\nasync with Api(\"<YOUR_API_TOKEN>\") as api:\n verification = await api.verification.create(checks=[CheckType.Passport, CheckType.Selfie])\n await api.document.upload(verification.applicant_id, DocumentType.Passport, open('passport.jpg', 'rb'))\n await api.document.upload(verification.applicant_id, DocumentType.Selfie, open('selfie.jpg', 'rb'))\n await api.verification.proceed(verification.id)\n applicants = await api.applicant.list()\n verifications = await api.verification.list()\n```\n\n\n### Resources\n\nFull reference and documentation about available resources \ncan be found at our [official documentation](https://docs.dataspike.io)\n\nCurrently library provides following resources\n \n- AML `api.aml`\n- Applicant `api.applicant`\n- Verification `api.verification`\n- SDK `api.sdk`\n- Documents `api.document`\n\n\n### Timeouts\nLibrary uses aiohttp ClientSession. \nTo pass timeouts use keyword arguments which will passed to ClientSession constructor\n\nCheck out [aiohttp client reference](https://docs.aiohttp.org/en/stable/client_reference.html) for details.\n\nExample \n```python\nfrom dataspike import Api\nasync with Api('<API_TOKEN>', read_timeout=2) as api:\n ...\n```\n\n### Errors\n\n- `pydantic.ValidationError` is raised when type parameters not match with expected for API func.\n- `asyncio.TimeoutError` is raised if a timeout occurs.\n- `dataspike.errors.UnexpectedResponseStatus` is raised whenever dataspike returns unexpected response status.\n\n\n### Sync API wrapper\n\nWe recommend use async api directly. But if you really want to use sync api\nlibrary offers `SyncApi` wrapper. Take note it build on top of async API \nand still use asyncio under the hood.\n\nExample\n```python\nfrom dataspike import SyncApi\nwith SyncApi(\"<API_TOKEN>\") as api:\n applicants = api.applicant.list()\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The official wrapper for Dataspike API",
"version": "0.1.2",
"project_urls": {
"Documentation": "https://docs.dataspike.io",
"Homepage": "https://dataspike.io",
"Repository": "https://github.com/dataspike-io/docver-sdk"
},
"split_keywords": [
"dataspike",
"kyc",
"identity"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5ecb70d7d3701b9534c8a2d24917276a2c4954998c65f1dfaf13ebf909dbf1b6",
"md5": "dafd0e4e725c7f9a9bcc70f03bc4e96b",
"sha256": "c2e4b544519e55b171cdab8acd682647fe3c43865c49aef4c6fedc7f9e3ed5d0"
},
"downloads": -1,
"filename": "dataspike-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dafd0e4e725c7f9a9bcc70f03bc4e96b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 15043,
"upload_time": "2023-09-28T07:18:18",
"upload_time_iso_8601": "2023-09-28T07:18:18.052613Z",
"url": "https://files.pythonhosted.org/packages/5e/cb/70d7d3701b9534c8a2d24917276a2c4954998c65f1dfaf13ebf909dbf1b6/dataspike-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7d02fedec191a4e559d796ec793ae41cd70cd0a2b13989857fe2cf1a0bce479f",
"md5": "659602f6128d36eef971309e0e26e62f",
"sha256": "116598dcfabd12b217b99a2e6b131792a96cf73373632ac7d6fced875b5c51c6"
},
"downloads": -1,
"filename": "dataspike-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "659602f6128d36eef971309e0e26e62f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 13399,
"upload_time": "2023-09-28T07:18:19",
"upload_time_iso_8601": "2023-09-28T07:18:19.818724Z",
"url": "https://files.pythonhosted.org/packages/7d/02/fedec191a4e559d796ec793ae41cd70cd0a2b13989857fe2cf1a0bce479f/dataspike-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-28 07:18:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dataspike-io",
"github_project": "docver-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "dataspike"
}