Skip to content

Commit

Permalink
tSQLike-1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mezantrop committed Oct 15, 2024
1 parent acd756d commit f989cb5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

* **2024.10.15 tSQLike-1.1.6**
* Make `Table` object `iterable`, `iterate_header` boolean controlls whether header to be included or not

* **2024.09.26 tSQLike-1.1.5.2**
* `force=False/True` argument of `make_shortnames()`/`set_shortnames()` to wipe Dot-prefix with force
* `set_shortnames()` - Remove Dot-prefix of the columns from self/Table header (changes Table object)
Expand Down
2 changes: 1 addition & 1 deletion tsqlike/__about__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" Version number in a single place """

__version__ = "1.1.5.2"
__version__ = "1.1.6"
11 changes: 11 additions & 0 deletions tsqlike/tsqlike.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def __init__(self, data=None, name=None, **kwargs):
# to allow select() using custom defined functions
self.globals = kwargs.get('globals', {})
self.use_shortnames = kwargs.get('use_shortnames', False)
self.iterate_header = kwargs.get('iterate_header', False)

if not data:
self.table = []
Expand Down Expand Up @@ -299,6 +300,16 @@ def __init__(self, data=None, name=None, **kwargs):
self.export_thashes = self.export_list_dicts
self.export_htables = self.export_dict_lists

# -------------------------------------------------------------------------------------------- #
def __iter__(self):
if self.iterate_header:
yield self.header if not self.use_shortnames else self.make_shortnames()

r = 0
while r < self.rows:
yield self.table[r]
r += 1

# -------------------------------------------------------------------------------------------- #
def __repr__(self):
return str(self.table)
Expand Down

0 comments on commit f989cb5

Please sign in to comment.