Generic utility functions for text formatting, string operations, and type conversions.
Project description
dsr-utils
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
pip install dsr-utils
Usage
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dsr_utils-1.0.0.tar.gz.
File metadata
- Download URL: dsr_utils-1.0.0.tar.gz
- Upload date:
- Size: 38.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75d55f2192b835c297ce2e4e6926c36e7d6a21b50327f7e2bc068fe295ae8d05
|
|
| MD5 |
f9f1cc04b5d9cef974ea6de4b4d1a2c6
|
|
| BLAKE2b-256 |
560b331ae60890fede760a983469121eda7dd6651b4d9ce0a3ac1befba362aee
|
Provenance
The following attestation bundles were made for dsr_utils-1.0.0.tar.gz:
Publisher:
python-publish.yml on scottroberts140/dsr-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dsr_utils-1.0.0.tar.gz -
Subject digest:
75d55f2192b835c297ce2e4e6926c36e7d6a21b50327f7e2bc068fe295ae8d05 - Sigstore transparency entry: 929557106
- Sigstore integration time:
-
Permalink:
scottroberts140/dsr-utils@eef575fa22f4e05d12f9703d191fa6c85fdf278e -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/scottroberts140
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@eef575fa22f4e05d12f9703d191fa6c85fdf278e -
Trigger Event:
release
-
Statement type:
File details
Details for the file dsr_utils-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dsr_utils-1.0.0-py3-none-any.whl
- Upload date:
- Size: 33.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d1d7736f160ab7865cb399e63f7ad0c0da84c608e3d14ba35eb42f88c6405a4
|
|
| MD5 |
59591b99cb24145895d4f66ea87f24d4
|
|
| BLAKE2b-256 |
5a594a97171a2ac8c4e16ae5258f96418f2a70a1b09e123fdb48f2e0d6185691
|
Provenance
The following attestation bundles were made for dsr_utils-1.0.0-py3-none-any.whl:
Publisher:
python-publish.yml on scottroberts140/dsr-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dsr_utils-1.0.0-py3-none-any.whl -
Subject digest:
3d1d7736f160ab7865cb399e63f7ad0c0da84c608e3d14ba35eb42f88c6405a4 - Sigstore transparency entry: 929557132
- Sigstore integration time:
-
Permalink:
scottroberts140/dsr-utils@eef575fa22f4e05d12f9703d191fa6c85fdf278e -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/scottroberts140
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@eef575fa22f4e05d12f9703d191fa6c85fdf278e -
Trigger Event:
release
-
Statement type: