SSV Format (Semicolon-Separated Values)
Description
SSV (Semicolon-Separated Values) is a variant of CSV where fields are separated by semicolons (;). It's commonly used in European locales where comma is used as decimal separator. SSV extends the CSV implementation with a fixed semicolon delimiter.
File Extensions
.ssv- Semicolon-separated values files
Implementation Details
Reading
The SSV implementation:
- Extends CSV implementation
- Uses semicolon (
;) as delimiter - Supports all CSV features (encoding detection, quote handling)
- Converts each row to a dictionary
Writing
Writing support:
- Uses semicolon delimiter
- Supports all CSV writing features
- Requires field names specification
Key Features
- Semicolon delimiter: Fixed semicolon character separator
- CSV compatibility: Inherits all CSV features
- Encoding support: Automatic encoding detection
- Quote handling: Properly handles quoted fields
- Totals support: Can count total rows
Usage
from iterable import open_iterable
# Basic reading
source = open_iterable('data.ssv')
for row in source:
print(row)
source.close()
# Writing
dest = open_iterable('output.ssv', mode='w', iterableargs={
'keys': ['id', 'name', 'value']
})
dest.write({'id': '1', 'name': 'John', 'value': 'test'})
dest.close()
Parameters
keys(list[str]): Column names (required for writing)encoding(str): File encoding (default: auto-detected)quotechar(str): Quote character (default:")
Limitations
- Flat data only: Only supports tabular data
- Schema required for writing: Must specify field names
- No type preservation: All values are strings
- Semicolon in data: If data contains semicolons, they must be quoted
Compression Support
SSV files can be compressed with all supported codecs:
- GZip (
.ssv.gz) - BZip2 (
.ssv.bz2) - LZMA (
.ssv.xz) - LZ4 (
.ssv.lz4) - ZIP (
.ssv.zip) - Brotli (
.ssv.br) - ZStandard (
.ssv.zst)
Use Cases
- European locales: When comma is used as decimal separator
- Excel exports: Some Excel exports use semicolon delimiter
- Regional formats: Common in European data formats