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
Simple, minimal conversion of Bus Open Data Service SIRI-VM data to JSON

Simple, minimal conversion of Bus Open Data Service SIRI-VM data to JSON

Andy Middleton 0 Jan 22, 2022
Atom, RSS and JSON feed parser for Python 3

Atoma Atom, RSS and JSON feed parser for Python 3. Quickstart Install Atoma with pip: pip install atoma

Nicolas Le Manchet 95 Nov 28, 2022
MOSP is a platform for creating, editing and sharing validated JSON objects of any type.

MONARC Objects Sharing Platform Presentation MOSP is a platform for creating, editing and sharing validated JSON objects of any type. You can use any

CASES Luxembourg 72 Dec 14, 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
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
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
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
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
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

1.5k Jan 05, 2023
This open source Python project allow you to create JSON data trees using Minmup.com

This open source Python project allow you to create JSON data trees using Minmup.com. I try to develop this project all the time. But feel free to use :).

Arttu Väisänen 1 Jan 30, 2022
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
JSON Schema validation library

jsonschema A JSON Schema validator implementation. It compiles schema into a validation tree to have validation as fast as possible. Supported drafts:

Dmitry Dygalo 309 Jan 01, 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
A tools to find the path of a specific key in deep nested JSON.

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

kingname 56 Dec 13, 2022
Small python wrapper around the valico rust library to provide fast JSON schema validation.

Small python wrapper around the valico rust library to provide fast JSON schema validation.

Simon J Knibbs 5 Jul 12, 2019
json|dict to python object

Pyonize convert json|dict to python object Setup pip install pyonize Examples from pyonize import pyonize

bilal alpaslan 45 Nov 25, 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

2 Oct 19, 2022
Wikidot-forum-dump - Simple Python script that dumps a Wikidot wiki forum into JSON structures.

wikidot-forum-dump Script is partially based on 2stacks by bluesoul: https://github.com/scuttle/2stacks To dump a Wiki's forum, edit config.py and put

ZZYZX 1 Jun 29, 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