Reading in multiple files in one go.
See original GitHub issueIs your feature request related to a problem? Please describe.
I have a folder with lots and lots of json files. Can I read them in all at once?
Describe the solution you’d like
It’d be nice if all of our readers allowed for a '*'
or a Path.glob
that allows you to read in lots of files at once.
Something like:
Clumper.read_json("folder/*.json")
Clumper.read_json(pathlib.Path("folder").glob("*"))
Additional context
As far as an implementation goes, we can probably solve this nicely with a decorator. Assuming the function that it wraps is a file-reader we should not need to touch the internal readers.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:20 (20 by maintainers)
Top Results From Across the Web
How to import multiple .csv files at once? - Stack Overflow
Just write and swap in a little function that not only reads the files but immediately appends a filename to each record read....
Read more >How to Read Multiple CSV Files in R - Spark by {Examples}
Read Multiple CSV Files in R (The best approach) In order to read multiple CSV files or all files from a folder in...
Read more >How can I read in multiple files? | R Code Fragments
You may at times wish to read a set of data files into R. The code below demonstrates how to do so looping...
Read more >How to read multiple text files from folder in Python?
In this article, we will learn how to read multiple text files from a folder using python. Approach: Import modules; Add path of...
Read more >How to Read Multiple Excel or CSV Files Together
In R, you can write a script to read all the files in the same folder and bring them relatively easily. Let's say...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@koaning Gefeliciteerd!
I agree with @samukweku. It makes things more complicated. I would suggest we support the following inputs for reading jsonl
I am having some trouble with accessing the
path
argument in the decorator, maybe we can discuss how to solve it? We could discuss it in this issue but it would be unnecessarily bloated with messages so I suggest we talk in some chat platform. Is there any platform you prefer to talk in? I can create a room in gitter for these discussions as it has easy integration with github.I dont think we should. separating single and multiple files seems to be an easier and more maintainable approach