Metadata-Version: 2.4
Name: dtypeflow
Version: 1.2.0
Summary: Terminal UI to infer CSV column dtypes and convert CSV to Parquet, locally.
Keywords: csv,parquet,dtype,tui,textual,arrow
Author: Pedro José Mora Gallegos
Author-email: Pedro José Mora Gallegos <developmentbypedrojose@outlook.de>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Utilities
Classifier: Topic :: Scientific/Engineering
Requires-Dist: pyarrow>=17.0.0
Requires-Dist: textual>=0.89.0
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/pedrojosemoragallegos/dtypeflow
Project-URL: Repository, https://github.com/pedrojosemoragallegos/dtypeflow
Project-URL: Issues, https://github.com/pedrojosemoragallegos/dtypeflow/issues
Description-Content-Type: text/markdown

# dtypeflow

[![PyPI version](https://img.shields.io/pypi/v/dtypeflow)](https://pypi.org/project/dtypeflow/)
[![Python Versions](https://img.shields.io/pypi/pyversions/dtypeflow)](https://pypi.org/project/dtypeflow/)
[![Downloads](https://pepy.tech/badge/dtypeflow)](https://pepy.tech/project/dtypeflow)
[![Wheel](https://img.shields.io/pypi/wheel/dtypeflow)](https://pypi.org/project/dtypeflow/)

`dtypeflow` is a terminal UI to convert a CSV file to Parquet.

Point it at a CSV file, and for each column it infers the tightest-fitting
dtype (`Boolean`, unsigned/signed integers `UInt8`…`UInt64`/`Int8`…`Int64`,
floats `Float16`/`Float32`/`Float64`, `String`, or `Dictionary`), shows the
observed statistics, and lets you review or override the choice before
writing the result to Parquet — all locally, no data leaves your machine.

## Installation

```bash
uv tool install dtypeflow
```

Or with `pipx`:

```bash
pipx install dtypeflow
```

Or with `pip`:

```bash
pip install dtypeflow
```

## Usage

```bash
dtypeflow
```

The workflow has three steps:

1. **Pick a file** — enter or browse for a CSV path and choose the delimiter
   (Comma by default; Auto detects it from the first 64 KiB).
2. **Configure types** — for each column, review the recommended dtype, its
   stats (unique values, samples, range/precision/scale), and pick from
   compatible alternatives grouped by safety (Safe / Too small / Discouraged).
3. **Export** — write the configured dataset to a Parquet file.

### Screenshots

Alternatives for a column are grouped by how safe they are to apply:

<table>
<tr>
<td align="center"><b>Safe</b></td>
<td align="center"><b>Too small</b></td>
<td align="center"><b>Discouraged</b></td>
</tr>
<tr>
<td><img src="screenshots/26_warehouse_stock_safe.svg" alt="Safe dtype options for warehouse_stock" width="280"></td>
<td><img src="screenshots/26_warehouse_stock_too_small.svg" alt="Too small dtype options for warehouse_stock" width="280"></td>
<td><img src="screenshots/26_warehouse_stock_discouraged.svg" alt="Discouraged dtype options for warehouse_stock" width="280"></td>
</tr>
</table>

## Development

This project uses [uv](https://docs.astral.sh/uv/) for dependency management.

```bash
uv sync
uv run dtypeflow
```

Lint:

```bash
uv run --with ruff ruff check src/
```

## License

[MIT](LICENSE)
