Skip to main content

StatusPage.io API V1 library client for Python

Project description

StatusPage.oi API V1 library client for Python. Based on the documentaion from https://doers.statuspage.io/api/v1/

Provides most of the funcitonality for the http://statuspage.io api’s via handy python code.

Installation

Statuspageio package can be installed either via pip:

$ pip install git+https://github.com/n8thegr8/python-statuspageio

You can install from the source code as well. First clone the repo and then execute:

$ python setup.py install

After installing, import statuspageio package:

import statuspageio

Usage

import statuspageio

# Then we instantiate a client (as shown below)

Build a client

Using this api without authentication gives an error

client = statuspageio.Client(api_key='<YOUR_PERSONAL_API_KEY>', page_id='<YOUR_PERSONAL_PAGE_ID>')

or

client = statuspageio.Client(api_key='<YOUR_PERSONAL_API_KEY>', page_id='<YOUR_PERSONAL_PAGE_ID>',organization_id='<YOUR_PERSONAL_ORGANIZATION_ID>')

Client Options

The following options are available while instantiating a client:

  • api_key: Personal API Key

  • page_id: Personal page id

  • organization_id: Personal organization id, used for managing users.

  • base_url: Base url for the api

  • user_agent: Default user-agent for all requests

  • timeout: Request timeout

  • verbose: Verbose/debug mode

Architecture

The library follows few architectural principles you should understand before digging deeper. 1. Interactions with resources are done via service objects. 2. Service objects are exposed as properties on client instances. 3. Service objects expose resource-oriented actions. 4. Actions return dictionaries that support attribute-style access, a la JavaScript (thanks to Bunch and it’s form Munch).

For example, to interact with components API you will use statuspageio.ComponentsService, which you can get if you call:

client = statuspageio.Client(api_key='<YOUR_PERSONAL_API_KEY>', page_id=<YOUR_PERSONAL_PAGE_ID')
client.components # statuspageio.ComponentsService

To retrieve list of resources and use filtering you will call #list method:

client = statuspageio.Client(api_key='<YOUR_PERSONAL_API_KEY>', page_id=<YOUR_PERSONAL_PAGE_ID')
client.components.list() # list(dict|Munch)

Resources and actions

Documentation for every action can be found in statuspageio/services.py file.

Tests

Sorry. These need to be written.

Thanks

Thank you to the BaseCRM development team who created the majority of the code for this project. We forked the code as the aritectural style worked really well for this project. Please see https://github.com/basecrm/basecrm-python for more details

Thank you so much!

License

MIT

Bug Reports

Report here.

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

xandr-statuspageio-0.0.8.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

xandr_statuspageio-0.0.8-py2-none-any.whl (11.8 kB view details)

Uploaded Python 2

File details

Details for the file xandr-statuspageio-0.0.8.tar.gz.

File metadata

  • Download URL: xandr-statuspageio-0.0.8.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for xandr-statuspageio-0.0.8.tar.gz
Algorithm Hash digest
SHA256 5f2f9611de3f144dddf76520e83b774aaa506d18b5c370c2e6cf27f0f669860c
MD5 19787ae08d0e36c8ad7d72c2cc7a7be9
BLAKE2b-256 ac9066db4f7963f62371b993c09a6d399ea520f59233254aa6cb19319804ab58

See more details on using hashes here.

File details

Details for the file xandr_statuspageio-0.0.8-py2-none-any.whl.

File metadata

File hashes

Hashes for xandr_statuspageio-0.0.8-py2-none-any.whl
Algorithm Hash digest
SHA256 6f4f8b5494bbe6628de5f7b812e9df35a8be7eff2914c5997c95413dd5bf25f9
MD5 d092c6d7497867a5777b02bc1f625720
BLAKE2b-256 5a799d9d9b211f71dbe8f74ef82ea9b53fb2f950c627df1be729a0c85ba2a171

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