Python SDK for Mercury service
Project description
Mercury SDK can be used in projects that interface with the mercury service that provides common internal functionality.
Initializing the client
from mercuryclient import MercuryApi # Setup connection parameters conn_params = {'username': 'mercury_username', 'password':'password', 'url':'https://mercury-url.com'} m = MercuryApi(conn_params) m.send_mail(['recipent@email.com'],'Test mail', 'Mail body','ses','ses_profile')
Available APIs:
send_mail
send_sms
request_experian_report
get_experian_response
fetch_experian_report
request_cibil_report
get_cibil_response
fetch_cibil_report
request_highmark_report
get_highmark_response
fetch_highmark_report
request_verify_id
get_verify_id_result
verify_webhook
Types:
For complex requests like CIBIL, Experian or Highmark, you can construct the request JSON using the provided pydantic models. The types are available at mercury.types.<request_type>.request.
Example using models for generating Highmark Request:
from mercuryclient.types.highmark.request import Applicant, HighmarkRequest applicant = Applicant(name="Example Name" ...) request_obj = HighmarkRequest( applicant=applicant, inquiry_reference_number="ABCDE", ... ) # After generating your request, pass the object to the corresponding request m.fetch_highmark_report(request_obj, profile="sample_profile)
Testing:
Tests are run under tox
You can install tox with
>>> pip install tox
If using pyenv - you can do the following steps before running tox (patch version will depend on your installations - tox only considers the major version)
>>> pyenv local 3.7.3 3.6.8 3.8.1
Without this step - tox will not be able to find the interpreters
Run tests using the following command
>>> tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mercuryclient-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52f3f5f49f1e89a1d0c15d1437b38483246874e1726ec7f644ee3f5376c33922 |
|
MD5 | bcae28c5097453e7d4ac180f700308b6 |
|
BLAKE2b-256 | fe82ea21b33101f4b80c5e50344908a9b09c884d54b457af747b7772cb93cdde |