Python wrapper for the Inspectorio API
Project description
Inspectorio API wrapper
The Inspectorio API Wrapper is an unofficial Python library designed to facilitate interactions with the Inspectorio API. This library offers a flexible interface supporting both synchronous and asynchronous operations to access Inspectorio's platform, making it easier to integrate Inspectorio's functionalities into your Python applications.
Features
- Synchronous and Asynchronous Requests: Provides the flexibility to use Python's traditional synchronous or the async/await syntax for non-blocking API calls. This feature enables faster data retrieval, improved efficiency in I/O bound applications, and compatibility with various programming paradigms.
- Automatic Pagination Handling: Effortlessly manage API pagination with built-in methods to fetch all relevant data without manually handling page tokens or limits.
- Swagger Documentation Support: Directly based on Inspectorio's Swagger documentation, ensuring comprehensive coverage of API endpoints and parameters.
- Secure Authentication: Simplified and secure handling of authentication tokens, abstracting the complexity of token management and headers.
- Error Handling: Provides structured error handling mechanisms, making it easier to debug issues related to API requests.
Documentation
For detailed information about the library's API, including classes, methods, and usage examples, please refer to the official documentation of the Python library.
Installation
You can install inspectorio directly from the Python Package Index (PyPI) following this pip
command:
pip install inspectorio
Usage
The Inspectorio API Wrapper supports both synchronous and asynchronous interactions with the Inspectorio API. Here's how to get started with both:
Synchronous Usage
For traditional blocking requests, you can use the InspectorioSight class. Here's a quick example to authenticate and list all reports:
from inspectorio.sight import InspectorioSight
# Initialize the InspectorioSight
app = InspectorioSight()
# Login with your credentials
username = "username@mail.com"
password = "__password__"
app.login(username=username, password=password)
# Fetch and list all reports, the method deals with pagination
result = app.list_all_reports()
Asynchronous Usage
If your application requires non-blocking calls, replace InspectorioSight
with AsyncInspectorioSight
. This class offers the same functionalities but operates asynchronously:
from inspectorio.sight import AsyncInspectorioSight
# For asynchronous operations, use the AsyncInspectorioSight class
# Initialization and usage are similar to the synchronous version but with async/await syntax
async def main():
app = AsyncInspectorioSight()
await app.login(username="username@mail.com", password="__password__")
result = await app.list_all_reports()
# Remember to run your async function in an event loop
Both examples demonstrate how to authenticate and retrieve data from the Inspectorio API. Choose the approach that best fits your application's architecture.
Code of Conduct
Please note that the inspectorio project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
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 inspectorio-0.5.1.tar.gz
.
File metadata
- Download URL: inspectorio-0.5.1.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce6c7c85b63c252b0151efca83ee3dfff9f2ee127bebe3c80ee98df600bf8174 |
|
MD5 | f51c01d52b73245e1dbf227f7c99fa1e |
|
BLAKE2b-256 | df4683d080e232184cc7f7e39164b7a198c0fc0771c3ff20e5ac372b438e6f70 |
File details
Details for the file inspectorio-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: inspectorio-0.5.1-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bae28d36c428080e48dec89273e6bdb14c326baa094e7855407a6f4eb0957854 |
|
MD5 | 19f4f808506dd60313113dcaa1d954b2 |
|
BLAKE2b-256 | 3abc3421620afd6307b5d53f24cb431261173793c63fe060c855e3392030c361 |