
Python version 2 and 3 SDK for connecting with Acrosure Insurance Gateway
## Installation
Install via pip:
`pip install acrosure_sdk`
## Requirements
* Python 2.7.1+
* `requests` library
## Getting Started
Import AcrosureClient into your project.
```python
from acrosure_sdk import AcrosureClient
```
Instantiate with an API key from [Acrosure Dashboard](https://dashboard.acrosure.com).
```python
acrosure_client = AcrosureClient(token = '<your_api_key>')
```
## Basic Usage
AcrosureClient provides several objects such as `application`, `product`, etc. and associated APIs.
Any data will be inside an response object with `data` key, along with meta data, such as:
```json
{
"data": { ... },
"status": "ok",
...
}
```
### Application
#### Get
Get application with specified id.
```python
application = acrosure_client.application.get('<application_id>')
```
#### Create
Create an application.
```python
created_application = acrosure_client.application.create(
productId = '<product_id>', # required
basic_data = {},
package_options = {},
additional_data = {},
package_code = '<package_code>',
attachments = []
)
```
#### Update
Update an application.
```python
updatedApplication = acrosure_client.application.update(
application_id = '<application_id>', # required
basic_data = {},
package_options = {},
additional_data = {},
package_code = '<package_code>',
attachments = []
)
```
#### Get packages
Get current application available packages.
```python
packages = acrosure_client.application.get_packages(
'<application_id>'
)
```
#### Select package
Select package for current application.
```python
updated_application = acrosure_client.application.select_package(
application_id = '<application_id>',
package_code = '<package_code>'
)
```
#### Get package
Get selected package of current application.
```python
current_package = acrosure_client.application.get_package(
'<application_id>'
)
```
#### Get 2C2P hash
Get 2C2P hash.
```python
returned_hash = acrosure_client.application.get_2c2p_hash(
application_id = '<application_id>',
args = '<arguments>'
)
```
#### Submit
Submit current application.
```python
submitted_application = acrosure_client.application.submit(
'<application_id>'
)
```
#### Confirm
Confirm current application.
_This function needs secret API key._
```python
confirmed_application = acrosure_client.application.confirm(
'<application_id>'
)
```
#### List
List your applications (with or without query).
```python
applications = acrosure_client.application.list(query)
```
### Product
#### Get
Get product with specified id.
```python
product = acrosure_client.product.get('<product_id>')
```
#### List
List your products (with or without query).
```t
products = acrosure_client.product.list(query)
```
### Policy
#### Get
Get policy with specified id.
```python
policy = acrosure_client.policy.get('<policy_id>')
```
#### List
List your policies (with or without query).
```python
policies = acrosure_client.policy.list(query)
```
### Data
#### Get
Get values for a handler (with or without dependencies, please refer to Acrosure API Document).
```python
// Without dependencies
values = acrosure_client.data.get(
handler = '<some_handler>'
)
// With dependencies
values = acrosure_client.data.get(
handler = '<some_handler>',
dependencies = ['<dependency_1>', '<dependency_2>']
)
```
### Team
#### Get info
Get current team information.
```python
team_info = acrosure_client.team.get_info()
```
### Other functionality
#### Verify webhook signature
Verify webhook signature by specify signature and raw data string
```python
is_signature_valid = acrosure_client.verify_webhook(
signature = '<signature>',
data = '<raw_data>'
)
```
## Advanced Usage
Please refer to [this document](https://github.com/Acrosure/acrosure-python-sdk/wiki/Acrosure-Python-SDK) for AcrosureClient usage.
And refer to [Acrosure API Document](https://docs.acrosure.com/docs/api-overall.html) for more details on Acrosure API.
## Associated Acrosure API endpoints
### Application
```
/applications/get
/applications/list
/applications/create
/applications/update
/applications/get-packages
/applications/get-package
/applications/select-package
/applications/submit
/applications/confirm
/applications/get-hash
```
### Product
```
/products/get
/products/list
```
### Policy
```
/policies/get
/policies/list
```
### Data
```
/data/get
```
### Team
```
/teams/get-info
```
Metadata
Release files for acrosure-sdk 0.9.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| acrosure_sdk-0.9.2.tar.gz | 10.3 kB | Without provenance | Details for acrosure_sdk-0.9.2.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acrosure_sdk-0.9.2-py3-none-any.whl | Python 3 | none | any | Details for acrosure_sdk-0.9.2-py3-none-any.whl |
| acrosure_sdk-0.9.2-py2-none-any.whl | Python 2 | none | any | Details for acrosure_sdk-0.9.2-py2-none-any.whl |
Total release size: 46.8 kB
Release files / acrosure_sdk-0.9.2.tar.gz
| Download URL | acrosure_sdk-0.9.2.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46d48bc118bd86345aec7ff6f49a9c001065f5651baac7011360dcc7453bebb9
|
|
BLAKE2b-256 checksum How to use checksums |
2bf295503ed52874233bf7adc698eded4e4e3133e80aa167848c94c2975447dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
|
Release files / acrosure_sdk-0.9.2-py3-none-any.whl
| Download URL | acrosure_sdk-0.9.2-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
623f37299a0c4fc57584ae1cf44f5702fd89f6e77062d6afd9cdb63e32d1e484
|
|
BLAKE2b-256 checksum How to use checksums |
9731a05220c3ba9829590e3b559a8d5033d474fbe162cb45b8e0deb35a80e450
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
|
Release files / acrosure_sdk-0.9.2-py2-none-any.whl
| Download URL | acrosure_sdk-0.9.2-py2-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
40ace174b62aedcae9cde7dd837980a3cddb683b847ef9f2501ab86809888d27
|
|
BLAKE2b-256 checksum How to use checksums |
f1f1bc972b7baf9e1a4d5b9b7f3878743840c990ed6958b1e549703a914150e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
|
Security for acrosure-sdk 0.9.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.