Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow import/export from JSON #136

Open
tversteeg opened this issue Nov 30, 2021 · 6 comments
Open

Allow import/export from JSON #136

tversteeg opened this issue Nov 30, 2021 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tversteeg
Copy link
Member

The current format is not serializable, so it can't be non-trivially sent over a network connection. We need to add Cpt.from_json() and Cpt.to_json() methods (same for Borehole).

@ritchie46
Copy link
Collaborator

Format of what? The gef files, or the state we keep internally when we parsed it?

@tversteeg
Copy link
Member Author

tversteeg commented Nov 30, 2021

Format of what? The gef files, or the state we keep internally when we parsed it?

The whole Cpt and Borehole classes. So basically the parsed state.

@ritchie46
Copy link
Collaborator

Right, there is room for optimization here. I think we should consider a naive to_json, but also a serialize / deserialize. (with some options, e.g. `parquet, ipc, compression types).

For instance the columnar format of the DataFrame can be stored in binary and be compressed. Which can save quite some wire transfer.

@breinbaas
Copy link
Contributor

breinbaas commented Dec 6, 2021

Why not use pydantic's BaseModel which makes it easy with json() and parse_raw()

@tversteeg tversteeg added enhancement New feature or request good first issue Good for newcomers labels Mar 7, 2023
@maarten-betman
Copy link
Contributor

Hi @tversteeg, this feature would be useful for some services I'm running. Ok if I put a PR in for this enhancement?
How do you feel about usage of Pydantic?

@tversteeg
Copy link
Member Author

Any PRs are greatly appreciated! Pydantic looks like a nice solution for this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants