Skip to main content

A utility library for working with DSV (Delimited String Values) files

Project description

splurge-safe-io

PyPI version Python versions License: MIT

CI Coverage Ruff mypy

A small, secure, and deterministic text file I/O helper library.

Key features

  • Deterministic newline normalization (LF) for text reads/writes.
  • Secure path validation utilities to avoid traversal and dangerous characters.
  • Streaming reader with incremental decoding and a safe fallback for tricky encodings.
  • Clear, small exception hierarchy for stable error handling.

Quick start

from splurge_safe_io.safe_text_file_reader import SafeTextFileReader
from splurge_safe_io.safe_text_file_writer import open_safe_text_writer

# Read lines
reader = SafeTextFileReader('data.csv')
rows = reader.read()

# Write via context manager
with open_safe_text_writer('out.txt') as buf:
    buf.write('\n'.join(['one','two','three']))

See docs/README-DETAILS.md for a complete guide and usage examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

splurge_safe_io-2025.0.3.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

splurge_safe_io-2025.0.3-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file splurge_safe_io-2025.0.3.tar.gz.

File metadata

  • Download URL: splurge_safe_io-2025.0.3.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for splurge_safe_io-2025.0.3.tar.gz
Algorithm Hash digest
SHA256 3085c526d355da1cbd9b02086eb7f4bbe739ef3e9754c18271c897152eab1694
MD5 0602867fccca485fb9105ecfa1b9582a
BLAKE2b-256 749165557e0bf3f9db0a6af73907219427d23af345ee776990ee27a6836f3628

See more details on using hashes here.

File details

Details for the file splurge_safe_io-2025.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for splurge_safe_io-2025.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f8304119532e6b75fa78edf64a0471fc4b612cb415ef2991077e9b0789647e7c
MD5 13a31b6ebea72b9da51394040c4d8e8f
BLAKE2b-256 35fa852a09cf0c4a6ec50a4bcc6ff650b8cadc551c61f509b9727c2cf393619b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page