aiocouch-2.2.2
توضیحات
🛋 An asynchronous client library for CouchDB 2.x and 3.x
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | aiocouch-2.2.2 |
| نام | aiocouch |
| نسخه کتابخانه | 2.2.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | TU Dresden |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/metricq/aiocouch |
| آدرس اینترنتی | https://pypi.org/project/aiocouch/ |
| مجوز | BSD 3-clause |
[](https://opensource.org/licenses/BSD-3-Clause)
[](https://badge.fury.io/py/aiocouch)

[](https://codecov.io/gh/metricq/aiocouch)
[](https://aiocouch.readthedocs.io/en/latest/?badge=latest)
# aiocouch
An asynchronous client library for CouchDB 2.0 based on asyncio using aiohttp
## Key features
- All requests are asynchronus using aiohttp
- Supports CouchDB 2.x and 3.x
- Support for modern Python ≥ 3.7
## Library installation
```
pip install aiocouch
```
## Getting started
The following code retrieves and prints the list of `incredients` of the *apple_pie* `recipe`.
The `incredients` are stored as a list in the *apple_pie* `aiocouch.document.Document`,
which is part of the `recipe` `aiocouch.database.Database`. We use the context manager
`aiocouch.CouchDB` to create a new session.
```python
from aiocouch import CouchDB
async with CouchDB(
"http://localhost:5984", user="admin", password="admin"
) as couchdb:
db = await couchdb["recipes"]
doc = await db["apple_pie"]
print(doc["incredients"])
```
We can also create new recipes, for instance for some delicious cookies.
```python
new_doc = await db.create(
"cookies", data={"title": "Granny's cookies", "rating": "★★★★★"}
)
await new_doc.save()
```
For further details please refer to the documentation, which is available [here on readthedocs.org](https://aiocouch.readthedocs.io/).
## Run examples
- Setup the CouchDB URL and credentials using the environment variables
- Install dependencies using `pip install --editable '.[examples]'`
- run for instance `python examples/getting_started.py`
## Run tests
- Install dependencies using `pip install --editable '.[tests]'`
- Setup the CouchDB URL and credentials using the environment variables (`COUCHDB_HOST`, `COUCHDB_USER`, `COUCHDB_PASS`)
- run `pytest --cov=aiocouch`
## Generate documentation
- Install dependencies using `pip install '.[docs]'`
- switch to the `docs` directory: `cd docs`
- run `make html`
نیازمندی
| مقدار | نام |
|---|---|
| ~=3.0 | aiohttp |
| - | Deprecated |
| - | typing-extensions |
| - | isort |
| - | black |
| - | pytest |
| - | pytest-asyncio |
| - | pytest-cov |
| - | packaging |
| - | mypy |
| - | types-Deprecated |
| - | sphinx |
| - | sphinx-autodoc-typehints |
| - | sphinxcontrib-trio |
| - | sphinx |
| - | sphinx-autodoc-typehints |
| - | sphinxcontrib-trio |
| - | aiomonitor |
| - | click |
| - | click-log |
| - | click-completion |
| - | pytest |
| - | pytest-asyncio |
| - | pytest-cov |
| - | packaging |
| - | mypy |
| - | types-Deprecated |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl aiocouch-2.2.2:
pip install aiocouch-2.2.2.whl
نصب پکیج tar.gz aiocouch-2.2.2:
pip install aiocouch-2.2.2.tar.gz