Write mode for topen #36
Comments
@roll excellent idea. Presumably this could DRY code for exporting to Data Package from other data stores, like SQL, BigQuery, etc. |
Yes, I've written too many boilerplate code lately 😃 |
@pwalsh |
@roll I see, but it still seems to me that a high-level write interface is different from a write processor, used in the read interface, to create a new, recoded file. No? |
@pwalsh
than it's really different. For now it's just not clear from high-level requirements why you need it as a side effect using processor. This processor will be much less powerful than general writing system and will require some duplication. |
Maybe it is, not sure. Imagine piping data through a chain of processors like so:
the recoder just recodes the stream, and is followed by a final processor writing the stream to some new destination. |
@pwalsh So let see closer to real design proposals 😃 |
@roll ok, if that is the internal design. In your examples above, would the writing require the file contents to be loaded to memory? The API description looks like yes, but that would be a mistake IMHO. |
@pwalsh After we will finish it my idea to create example like loading 1GB xls from the web and saving it to csv file with memory profiler showing we don't use memory) |
Overview
It's a long shot but eventually I suppose it could be implemented.
Having a task to write some tabular data to the filesystem is casual. With all the boilerplate code to support py2/3, csv verbose interface etc - it's a little bit annoying.
Analysis
Interface could be:
Implementation could be:
topen
returnsReadTable
orWriteTable
regarding to themode='r/w'
Formatter
(anti-parser) andWriter
(anti-loader) with the same modular arhictecture for different targets and formats.So we will be able to have memory lean things like:
Or even with something like
tcopy
helper:Tasks
The text was updated successfully, but these errors were encountered: