Skip to main content

pymetrics-assessment-api-client

A client library for accessing pymetrics Assessment API

Installation

pip install pymetrics-assessment-api-client

Base URLs

US Production: https://api.pymetrics.com

US Staging: https://staging.api.pymetrics.com

Usage

A full set of examples can be found in the pymetrics-assessments-api-client examples directory.

To get started, please request Client ID, Client Secret and API Key from pymetrics.

First, create a client for staging environment:

from pymetrics_assessment_api_client import Client

client = Client(base_url="https://staging.pymetrics.com")

To get an authenticated token, you can hit the get oauth endpoint by doing the following:

from pymetrics_assessment_api_client.models import OAuthTokenRequest
from pymetrics_assessment_api_client.api.default import mercury_o_auth
from pymetrics_assessment_api_client.models import OAuthTokenResponse
from pymetrics_assessment_api_client.types import Response

request = OAuthTokenRequest(client_id=client_id,
                            client_secret=client_secret,
                            grant_type="client_credentials")
auth_response: Response = mercury_o_auth.sync_detailed(client=client,
                                                       json_body=request)
auth_token_response: OAuthTokenResponse = auth_response.parsed
print(f"Access Token: {auth_token_response.access_token}")

To retrieve an order, you can use the token generated above and hit the get order endpoint:

from pymetrics_assessment_api_client.api.default import mercury_retrieve_order
from pymetrics_assessment_api_client.models import MercuryAssessmentOrder
from pymetrics_assessment_api_client.types import Response

auth = f"Bearer {access_token}"

get_order_response: Response = mercury_retrieve_order.sync_detailed(
    client=client,
    uuid=order_uuid,
    authorization=auth,
    x_api_key=API_KEY,
    report=False
)
parsed_get_order_response: MercuryAssessmentOrder = get_order_response.parsed
print(f"Successfully retrieved order: {parsed_get_order_response.to_dict()}")

Metadata

Release files for pymetrics-assessment-api-client 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymetrics-assessment-api-client 1.0.1
File Size Uploaded
pymetrics-assessment-api-client-1.0.1.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pymetrics-assessment-api-client 1.0.1
File Interpreter ABI Platform
pymetrics_assessment_api_client-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 44.6 kB

Release files / pymetrics-assessment-api-client-1.0.1.tar.gz

Download URL pymetrics-assessment-api-client-1.0.1.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2b4d9829af0e8637bd22f378050b73f1859ac13a77bfcf298aec7dee64546128
BLAKE2b-256 checksum
How to use checksums
5d2c31a8438d9d0790ff1a78b2044d92a79c98b525f13a7d32f1a0cce3f42a05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.7.7 Darwin/19.6.0

Release files / pymetrics_assessment_api_client-1.0.1-py3-none-any.whl

Download URL pymetrics_assessment_api_client-1.0.1-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
034d61865c5d77c4cc53db51e75e02917b5443d05873de7065ee26b57667bd69
BLAKE2b-256 checksum
How to use checksums
f038f0ca949ae0f0379bbae4723296400e7797154c82f4c8036e8aa073d7b657
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.7.7 Darwin/19.6.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page