Metadata-Version: 2.4
Name: table-to-image
Version: 0.1.0
Summary: Convert markdown tables to PNG images
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.0.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: typer>=0.9.0
Dynamic: license-file

# table-to-image

Convert pandas DataFrame tables to PNG images.

## Installation

```bash
pip install table-to-image
```

## Usage

### As a Python Library

```python
import pandas as pd
from table_to_image import render

# Create a DataFrame
df = pd.DataFrame({
    'Name': ['Alice', 'Bob', 'Charlie'],
    'Age': [25, 30, 35],
    'City': ['NYC', 'LA', 'Chicago']
})

# Convert to image
render(df, 'output.png')

# With custom options
render(df, 'output.png', font_size=16, header_bg_color=(255, 0, 0))
```

### Using the Class

```python
import pandas as pd
from table_to_image import DataFrameToImage

df = pd.DataFrame({'A': [1, 2], 'B': ['x', 'y']})

converter = DataFrameToImage(font_size=18, header_bg_color=(0, 128, 0))
converter.convert(df, 'table.png')
```

### CLI

```bash
# Convert CSV to PNG
table-to-image input.csv output.png

# Convert with custom font size
table-to-image input.csv output.png --size 20

# Convert Excel file
table-to-image data.xlsx output.png
```

## Options

| Option | Description | Default |
|--------|-------------|---------|
| `font_size` | Font size for text | 14 |
| `header_bg_color` | Header background color (RGB tuple) | (70, 130, 180) |
| `header_text_color` | Header text color (RGB tuple) | (255, 255, 255) |
| `cell_bg_color` | Cell background color (RGB tuple) | (255, 255, 255) |
| `cell_text_color` | Cell text color (RGB tuple) | (0, 0, 0) |
| `margin` | Margin around the table | 10 |

## License

MIT
