Metadata-Version: 2.4
Name: dsr-utils
Version: 1.0.0
Summary: Generic utility functions for text formatting, string operations, and type conversions.
Author-email: Scott Roberts <scottrdeveloper@gmail.com>
License: MIT
Keywords: utilities,formatting,strings,types
Classifier: Development Status :: 3 - Alpha
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
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: pytest-cov>=4.0; extra == "test"
Dynamic: license-file

# dsr-utils

[![PyPI version](https://img.shields.io/pypi/v/dsr-utils.svg)](https://pypi.org/project/dsr-utils/)
[![Python versions](https://img.shields.io/pypi/pyversions/dsr-utils.svg)](https://pypi.org/project/dsr-utils/)
[![License](https://img.shields.io/pypi/l/dsr-utils.svg)](https://pypi.org/project/dsr-utils/)
[![Changelog](https://img.shields.io/badge/changelog-available-blue.svg)](https://github.com/scottroberts140/dsr-utils/releases)

Utility functions and helpers for common data science tasks, including datetime parsing, formatting, tables, and plotting helpers.

**Version 1.0.0**: This release is breaking and not backward-compatible with prior 0.x versions.

## Features

- **Datetime utilities**: Parse and enrich timestamps with pandas integration.
- **Formatting utilities**: Numeric, currency, percentage, and datetime formatters.
- **Table helpers**: Lightweight table definitions and rendering helpers.
- **Matplotlib helpers**: Bounding box utilities for layout and export.
- **String utilities**: Text processing and manipulation helpers.
- **Type utilities**: Lightweight type conversion helpers.

## Installation

```bash
pip install dsr-utils
```

## Usage

```python
from dsr_utils import (
	parse_datetime,
	DateTimeFormat,
	FloatFormat,
	Table,
	TableColumn,
	render_table,
)

# Datetime parsing (pandas integration)
ts = parse_datetime("2025-10-01 12:34:56")

# Formatting utilities
fmt = FloatFormat(precision=2)
print(fmt.format_value(1234.567))

# Date/time formatting
dt_fmt = DateTimeFormat(date_format="%Y-%m-%d", time_format="%H:%M")
print(dt_fmt.format_value(ts))

# Table helpers
table = Table(
	columns=[TableColumn("metric"), TableColumn("value")],
	rows=[{"metric": "rows", "value": 1234}],
)
render_table(table)
```

## Requirements

- Python >= 3.10
- numpy
- pandas (required for datetime utilities)
- matplotlib (required for matplotlib helpers)

## License

MIT License - see LICENSE file for details
