No project description provided
Project description
eHelply Python SDK
Usage
(Recommended) Approach 1: Create a SDK object which can be used to create a client for any of the eHelply services
from ehelply_python_sdk.sdk import SDKConfiguration, eHelplySDK, ErrorResponse, is_response_error
sdk: eHelplySDK = eHelplySDK(
sdk_configuration=SDKConfiguration(
access_token="",
secret_token="",
project_identifier="ehelply-resources",
base_url_override="http://localhost"
)
)
access_client = sdk.make_access()
response = access_client.search_types(name="eHelply Access")
if is_response_error(response):
response: ErrorResponse = response
print("I'm sadness")
print(response.status_code)
print(response.message)
else:
print(response.dict())
Approach 2: Alternatively, you can set up a client manually and forego the SDK object. That said, the SDK object provides minimal overhead, so I'm not sure why you would want to do this.
from ehelply_python_sdk.sdk import SDKConfiguration, eHelplySDK, ErrorResponse, is_response_error
from ehelply_python_sdk.services.access.sdk import AccessSDK
from ehelply_python_sdk.utils import make_requests
sdk_config = SDKConfiguration(
access_token="",
secret_token="",
project_identifier="ehelply-resources",
base_url_override="http://localhost"
)
access_only_sdk = AccessSDK(
sdk_configuration=sdk_config,
requests_session=make_requests(sdk_configuration=sdk_config)
)
response = access_only_sdk.search_types(name="eHelply Access")
if is_response_error(response):
response: ErrorResponse = response
print("I'm sadness")
print(response.status_code)
print(response.message)
else:
print(response.dict())
Help
Development
- Generate the latest version of the docs by running this command from the repository root
ehelply dev export-code-docs
- In the event that the eHelply command above is not working, you can also run it like this:
pdoc --html -o docs --force ehelply_python_sdk
- Then copy the files up one level.
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
ehelply-python-sdk-0.1.0.tar.gz
(12.1 kB
view details)
Built Distribution
File details
Details for the file ehelply-python-sdk-0.1.0.tar.gz
.
File metadata
- Download URL: ehelply-python-sdk-0.1.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55c4ff44cd81c312cb092ff5b85f4abb92b998c2fa49d0ff6aea96711f77fe10 |
|
MD5 | 1e8327019fd30728fc4bacdd1056e2b6 |
|
BLAKE2b-256 | 66eb66342aa3de864fd5905579870137b52bde0180c9efec21aaac704242c6e7 |
File details
Details for the file ehelply_python_sdk-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ehelply_python_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf3a8c2d22ea94f4b7c52727f0a2e7e748e4013bfe595eb4bc32f9a531c1ca23 |
|
MD5 | 27a69d3579cf0d5f9157efa0d08dd3ae |
|
BLAKE2b-256 | 3963474603ef1e5539fea62f973167fad6cb61bfee04fde32476df8ca96ceb4f |