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:
changerequestno_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(...):
Monitor arguments
The monitor accepts a boatload of arguments, mainly ones that are then passed down to requests.Session.request(), so, for a detailed insight follow the hyperlink or read the docstring.
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!
Metadata
Release files for apico 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| apico-1.1.0.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apico-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.2 kB
Release files / apico-1.1.0.tar.gz
| Download URL | apico-1.1.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf128865e8866a54ef35d94b6a08f7467d29f4aca2a72b491e23ada3604a8b69
|
|
BLAKE2b-256 checksum How to use checksums |
162c9672f6540f623a8078f3605dca9556e038d7ba7e292bc485409f86c7d2a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / apico-1.1.0-py3-none-any.whl
| Download URL | apico-1.1.0-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb2211f65dc5fb345f875f16353f9da362ee1cac4bf10f0ec83d452c1f3a07fe
|
|
BLAKE2b-256 checksum How to use checksums |
be80c5501d4f79e74fca890babaf9f3c35fe29ad9838dff7cf5a46d7339ead9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|