Quick start¶
Follow the complete minimal flow: load data, inspect rows, update the schema and save another format.
End-to-end flow¶
Load a JSON file, add a column in memory and export CSV. Python and Robot Framework use the same flow. Install Robot Framework separately for the Robot example.
Input¶
Run¶
quickstart.robot
*** Settings ***
Library Pytabify
*** Test Cases ***
Convertir json a csv
${table}= Pytabify.Create Data Table From File people.json
${headers}= Pytabify.Get Data Table Headers ${table}
Log To Console ${headers}
${row}= Pytabify.Get Data Table Row ${table} 0
Log To Console ${row.name}
${table}= Pytabify.Set Data Table Value ${table} 0 country MX
Pytabify.Save Data Table To Csv ${table} people.csv
Expected output¶
Saving is explicit
Cell assignment changes memory only. into_csv or Save Data Table To Csv creates the file.
Alternative sources
In-memory access¶
Index, attribute and key access
row = datatable[0]
print(row.name)
print(row["age"])
print(row.to_dict())
Safe schema updates
Adding a new column to one row expands the full schema and fills other rows with None.
Basic parameters¶
| Parameter | Applies to | Purpose |
|---|---|---|
path |
from_file, into_csv, into_json, into_xlsx |
Input/output file |
sheet_name |
XLSX from_file |
Specific sheet |
encoding |
CSV/JSON reading and writing | File encoding |
records |
from_records |
Initial tabular collection |
Practical format rules¶
- CSV: portable; reading returns strings.
- JSON: preserves supported native types.
- XLSX: requires sheet_name when reading.
Read an XLSX sheet
Common errors¶
- Missing file:
pathmust identify a real file. - Non-rectangular records: every row must share the same set of columns.
- Unexpected CSV types: use JSON, XLSX or from_records when native types matter.
Next steps¶
Python examples Robot Framework examples DataTableCreator reference DataTableSaver reference
[{"name": "English", "lang": "en", "link": "/pytabify/getting-started/quickstart/", "fragments": {"quick-start": "quick-start", "end-to-end-flow": "end-to-end-flow", "input": "input", "run": "run", "expected-output": "expected-output", "in-memory-access": "in-memory-access", "basic-parameters": "basic-parameters", "practical-format-rules": "practical-format-rules", "common-errors": "common-errors", "next-steps": "next-steps"}, "current": true}, {"name": "Espa\u00f1ol", "lang": "es", "link": "/pytabify/es/getting-started/quickstart/", "fragments": {"quick-start": "inicio-rapido", "end-to-end-flow": "flujo-minimo-de-principio-a-fin", "input": "input", "run": "comando", "expected-output": "output-esperado", "in-memory-access": "que-pasa-en-memoria", "basic-parameters": "parametros-importantes-de-uso-basico", "practical-format-rules": "reglas-practicas", "common-errors": "errores-frecuentes-en-uso-basico", "next-steps": "despues-del-quickstart"}, "current": false}]