From ca83993a1ebd5d4a7829d8b92b7f44851ec4c0d1 Mon Sep 17 00:00:00 2001 From: Mikhail Zakharov Date: Tue, 2 Jul 2024 19:36:26 +0200 Subject: [PATCH] Make linter happy --- CHANGELOG.md | 2 +- README.md | 18 +++++++++--------- tsqlike/tsqlike.py | 3 ++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9881c75..ecb9d11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # CHANGELOG * **2024.07.02 tSQLike-1.1.0** - * Import methods use `detect_types` to detect if autoconversion from `str` to `int`, `float` and `bool` is needed + * Import methods use `detect_types` to detect if auto-conversion from `str` to `int`, `float` and `bool` is needed * **2024.06.28 tSQLike-1.0.4** * `select_lt()` respects empty arguments diff --git a/README.md b/README.md index f6bb27f..42184aa 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ## Description -**tSQLike** is a Python3 module that is written with a hope to make tabular data process easier using SQL-like primitives. +**tSQLike** is a `Python3` module that is written with a hope to make tabular data process easier using SQL-like primitives. ## Usage @@ -100,14 +100,14 @@ Controls what arguments are available to `eval()` function ### Standalone functions -| Name | Status | Description | -|--------------|---------|----------------------------------------------------------| -| `open_file` | ☑ | Open a file | -| `close_file` | ☑ | Close a file | -| `read_json` | ☑ | Read `JSON` file | -| `read_csv` | ☑ | Read `CSV` file | -| `read_xml` | ☐ | Read `XML`. NB: Do we need XML support? | -| `to_type` | ☑ | Convert a string to a proper type: int, float or boolean | +| Name | Status | Description | +|--------------|---------|------------------------------------------------------------| +| `open_file` | ☑ | Open a file | +| `close_file` | ☑ | Close a file | +| `read_json` | ☑ | Read `JSON` file | +| `read_csv` | ☑ | Read `CSV` file | +| `read_xml` | ☐ | Read `XML`. NB: Do we need XML support? | +| `to_type` | ☑ | Convert a `str` to a proper type: `int`, `float` or `bool` | #### WARNING diff --git a/tsqlike/tsqlike.py b/tsqlike/tsqlike.py index ec47332..62bc420 100644 --- a/tsqlike/tsqlike.py +++ b/tsqlike/tsqlike.py @@ -277,7 +277,8 @@ def import_list_dicts(self, data, name=None, detect_types=False): self.header = [self.name + TNAME_COLUMN_DELIMITER + str(f) if TNAME_COLUMN_DELIMITER not in str(f) else f for f in (data[0].keys())] - self.table = [list(r.values()) for r in data] if not detect_types else [[to_type(v) for v in r.values()] for r in data] + self.table = [list(r.values()) for r in data] if not detect_types else [ + [to_type(v) for v in r.values()] for r in data] else: raise ValueError('FATAL@Table.import_list_dicts: Unexpected data format')