Package to Encode/Decode some common file formats to json

Related tags

JSONZnJSON
Overview

ZnJSON

Package to Encode/Decode some common file formats to json

Available via pip install znjson

In comparison to pickle this allows having readable json files combined with some serialized data.

Example

import numpy as np
import json
import znjson

znjson.register(
    znjson.converter.NumpyConverter
)

data = json.dumps({"data": np.arange(9)}, cls=znjson.ZnEncoder)
_ = json.loads(data, cls=znjson.ZnDecoder)
Comments
  • Allow to use converters directly

    Allow to use converters directly

    Currently you have to do:

    znjson.config.register(CustomConverter)
    json.dump(data, cls=znjson.ZnEncoder)
    

    but maybe you only want to use a specific converter which could look something like:

    json.dump(data, cls=znjson.ZnEncoder.from_converter(CustomConverter, allow_default=True)) # this could be a list of converters
    # or
    json.dump(data, cls=CustomConverter) # this would allow only one converter
    
    opened by PythonFZ 0
  • replace `_decode` with `decode`

    replace `_decode` with `decode`

    • replace _decode/_encode with decode/encode to avoid private methods. keep backwards compatibility.
    • move znjson.register to znjson.config.register
    • add logging
    • rename np.ndarray64 to np.ndarray_b64 to avoid confusion with 64 bit accuracy
    • add dev dependencies
    • add depreciation warnings
    • remove NumpyConverterLatin1
    • fix most circular import issues
    • remove pandas converter, because it uses pickle anyway
    opened by PythonFZ 0
  • check uniquness of representation string when calling register

    check uniquness of representation string when calling register

    It is currently possible to register two converters with the same representation: str which can be avoided by checking for uniqueness in the register command..

    opened by PythonFZ 0
  • generalize serializing scheme

    generalize serializing scheme

    To avoid issues when e.g. de-serializing a dict {"Path": "this is some string"} which should return a dict and not a Path object, it would be possible to serialize all objects to the dict {<type>: val} which would yield{"dict": {"Path": "this is some string"}} and therefore can not be confused with {"Path": "this is some string"}.

    opened by PythonFZ 0
  • Bump certifi from 2022.9.24 to 2022.12.7

    Bump certifi from 2022.9.24 to 2022.12.7

    Bumps certifi from 2022.9.24 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(v0.2.1)
  • v0.2.1(Oct 4, 2022)

    What's Changed

    • add old converters for backwards compatibility by @PythonFZ in https://github.com/zincware/ZnJSON/pull/19
    • Allow to use converters directly by @PythonFZ in https://github.com/zincware/ZnJSON/pull/18

    Full Changelog: https://github.com/zincware/ZnJSON/compare/v0.2.0...v0.2.1

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Oct 4, 2022)

    What's Changed

    • Use poetry + add exceptions by @PythonFZ in https://github.com/zincware/ZnJSON/pull/15
    • replace _decode with decode by @PythonFZ in https://github.com/zincware/ZnJSON/pull/16

    Full Changelog: https://github.com/zincware/ZnJSON/compare/v0.1.2...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Mar 11, 2022)

    What's Changed

    • Change version to be published on PyPi
    • add datetime example by @PythonFZ in https://github.com/zincware/ZnJSON/pull/13

    Full Changelog: https://github.com/zincware/ZnJSON/compare/v0.1.0...v0.1.2

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Mar 10, 2022)

    ZnJSON v0.1.0

    ⚙️New Features

    • changed license to Apache-2.0 License
    • improve numpy converter
    • increase code coverage
    • remove unused code
    • add class converter via pickle

    What's Changed

    • add base64 converter by @PythonFZ in https://github.com/zincware/ZnJSON/pull/6
    • Fix for new release by @PythonFZ in https://github.com/zincware/ZnJSON/pull/10
    • Add tests by @PythonFZ in https://github.com/zincware/ZnJSON/pull/11
    • Add class conv by @PythonFZ in https://github.com/zincware/ZnJSON/pull/5

    Full Changelog: https://github.com/zincware/ZnJSON/compare/v0.0.5...v0.1.0

    Source code(tar.gz)
    Source code(zip)
  • v0.0.5(Jan 19, 2022)

    What's Changed

    • bugfix by @PythonFZ in https://github.com/zincware/ZnJSON/pull/8

    Full Changelog: https://github.com/zincware/ZnJSON/compare/v0.0.4...v0.0.5

    Source code(tar.gz)
    Source code(zip)
  • v0.0.4(Jan 10, 2022)

    What's Changed

    • add pickle for class conversion by @PythonFZ in https://github.com/zincware/ZnJSON/pull/3

    Full Changelog: https://github.com/zincware/ZnJSON/compare/v0.0.3...v0.0.4

    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Dec 6, 2021)

    Rename package from ZnConv to ZnJSON to avoid misconception about convolutional neural networks

    Full Changelog: https://github.com/zincware/ZnJSON/compare/v0.0.2...v0.0.3

    Source code(tar.gz)
    Source code(zip)
  • v0.0.2(Dec 5, 2021)

  • v0.0.1(Dec 5, 2021)

Owner
ZINC
Open source software organisation hosting software built for computational physics and chemistry.
ZINC
A Python application to transfer Zeek ASCII (not JSON) logs to Elastic/OpenSearch.

zeek2es.py This Python application translates Zeek's ASCII TSV logs into ElasticSearch's bulk load JSON format. For JSON logs, see Elastic's File Beat

Corelight, Inc. 28 Dec 22, 2022
A fast streaming JSON parser for Python that generates SAX-like events using yajl

json-streamer jsonstreamer provides a SAX-like push parser via the JSONStreamer class and a 'object' parser via the ObjectStreamer class which emits t

Kashif Razzaqui 196 Dec 15, 2022
API that provides Wordle (ES) solutions in JSON format

Wordle (ES) solutions API that provides Wordle (ES) solutions in JSON format.

Álvaro García Jaén 2 Feb 10, 2022
RedisJSON - a JSON data type for Redis

RedisJSON is a Redis module that implements ECMA-404 The JSON Data Interchange Standard as a native data type. It allows storing, updating and fetching JSON values from Redis keys (documents).

3.4k Dec 29, 2022
Make JSON serialization easier

Make JSON serialization easier

4 Jun 30, 2022
A fast JSON parser/generator for C++ with both SAX/DOM style API

A fast JSON parser/generator for C++ with both SAX/DOM style API Tencent is pleased to support the open source community by making RapidJSON available

Tencent 12.6k Dec 30, 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
Ibmi-json-beautify - Beautify json string with python

Ibmi-json-beautify - Beautify json string with python

Jefferson Vaughn 3 Feb 02, 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
Convert your JSON data to a valid Python object to allow accessing keys with the member access operator(.)

JSONObjectMapper Allows you to transform JSON data into an object whose members can be queried using the member access operator. Unlike json.dumps in

Owen Trump 4 Jul 20, 2022
Console to handle object storage using JSON serialization and deserealization.

Console to handle object storage using JSON serialization and deserealization. This is a team project to develop a Python3 console that emulates the AirBnb object management.

Ronald Alexander 3 Dec 03, 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
With the help of json txt you can use your txt file as a json file in a very simple way

json txt With the help of json txt you can use your txt file as a json file in a very simple way Dependencies re filemod pip install filemod Installat

Kshitij 1 Dec 14, 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
JSON Interoperability Vulnerability Labs

JSON Interoperability Vulnerability Labs Description These are the companion labs to my research article "An Exploration of JSON Interoperability Vuln

Bishop Fox 168 Dec 25, 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 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
Same as json.dumps or json.loads, feapson support feapson.dumps and feapson.loads

Same as json.dumps or json.loads, feapson support feapson.dumps and feapson.loads

boris 5 Dec 01, 2021
No more boilerplate to check and build a Python object from JSON.

JSONloader This module is for you if you're tired of writing boilerplate that: builds a straightforward Python object from loaded JSON. checks that yo

3 Feb 05, 2022
A Python tool that parses JSON documents using JsonPath

A Python tool that parses JSON documents using JsonPath

8 Dec 18, 2022