Skip to content

Many formats.One table.

Read, update and save test data in CSV, JSON and XLSX.

Python · Robot Framework
CSV · JSON · XLSX
Discover Pytabify

The same table. One new column.

The same quickstart example: adding a column keeps the schema consistent across every row. Only Alice receives the value MX.

table[0]["country"] = "MX"
name age
Alice 30
Bob 25
name age country
Alice 30 MX
Bob 25 None

The update happens in memory. Saving requires an explicit call; CSV represents the empty value as an empty cell and JSON as null.

See the complete example

  • Install and verify

    Use pip or Poetry and confirm the library loads.

    Installation

  • Start quickly

    Load a file, update a cell and export without reading the whole API.

    Quick start

  • Use tested examples

    JSON → CSV, XLSX → JSON and Robot workflows covered by tests.

    Examples

  • Resolve common errors

    Missing sheets, unsupported extensions, invalid paths and non-rectangular records.

    Troubleshooting

A cell returns its value

table[0].nombre and table[0]["nombre"] return the same value. Use brackets for names with spaces or collisions such as to_dict.

Introduction

pytabify helps technical teams load, validate, update and save tabular data through one contract instead of writing a parser and conversion layer for every format.

It supports Python scripts, fixtures and simple transformations; QA teams using file-based test data; and Robot Framework suites needing stable row and column access.

The problem it solves

One API handles reading different formats, keeping column order, updating rows consistently, exporting another format and reusing those operations from Python and Robot. Adding a column keeps all rows synchronized.

Scope

Each column is one flat field. Nested business objects and immediate recording of generated identifiers belong to the test project.

What you can do

Leer, mutar y exportar
from pytabify import DataTableCreator, DataTableSaver

datatable = DataTableCreator.from_file("people.json")
datatable[0]["country"] = "MX"

DataTableSaver.into_csv(datatable, "people.csv")
Crear una tabla y guardar a JSON
*** Settings ***
Library    Pytabify

*** Test Cases ***
Guardar tabla enriquecida
    ${records}=    Create List
    ...    ${{ {"name": "Alice", "age": 30} }}
    ...    ${{ {"name": "Bob", "age": 25} }}
    ${table}=    Pytabify.Create Data Table From Records    ${records}
    ${table}=    Pytabify.Set Data Table Value    ${table}    0    country    MX
    Pytabify.Save Data Table To Json    ${table}    people.json
  1. Install.
  2. Complete the quick start.
  3. Follow Python or Robot examples.
  4. Consult Python API reference or keyword reference for details.
  5. Read architecture only when maintaining or extending the library.

Format coverage

Format Read Write Practical note
CSV Yes Yes Values are read as text
JSON Yes Yes Preserves supported native types
XLSX Yes Yes Reading requires sheet_name

For round-trips involving int, bool and None, prefer JSON or XLSX. CSV is portable but does not preserve types in the same way.