Skip to main content

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 hashes)

Uploaded Source

Built Distribution

ehelply_python_sdk-0.1.0-py3-none-any.whl (15.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page