Skip to content

ENH: simple, compact and reversible JSON interface #53252

Open
@loco-philippe

Description

@loco-philippe

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

The data type is not explicitely taken into account in the current JSON interface.

To work around this problem, a data schema must be associated with the json file.

Nevertheless, the current Json interface is not reversible.

Feature Description

proposal

To have a simple, compact and reversible solution, I propose to use the JSON-NTV format (Named and Typed Value) - which integrates the notion of type - and its JSON-TAB variation for tabular data.
This solution allows to include a large number of types (not necessarily Pandas dtype).

examples

Several examples are provided in the linked NoteBook

references

Alternative Solutions

The alternative solution is to describe each piece of data in the form {'type': xxx, 'value': xxx}, which significantly weighs down the format used.
I don't know of an alternative Json format that integrates the notion of type (please let me know if you know any!)

Additional Context

-> NTV repository : https://github.com/loco-philippe/NTV

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementIO JSONread_json, to_json, json_normalizeNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions