A JSON utility library for Python featuring Django-style queries and mutations.

Related tags

JSONpythondjango
Overview

PyPI - Python Version PyPI

JSON Enhanced

JSON Enhanced implements fast and pythonic queries and mutations for JSON objects.

Installation

You can install json-enhanced with pip:

pip install json-enhanced

Quickstart

result.first().parent # {'name': 'Carl', 'birthday': '1950-06-02 16:00:00', 'publications': 36} # We can also retrieve the path of a node: result.first().jsonpath # data/2/ ">
import jsonutils as js
from datetime import datetime

# We create a new JSONObject either directly or from a local file/URL:
json_data = js.JSONObject(
    {
        "data": [
            {
                "name": "Dan",
                "birthday": "1991-01-02 09:00:00",
                "publications": 15
            },
            {
                "name": "Mar",
                "birthday": "1991-03-02 12:30:00",
                "publications": 13
            },
            {
                "name": "Carl",
                "birthday": "1950-06-02 16:00:00",
                "publications": 36
            },
            {
                "name": "Vic",
                "birthday": "1986-07-02 16:00:00",
                "publications": None
            },
        ]
    }
)

# Now we can navegate through this object by attribute accesion:
json_data.data._1.name
# 'Mar'

# Or we can make queries. The syntax is very similar to Django's querysets:
result = json_data.query(birthday__lt=datetime(1985,1,1))

result
# 
   

result.first().parent
# {'name': 'Carl', 'birthday': '1950-06-02 16:00:00', 'publications': 36}

# We can also retrieve the path of a node:
result.first().jsonpath
# data/2/

Documentation

Detailed documentation is available at json-enhanced.readthedocs.io.

Contributing

Contributions are welcome! Please take a look at our contributors guide.

Code of Conduct

Please read CODE_OF_CONDUCT.md for details on our code of conduct.

License

This project is licensed under the GPL-3.0 License. For details, please read our LICENSE FILE.

Owner
Collisio Technologies
Our monitoring tools for decision makers empower businesses to make data-driven decisions.
Collisio Technologies
A daily updated JSON dataset of all the Open House London venues, events, and metadata

Open House London listings data All of it. Automatically scraped hourly with updates committed to git, autogenerated per-day CSV's, and autogenerated

Jonty Wareing 4 Jan 01, 2022
simdjson : Parsing gigabytes of JSON per second

JSON is everywhere on the Internet. Servers spend a *lot* of time parsing it. We need a fresh approach. The simdjson library uses commonly available SIMD instructions and microparallel algorithms to

16.3k Dec 29, 2022
Editor for json/standard python data

Editor for json/standard python data

1 Dec 07, 2021
Random JSON Key:Pair Json Generator

Random JSON Key:Value Pair Generator This simple script take an engish dictionary of words and and makes random key value pairs. The dictionary has ap

Chris Edwards 1 Oct 14, 2021
JSONx - Easy JSON wrapper packed with features.

🈷️ JSONx Easy JSON wrapper packed with features. This was made for small discord bots, for big bots you should not use this JSON wrapper. 📥 Usage Cl

2 Dec 25, 2022
A JSON utility library for Python featuring Django-style queries and mutations.

JSON Enhanced JSON Enhanced implements fast and pythonic queries and mutations for JSON objects. Installation You can install json-enhanced with pip:

Collisio Technologies 4 Aug 22, 2022
Python script to extract news from RSS feeds and save it as json.

Python script to extract news from RSS feeds and save it as json.

Alex Trbznk 14 Dec 22, 2022
Creates fake JSON files from a JSON schema

Use jsf along with fake data generators to provide consistent and meaningful fake data for your system.

Andy Challis 86 Jan 03, 2023
Simple Python Library to convert JSON to XML

json2xml Simple Python Library to convert JSON to XML

Vinit Kumar 79 Nov 11, 2022
cysimdjson - Very fast Python JSON parsing library

Fast JSON parsing library for Python, 7-12 times faster than standard Python JSON parser.

TeskaLabs 235 Dec 29, 2022
Low code JSON to extract data in one line

JSON Inline Low code JSON to extract data in one line ENG RU Installation pip install json-inline Usage Rules Modificator Description ?key:value Searc

Aleksandr Sokolov 12 Mar 09, 2022
Fileson - JSON File database tools

Fileson is a set of Python scripts to create JSON file databases

Joonas Pihlajamaa 2 Feb 02, 2022
Convert Wii UI formats to JSON5 and vice versa

Convert Wii UI formats to JSON5 and vice versa

Pablo Stebler 11 Aug 28, 2022
Generate code from JSON schema files

json-schema-codegen Generate code from JSON schema files. Table of contents Introduction Currently supported languages Requirements Installation Usage

Daniele Esposti 30 Dec 23, 2022
JsonParser - Parsing the Json file by provide the node name

Json Parser This project is based on Parsing the json and dumping it to CSV via

Ananta R. Pant 3 Aug 08, 2022
A JSON API for returning Godspeak sentences. Based on the works of Terry A Davis (Rest in Peace, King)

GodspeakAPI A simple API for generating random words ("godspeaks"), inspired by the works of Terrence Andrew Davis (Rest In Peace, King). Installation

Eccentrici 3 Jan 24, 2022
Package to Encode/Decode some common file formats to json

ZnJSON Package to Encode/Decode some common file formats to json Available via pip install znjson In comparison to pickle this allows having readable

ZINC 2 Feb 02, 2022
A python library to convert arbitrary strings representing business opening hours into a JSON format that's easier to use in code

A python library to convert arbitrary strings representing business opening hours into a JSON format that's easier to use in code

Adrian Edwards 9 Dec 02, 2022
A query expression for extracting data from JSON.

JSONPATH A selector expression for extracting data from JSON. Quickstarts Installation Install the stable version from PYPI. pip install jsonpath-extr

林玮 (Jade Lin) 33 Oct 22, 2022
JSONManipulator is a Python package to retrieve, add, delete, change and store objects in JSON files.

JSONManipulator JSONManipulator is a Python package to retrieve, add, delete, change and store objects in JSON files. Installation Use the package man

Andrew Polukhin 1 Jan 07, 2022