Skip to main content

Tool for monitoring changes in RESTful APIs quickly and easily

Project description

apico

The easy way to monitor changes in RESTful APIs.

Installation

$ pip install apico

Example usage

from apico import Monitor, Response


monitor = Monitor(url='https://api.github.com/users/itsmewulf', rate=10.0, headers={'Authorization': 'GITHUB_TOKEN'})

@monitor.listener()
def on_change(old, new):
    print('Something changed!')

@monitor.listener('no_change')
def nothing_changed():
    print('Nothing changed!')

@monitor.listener()
def on_request():
    print('This is called before every request.')

Some reference

Events

The events supported by the Monitor.listener decorator are:

  • change
  • request
  • no_change

As you can see in the example, listeners can be registered by passing the event name straight to the decorator (monitor.listener('change')) or inferred from the function name starting with on_:

@monitor.listener()
def on_change(...):

Returns

The responses returned by apico are actually instances of requests.Response

Rate

The rate at which the Monitor sends requests is controlled via the rate parameter, which is either an integer, or a float - 33 is a request every 33 seconds, 0.5 is 2 requests every second.


Reporting Issues

If you find any error/bug/mistake with the package or in the code feel free to create an issue and report it here.

Fix/Edit Content

If you wish to contribute to this package, fork the repository, make your changes and then simply create a Pull Request!

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

apico-1.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

apico-1.0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file apico-1.0.1.tar.gz.

File metadata

  • Download URL: apico-1.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for apico-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c73e7059c83829ed7c4c894a7173da74a0dd86b8a1d939dc82940bd97152d029
MD5 20f049c287cf16638f769c2ca1da8483
BLAKE2b-256 c2e64e7b2b5f2cf4017873eb4b7edd38f0fafca54d9e2a5a0e2bb54b497ed508

See more details on using hashes here.

File details

Details for the file apico-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: apico-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for apico-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 54e8c0bd447b120e24977fc6f441e5eb23927ad61bb719f88582635d903443a6
MD5 48f1cba1e8222a5875c69f106649e380
BLAKE2b-256 c29aaa05553249837fdb9428c4854fd6440248228b82ef05eb7147daf12db775

See more details on using hashes here.

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