-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Make FAO parser more modular [should we do it now?] #52
Comments
@atherdon @AndrewSerra Here's a continuation from the last FAO issue. |
#27 How I see it. We have few files with csv data inside of it. Some of them might be in one place, some of them at other. I think at this repo or at generator we have a method, that can grab all files inside of it. do we need to pass an object/archive with paths for each file + name or we can do it dynamically? next thing is - how they will be stored, when parsed and saved. what about errors. Imagine that first file was parsed and headers works well, but second is crashed - what we'll need to do? how we'll use this parser? I mean we have 3 different datasets. Do we need to create > 3 lines at package.json in order to call it or how we can make it work outside of this main module. we should also discuss what methods we need to moveout from our we also need to create tests for that new methods, because we have a lot of people here - always small changes and everything can go broken after 1 my mistake with one megre |
I'm a bit confused in general. Are we pursuing the single parser? If so, I think we can handle all concerns one by one. Eventually, it will work. |
right now we exploring what shall be done in order to make it, but right now it's just a discussion @AndrewSerra |
I'm also a bit confused. Just to clarify:
This method will grab all of the csv (or json) files inside of the repository? I didn't see it in this repo, but I'll keep looking in food-static-files-generator.
I think if we can access all the csv files dynamically, then it would be nice to write the json files dynamically as well (i.e. write them in their proper directories without passing any path arguments to the method). Otherwise, I think we should pass path arguments for the source and target directories.
I'll think on this and get back to you if I have any ideas before we try implementing.
One line in the package.json sounds preferable to me, but it would be helpful to have more context about how you see this parser being used as a node module. Could you please explain how you see this code being used by others?
I imagine we'll eventually want to move out
Definitely. I've never written tests for filesystem code, but it sounds fun. |
We have a method for JSON files, but I think with small modifications it can
it will be cool. Because our main goal is not just parse, but create json files as we need it(sometimes it require some modifications at structure, for example, adding ID or adding
We need to make a separated method, that will parse/check each file and if it will get errors - we will display them. and we'll call this method inside the loop, that iterating "all file"s that we have
I think we'll soon or later have a "one line for parser at pkg.json" but there a lot of work to do before. I see it like: someone has a dataset. He creates a basic nodejs server and installs our
We'll do it when you'll think it's ready. Because why to keep it at one FAO file a tool that can be used by other datasets as well
Tests should be an important part of coders process. especially at this time when we have a lot of cool tools that help us to fight bugs. |
I think this method can be an example: https://github.com/GroceriStar/food-static-files-generator/blob/master/src/objects.js#L14 |
Hey Arthur. I will unfortunately not be able to contribute to GS anymore. Thank you for everything, and best of luck!
… On Oct 16, 2019, at 1:15 PM, Arthur Tkachenko ***@***.***> wrote:
Reopened #52.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi Jan, not a problem at all - I understand
… |
Expected Behavior / Situation
One parser.js file that can dynamically convert csv files from any directory into a json file in that same directory.
Actual Behavior / Situation
One parser.js file that can convert csv files from its own directory into a json file in that same directory.
Modification Proposal
Let's discuss this, but one way forward would be to write a script for parser.js that takes an argument—the path to the directory containing the target csv file—and then outputs a json version of that file in the given directory.
The text was updated successfully, but these errors were encountered: