api-session-1.3.2
توضیحات
requests.Session to work with JSON APIs
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | api-session-1.3.2 |
| نام | api-session |
| نسخه کتابخانه | 1.3.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Baptiste Fontaine |
| ایمیل نویسنده | baptiste@bixoto.com |
| آدرس صفحه اصلی | https://github.com/Bixoto/api-session |
| آدرس اینترنتی | https://pypi.org/project/api-session/ |
| مجوز | MIT |
# api-session
**api-session** is a small module providing an extended `requests.Session` class to work with JSON APIs.
We use it at [Bixoto](https://bixoto.com/) as a basis for JSON API clients such as [PyMagento][] or
[PyBigBuy][].
It aims at factoring the common parts of these clients while staying very lightweight (<100 SLOC).
[PyMagento]: https://github.com/Bixoto/PyMagento
[PyBigBuy]: https://github.com/Bixoto/PyBigBuy
## Features
* base URL: the base API URL is given only once on object creation; subsequent calls use `.get("/path")`
* read-only flag: if given, prevents the API from doing `POST` and similar calls
* `requests.Session` inheritance: the class inherits from `requests.Session`, so it stays 100% compatible with it
## Install
pip install api-session
Dependency: Python 3.8+.
## Usage
```python3
from api_session import APISession
client = APISession("https://httpbin.org")
client.get_json_api("/get")
# => {...}
```
نیازمندی
| مقدار | نام |
|---|---|
| >=2.26.0,<3.0.0 | requests |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8,<4.0 | Python |
نحوه نصب
نصب پکیج whl api-session-1.3.2:
pip install api-session-1.3.2.whl
نصب پکیج tar.gz api-session-1.3.2:
pip install api-session-1.3.2.tar.gz