Package to Encode/Decode some common file formats to json

Related tags

JSON ZnJSON
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
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 3, 2023
Json utils is a python module that you can use when working with json files.

Json-utils Json utils is a python module that you can use when working with json files. it comes packed with a lot of featrues Features Converting jso

Advik 4 Apr 24, 2022
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
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 1, 2021
Ibmi-json-beautify - Beautify json string with python

Ibmi-json-beautify - Beautify json string with python

Jefferson Vaughn 3 Feb 2, 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
An tiny CLI to load data from a JSON File during development.

JSON Server - An tiny CLI to load data from a JSON File during development.

Yuvraj.M 4 Mar 22, 2022
Convert your subscriptions csv file into a valid json for Newpipe!

Newpipe-CSV-Fixer Convert your Google subscriptions CSV file into a valid JSON for Newpipe! Thanks to nikcorg for sharing how to convert the CSV into

Juanjo 44 Dec 29, 2022
Json GUI for No Man's Sky save file

NMS-Save-Parser Json GUI for No Man's Sky save file GUI python NMS_SAVE_PARSER.py [optional|save.hg] converter only python convert.py usage: conver

null 2 Oct 19, 2022
Fileson - JSON File database tools

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

Joonas Pihlajamaa 2 Feb 2, 2022
The ldap2json script allows you to extract the whole LDAP content of a Windows domain into a JSON file.

ldap2json The ldap2json script allows you to extract the whole LDAP content of a Windows domain into a JSON file. Features Authenticate with password

Podalirius 68 Dec 7, 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 8, 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 7, 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
A tools to find the path of a specific key in deep nested JSON.

如何快速从深层嵌套 JSON 中找到特定的 Key #公众号 在爬虫开发的过程中,我们经常遇到一些 Ajax 加载的接口会返回 JSON 数据。

kingname 56 Dec 13, 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
simplejson is a simple, fast, extensible JSON encoder/decoder for Python

simplejson simplejson is a simple, fast, complete, correct and extensible JSON <http://json.org> encoder and decoder for Python 3.3+ with legacy suppo

null 1.5k Jan 5, 2023
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
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 parse JSON 4x faster than RapidJSON and 25x faster than JSON for Modern C++.

null 16.3k Dec 29, 2022