dask-mongo-2022.5.0
توضیحات
Dask + Mongo intergration
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | dask-mongo-2022.5.0 |
| نام | dask-mongo |
| نسخه کتابخانه | 2022.5.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/dask-mongo/ |
| مجوز | BSD |
# Dask-Mongo
[](https://github.com/coiled/dask-mongo/actions/workflows/tests.yml) [](https://github.com/coiled/dask-mongo/actions/workflows/pre-commit.yml)
Read and write data to MongoDB with Dask
## Installation
`dask-mongo` can be installed with `pip`:
```
pip install dask-mongo
```
or with `conda`:
```
conda install -c conda-forge dask-mongo
```
## Example
```python
import dask.bag as db
import dask_mongo
# Create Dask Bag
records = [
{"name": "Alice", "fruit": "apricots"},
{"name": "Bob", "fruit": ["apricots", "cherries"]},
{"name": "John", "age": 17, "sports": "cycling"},
]
b = db.from_sequence(records)
# Write to a Mongo database
dask_mongo.to_mongo(
b,
database="your_database",
collection="your_collection",
connection_kwargs={"host": "localhost", "port": 27017},
)
# Read Dask Bag from Mongo database
b = dask_mongo.read_mongo(
database="your_database",
collection="your_collection",
connection_kwargs={"host": "localhost", "port": 27017},
chunksize=2,
)
# Perform normal operations with Dask
names = b.pluck("name").compute()
assert names == ["Alice", "Bob", "John"]
```
## License
[BSD-3](LICENSE)
نیازمندی
| مقدار | نام |
|---|---|
| - | dask |
| - | distributed |
| - | pymongo |
| - | pytest |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl dask-mongo-2022.5.0:
pip install dask-mongo-2022.5.0.whl
نصب پکیج tar.gz dask-mongo-2022.5.0:
pip install dask-mongo-2022.5.0.tar.gz