An emerging widget for exploring RESTful APIs in Jupyter notebooks.
Project description
Ipyrest
Ipyrest is an emerging Jupyter notebook widget for exploring RESTful APIs. It has two main goals: provide a more convenient interface in the spirit of Postman, and allow for plug-in components, starting with output renderers for various MIME types, e.g. GeoJSON:
Essence
At its core ipyrest is a wrapper for the excellent requests package based on the equally excellent ipywidgets package. The idea is to provide more interactive exploration capabilities when working with RESTful APIs. It does so by letting you build requests for an API call and understand more quickly the responses you receive. To that end you can use existing views for requests and responses or build your own. It is inspired by Postman, but without the bloat, and goes beyond it to make sure you can extend it the way you want. In essence, it's for data scientists rather than web developers.
Features
Ipyrest deals with the following concepts, implemented to varying degrees: HTTP Server, Service, Request, Response, Data, MIME-Types, Compression, Logging, Caching, Time-Outs, Errors, Views, Plugins, Testing, and UI.
At the moment the following plugins are available for rendering output from HTTP responses in common formats: Plain Text, CSV, HTML, Bitmaps, SVG, JSON, GeoJSON, GPX, Protobuf, (and some experimental 3D stuff).
The main dependencies are: Python >= 3.6, jupyter, ipywidgets, timeout_decorator, requests, and vcr. Plugin dependencies are: ipyleaflet, ipyvolume, geojson, qgrid, protobuf. Testing dependencies are flask, mypy, and pytest.
Installation
Released versions of Ipyrest can be installed from PyPI with:
pip install ipyrest
Development versions of Ipyrest can be installed either directly from GitHub or after downloading/cloning and unpacking like this in its top-level directory:
pip install git+https://github.com/deeplook/ipyrest
pip install -e .
Testing
Run pip install -r requirements_test.txt
and PYTHONPATH=. pytest -s -v tests
in the root directory. Some tests will automatically start a local flask webserver in tests/api_server.py
which implements a set of sample API endpoints for local testing. And some of these tests need keys/tokens defined as environment variables for the respective APIs being tested. If not present these tests will be skipped.
Documentation
The docs
folder is only a stub for now. At the moment it is recommended to look at examples/meetup.ipynb
, mostly a tutorial-like collection of examples given as a presentation at a meetup. Some of these need appropriate API keys.
How to Contribute
- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug or example for some API (ideally without authentication), e.g. from the extensive collection of Public APIs.
- Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
- Write a test which shows that the bug was fixed or that the feature works as expected.
- Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS.
History
0.1.0 (2018-11-24):
- First release on PyPI.
0.1.1 (2018-11-25):
- Minor test refactoring.
- Minor code/text/formating changes.
- Minor packaging cleanup.
0.1.2 (2018-11-26):
- Finally rendering README.md on PyPI(?).
- Enable classic notebook extension for qgrid.
0.1.3 (2018-11-27):
- Minor text formatting issues.
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
Built Distribution
File details
Details for the file ipyrest-0.1.3.tar.gz
.
File metadata
- Download URL: ipyrest-0.1.3.tar.gz
- Upload date:
- Size: 61.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.2 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8ab6611cfe9ced330ef695b54888e692aa40272958bc27a89f0046ea6d2328a |
|
MD5 | 989a46984d2b67debcd55de5a8d50061 |
|
BLAKE2b-256 | 63219564388d071f319348a088f0f9aee31f5501530945f6de0a9354e4466dc2 |
File details
Details for the file ipyrest-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: ipyrest-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.2 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e8f96a66c1e0e17ff32ae675a208a28e91f8951f8b2d07fb421cf7ca6f727c6 |
|
MD5 | ecfa6d74da29ae4ab93ff5d8955e2592 |
|
BLAKE2b-256 | 8dcd8522985e6401dc5221e5a3c0918ae44e9bf03eeb68912a5327bbd14a582c |