MongoDB aggregate operations declared for python
Project description
PyMongoAggregate
version: "0.0.1"
example
from re import compile as re_compile
from pymongo_aggregate.operations.stages.match import Match
from pymongo_aggregate.operations.stages.project import Project
from pymongo_aggregate.operations.stages.unwind import Unwind
from pymongo_aggregate.operations.operators.regex_find import RegexFind
pipeline = [
Match({
"experiment_name": "experiment2"
}),
Project({
"proxy_id": 1,
"input_text": 1,
"capture_country": RegexFind(input_field="$output", pattern=re_compile(r"\*\*Country\*\*\n\s+-\s+(.*)\n"))
}),
Unwind(
path="$capture_country.captures",
include_array_index="country_index",
preserve_null_and_empty_arrays=True
),
Match({
"country_index": 0
}),
Project({
"_id": 0,
"proxy_id": 1,
"input_text": 1,
"output_country": "$capture_country.captures"
})
]
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymongo_aggregate-0.0.3.tar.gz.
File metadata
- Download URL: pymongo_aggregate-0.0.3.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e2b8885b74e2098abe489ffd7d88985b4c633af8f3d3707f377e5311e09ea5e
|
|
| MD5 |
36000eeae258126a87b3ee4222b182df
|
|
| BLAKE2b-256 |
f765dc13adf8b3931c27ceb51f4a3379e2f884089ef171e02462323eef157037
|
File details
Details for the file pymongo_aggregate-0.0.3-py3-none-any.whl.
File metadata
- Download URL: pymongo_aggregate-0.0.3-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be9c027dfd44f8ca28100443f54ce96108c60a7214871618d109409a91eca0bb
|
|
| MD5 |
20ecafae574cb2ad3cec6c0debd3960e
|
|
| BLAKE2b-256 |
c1722f53edcc15501b08a58ba1955ba72ada3cdfce9d0510d3a6093400845c60
|