Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
jsonatago is a Python library that enables you to evaluate JSONata expressions. This project aims to bring the power and flexibility of JSONata to Python developers.
This project uses the Go implementation of JSONata from jsonata-go. All credit for the Go implementation goes to the authors and contributors of jsonata-go.
To install jsonatago, you can use pip:
pip install jsonatago
Here's a simple example that demonstrates how to evaluate a JSONata expression:
python
from jsonatago import Jsonata
JSONATA_TEST_DATA = {
"Account": {
"Order": [
{"Product": [{"Price": 10, "Quantity": 2}, {"Price": 5, "Quantity": 5}]},
{"Product": [{"Price": 20, "Quantity": 1}, {"Price": 15, "Quantity": 3}]}
]
}
}
expr = Jsonata("$sum(Account.Order.Product.(Price * Quantity))")
print(expr.evaluate(JSONATA_TEST_DATA))
This will output the sum of all Price * Quantity for each product in each order.
You can use as well direct method for compilation and evaluation in one step. python
from jsonatago import jeval
JSONATA_TEST_DATA = {
"Account": {
"Order": [
{"Product": [{"Price": 10, "Quantity": 2}, {"Price": 5, "Quantity": 5}]},
{"Product": [{"Price": 20, "Quantity": 1}, {"Price": 15, "Quantity": 3}]}
]
}
}
print(jeval(JSONATA_TEST_DATA,"$sum(Account.Order.Product.(Price * Quantity))"))
If you'd like to contribute to this project, please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
Your package description here
We found that jsonatago demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.