jwdt / csv_converter Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
This will work in a similar way to the lambda handler, but instead of including the function code within the JSON, it will just reference a python function.
{ "New Header One": { "old_column": "Old Header One", "default": "DEFAULT FOR ONE", "lambda": "lambda a, b: str(a.get(b.get('old_column'))).lower()" }, "New Header Two": { "old_column": "Old Header Two", "default": "DEFAULT FOR TWO", "funlink": "custom_python_file_or_module/custom_function" } }
It would then split the string by the forward slash, and import it using:
https://docs.python.org/3/library/importlib.html
Finally, it would run the imported function, in a similar way to the lambda one, with the following variables:
input_line - the current INPUT line
previous_input_lines - all the previous input file lines
current_output_lines - the current output dictionary, not a copy, but the actual one, so these functions are able to view values from, and make changes to previous entries.
item - the current column item in the JSON config.
It would output both the individual item it is processing, as well as the current_output_lines, which is to be updated if there are any changes.
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.