Examples
data-pipeline
A monthly revenue report made with pandas from two CSV exports, and its recording.
A monthly report made with pandas from two exports: orders.csv (one row per order: order_id, customer_id, placed, amount; 200 orders of October) and customers.csv (customer_id, name, region). The pipeline drops the orders that have no amount yet, drops repeated order numbers when there are any, joins each order to its customer, sums the amounts by region and writes report.csv.
- Source:
ormaos-examples/use-cases/data-pipeline - Guide: Data pipeline
Run it#
python pipeline.py$ python pipeline.py
report.csv written: 4 regionsRecorded#
ormaos run -- python pipeline.py$ ormaos run -- python pipeline.py
report.csv written: 4 regions
ormaos: r1 exit 0 in …: 1 Python process, 8 calls, 0 exceptions, 6 io
ormaos: not collected: io: reads of the 1 file opened at pipeline.py:11: opened for reading, and no `read` call by Python code was seen on a file of that name: if it was read, that was inside C code (a file that is iterated, `for line in f`, `csv.reader`) (+2 more)
ormaos: saved in .ormaos/r1, next: ormaos tree r1:c1$ ormaos show
r1 exit 0 in …: 1 Python process, 8 calls, 0 exceptions (0 swallowed, 0 uncaught)
command: python pipeline.py
code: git commit not read (the working directory is not inside a git repository)
io: 6 events (file 6)
dataframes: a DataFrame or Series was an argument or a result 10 times (rows, columns, dtypes and nulls: ormaos tree)
not collected: io: reads of the 1 file opened at pipeline.py:11: opened for reading, and no `read` call by Python code was seen on a file of that name: if it was read, that was inside C code (a file that is iterated, `for line in f`, `csv.reader`)
not collected: io: reads of the 1 file opened at pipeline.py:15: opened for reading, and no `read` call by Python code was seen on a file of that name: if it was read, that was inside C code (a file that is iterated, `for line in f`, `csv.reader`)
not collected: io: writes to the 1 file opened at pipeline.py:37: opened for writing, and no `write` call by Python code was seen on a file of that name: if it was written, that was inside C code (`print(..., file=f)`, `csv.writer`)
never recorded: values, and 20 more kinds of things (`ormaos show --full` lists them with the reason)
next: ormaos tree r1:c1 | ormaos io r1