GithubHelp home page GithubHelp logo

python-statuspageio's Introduction

python-statuspageio

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.

python-statuspageio's People

Contributors

byteranger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.