Coder Social home page Coder Social logo

ndjson's People

Contributors

asherf avatar rhgrant10 avatar vshih avatar yomguithereal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ndjson's Issues

Adding ndjson.reader & ndjson.writer

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?

Provide LICENCE

Could you please provide a licence for this package so I can maybe use it in my work?

What is it good for?

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.

Missing Types!

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.