mara / mara-pipelines

A lightweight opinionated ETL framework, halfway between plain scripts and Apache Airflow
MIT License
2.07k stars 100 forks source link

add HTTP Request command #78

Closed leo-schick closed 1 year ago

leo-schick commented 2 years ago

I plan to add a new HttpRequestCommand which shall run a HTTP/HTTPS command via curl.

It should keep the output clean (using option -s) and fail when the request returns an error code (option -f).

Things to implement

Possible use cases

How to implement

leo-schick commented 2 years ago

@jankatins any comments about the design?

jankatins commented 2 years ago

I always did that directly via curl or python, so sounds fine.

I've not yet a clue on the stdin thingy, how would you use that?

leo-schick commented 2 years ago

I build a cloud function which validates a XML file against a schema and converts it to json. To process this logic through files in a directory the shell command would look roughly like this:

shell_command = f"{mara_storage.shell.read_file_command(...) \\\n" \
                f"  | {mara_pipelines.shell.http_request_command(...)} \\\n" \
                f"  | {mara_storage.shell.write_file_command(..)"