Skip to main content

FortisX Python SDK

Project description

FortisX Python SDK

This guide explains how to interact with the API using the Python client.


Installation

pip install fortisx

Initialization

from fortisx import API

api = API("YOUR_API_KEY")

Constructor options

Name Type Default Description
api_key str API key used for authorization
base_url str https://api.fortisx.fi/v1 Override if using a custom environment
timeout int 10 Request timeout in seconds

Methods

Method Arguments Returns Description
`get(endpoint: str, params: dict None = None)` endpoint path, optional query params dict
`post(endpoint: str, data: dict None = None)` endpoint path, optional JSON body dict
`put(endpoint: str, data: dict None = None)` endpoint path, optional JSON body dict
delete(endpoint: str) endpoint path dict Performs a DELETE request

Headers added automatically

{ "Authorization": "Bearer {api_key}", "Accept": "application/json" }

Error handling

All methods may raise APIError(message: str, status: int | None, details: dict | None).

from fortisx import API, APIError

api = API("YOUR_API_KEY")
try:
    data = api.get("ping")
    print(data)
except APIError as e:
    print(e.status, e, e.details)

Example: /ping Endpoint

from fortisx import API

api = API("demo-key")

res = api.get("ping")
print(res)  # {'status': 'ok'}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fortisx-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fortisx-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file fortisx-0.1.0.tar.gz.

File metadata

  • Download URL: fortisx-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for fortisx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bcc49dc0ca5ff2099d5ce85503fdc82a4405dfb01961429c25c17501f7d66045
MD5 bbe28f8da821378fba0ee051d76f7a14
BLAKE2b-256 660c9db4b662d10b124bf1e8ff7be29ce0739c5d9f12348cce998461804ec449

See more details on using hashes here.

File details

Details for the file fortisx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fortisx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for fortisx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be6c0a39c9f70884913bd529a5b592163a90fb9c4836d30779afaaa582eb10bc
MD5 9eb301f315248af136b7e6d3dcf34ace
BLAKE2b-256 da16d92483c832edcc8749fc75625d032ecac0f6fa607e89b116ab77da8a8c6b

See more details on using hashes here.

Supported by

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