bus-0.0.1
توضیحات
Aggregate JSON data together
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | bus-0.0.1 |
| نام | bus |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Joe Coburn |
| ایمیل نویسنده | joe@scholarpack.com |
| آدرس صفحه اصلی | https://github.com/CoburnJoe/bus |
| آدرس اینترنتی | https://pypi.org/project/bus/ |
| مجوز | - |
# Bus - Python Json Aggregator
Pre-Alpha project
Takes json payloads and combines them by nesting one in the payload of another using a shared key.
## Installation
Install with Pip:
```bash
pip install bus
```
## Usage
```python
from bussing.busses import Bus
Bus().group(parent='PARENT JSON', child='CHILD JSON', keys=[("id", "shapes")]
```
Keys needs to be a list of tuples. The first element is the key ID to match results with,
and the second is the new name to list items as under the parent.
## Examples
Given:
```json
[
{
"id":"Apples",
"colours":[
"Red",
"Green"
]
},
{
"id":"Bananas",
"colours":[
"Yellow"
]
},
{
"id":"Mangos",
"colours":[
"Orange",
"Green"
]
}
]
```
And:
```json
[
{
"id":"Apples",
"round":true
},
{
"id":"Bananas",
"round":false
}
]
```
You can combine these results into one payload:
```json
[
{
"id":"Apples",
"colours":[
"Red",
"Green"
],
"shapes":{
"round":true
}
},
{
"id":"Bananas",
"colours":[
"Yellow"
],
"shapes":{
"round":false
}
},
{
"id":"Mangos",
"colours":[
"Orange",
"Green"
]
}
]
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl bus-0.0.1:
pip install bus-0.0.1.whl
نصب پکیج tar.gz bus-0.0.1:
pip install bus-0.0.1.tar.gz