mds-csv-reader
Read a csv-file, converts to list of dictionaries.
Install
pip install mds-csv-reader
Howto
Syntax
import_csv_file(
csvfile, # file or string
firstline=True, # first line contains column names
decimalremove=['€', 'EUR', '.'], # remove these strings from decimal columns
ignline=[1, 2, ...], # skip these lines
ignore_leer=['<column nam>',...], # ignore empty values in these columns
encod='utf-8', # encoding if 'csvfile' is byte type
)
Column names
column names must contain field type info
allowed types: C, D, DT, T, N, L
Example
- NAME1,C
type String
- CREATEDATE,D,%Y-%m-%d
type Date, detection tries defined format
- CREATEDATE,D
type Date, detection tries predefines formats
- DATETIME,DT,%Y-%m-%d %H:%M
type DateTime, detection tries defined format
- DATETIME,DT
type DateTime, detection tries predefines formats
- CREATETIME,T,%H:%M
type Time, detection tries defined format
- CREATETIME,T
type Time, detection tries predefines formats
- NUMSTEP,N,10,0
type Numeric (no decimals) –> Integer
- AMOUNT,N,16,2
type Numeric (two decimals) –> Decimal
- ISENABLED,L
Boolean (allowed: true, false, t, f, wahr, falsch, 1, 0)
- default-type: String
if convert to requested type fails
Changes
1.0.5 - 28.07.2023
code optimized
1.0.4 - 09.01.2020
fix: detection of boolean, import of csv-text-data
1.0.2 - 20.12.2019
exteded detection of date and time formats
1.0.0 - 17.12.2019
optimized detection of formatting in csv-file
1.0.0 - 17.12.2019
first public version
Release files for mds-csv-reader 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mds_csv_reader-1.0.5.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mds_csv_reader-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.3 kB
Release files / mds_csv_reader-1.0.5.tar.gz
| Download URL | mds_csv_reader-1.0.5.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f622e7a8335ece3e93e4fb9d0019bb41c274f2fe90d96b143b4bd763e9a265b3
|
|
BLAKE2b-256 checksum How to use checksums |
4561be55b55321ddfd97e542d4d887c72aace938d0813d385f3d4d1c02a05b72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / mds_csv_reader-1.0.5-py3-none-any.whl
| Download URL | mds_csv_reader-1.0.5-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d225304a8c7e63c065194294a26a681b0eb6fedd6fc5ced55cec362e59b6ce8b
|
|
BLAKE2b-256 checksum How to use checksums |
25f83c327ce2f6f97801e32c3d30eb099c44537fc8a9f2e5cd44b620d314ec6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|