Metadata-Version: 2.4
Name: redis-csv-exporter
Version: 1.0.0
Summary: Export Redis data to CSV format while retaining field data types
Author-email: Elijah Echekwu <smartlearn.stack@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: csv,data,export,migration,redis
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: redis>=5.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# Redis CSV Exporter

Export Redis data to CSV or JSON format while retaining field data types.

## Features

- Export Redis hashes, lists, sets, sorted sets, strings, and streams
- Automatic data type detection (integer, float, boolean, datetime, string)
- Key parsing by delimiter
- Pipeline-based fetching for performance
- CSV or JSON output formats

## Installation

```bash
pip install redis-csv-exporter
```

## Usage

```bash
# Export hashes to CSV
redis-export --host localhost --port 6379 --pattern "policy:*" -o export.csv

# With authentication
redis-export --host redis.example.com --password secret --pattern "user:*" -o users.csv

# Export as JSON
redis-export --pattern "cache:*" --json --pretty -o cache.json

# Export specific data types
redis-export --pattern "data:*" --data-types hash list -o mixed.csv
```

## Options

| Option | Description |
|--------|-------------|
| `--host` | Redis host (default: localhost) |
| `--port` | Redis port (default: 6379) |
| `--password` | Redis password |
| `--db` | Redis database number (default: 0) |
| `--ssl` | Use SSL connection |
| `--pattern` | Key pattern to match (required) |
| `--delimiter` | Key delimiter for parsing (default: `:`) |
| `--data-types` | Redis types to export (default: hash) |
| `--no-metadata` | Exclude TTL and exists columns |
| `--json` | Export as JSON instead of CSV |
| `--pretty` | Pretty-print JSON output |
| `--verbose` | Show debug information |

## Development

```bash
# Clone and install in editable mode
pip install -e ".[dev]"

# Run tests
pytest

# Lint
ruff check src/
```
