rhgrant10 / ndjson Goto Github PK
View Code? Open in Web Editor NEWndjson with the same interface as the builtin json module
License: Other
ndjson with the same interface as the builtin json module
License: Other
Hello @rhgrant10,
I would like to open a PR on your repo to add two things I find myself recoding often and wanted to know whether you would consider those features useful/relevant for your library: a ndjson writer & reader, having a very similar interface as the standard python ones from the csv
module. Indeed, those would be very useful when reading the input line by line and when outputing the result in a stream fashion.
Here is an example of the API:
import ndjson
# Reader
with open('./posts.jsonl') as f:
reader = ndjson.reader(f)
for post in reader:
print(post['id'])
# Writer
with open('./posts.jsonl', 'w') as f:
writer = ndjson.writer(f)
for item in data:
writer.writerow(item)
What do you think?
Could you please provide a licence for this package so I can maybe use it in my work?
At the beginning of the README, state clearly what it is good for.
Now you have this:
"""
ndjson
Support for ndjson. Plain and simple.
"""
But what is ndjson? It's a recursive description.
I saw that PyPi.org has a version 0.3.1 which I can't find on GitHub.
MyPy doesn't like this and the types don't seem to be available anywhere..
error: Skipping analyzing "ndjson": module is installed, but missing library stubs or py.typed marker
note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.