Littletable

Latest version: v2.2.5

Safety actively analyzes 630450 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 7

1.0.0

----------------
- Add import directly from an HTTP/HTTPS url.

- Add Table.stats() method to return a table of common statistics for
selected numeric fields.

- Added methods Table.le, Table.lt, Table.ge, Table.gt, Table,ne, and
Table.eq as helpers for calling Table.where:

ret = table.where(lambda rec: rec.x > 100)

can now be written:

ret = table.where(x=Table.gt(100))

- Fixed bug when chaining multiple ".by" accesses:

data = lt.Table()
data.create_index("email", unique=True)
data.create_index("name")
data.create_index("city")
data.create_index("state")

for user in data.by.city['Springfield'].by.state['MO']:
print(user)

would formerly complain that the table has no index 'state'.

- `dir(table.by)` will now include the index names that can be used
as "by" attributes.

- Added unit tests to support using dataclasses as Table contents.

0.13.2

----------------
- Fixed bug when deleting a slice containing None values from a table.
Special thanks to Chat Room 6 on StackOverflow.

- Fixed bug in insert_many when validating unique index keys.

- Fixed bugs in csv_import and tsv_import when named args were not
passed through to the internal csv DictReader.

- Fixed bug in csv_export where blank lines were included in the
exported CSV.

- Added Table.shuffle(), for randomizing the items in a table in place.
Can be useful for some games or simulations, also in internal testing.

- Fixed bug in Table.sort() when sorting on multiple attributes.

0.13.1

---------------
- Modified all Table import methods to directly accept a string containing
the data to be imported. If the input is a multiline string, then it
is assumed to contain the actual data to be imported. If the input is a
string with no newlines, then it is treated as a filename, and the file
is opened for reading. The input can also still be specified as a
file-like object, such as would be the case if reading a file with
an encoding other than the default 'UTF-8'. This capability further
simplifies notebook integration and test and experimentation.

- Renamed format() to formatted_table().

- Introduced new format() method to generate a list of strings, one per
row in the table. format() is called passing a single string as an
argument, to be used as a str.format() template for converting each
row to a string.

0.12.0

---------------
- Modified Table.select() to accept '*' and '-xxx'-style names, to
indicate '*' as 'all fields', and '-xxx' as "not including xxx". This
simplifies selecting "all fields except xxx".

- PivotTable.summary_counts() is renamed to as_table(). summary_counts()
is deprecated and will be dropped in a future release.

- Added Table.as_html() and PivotTable.as_table().as_html() methods
to support integration with Jupyter Notebook. Also included sample ipynb
file. as_html() takes a list of fields to be included in the table,
following the same syntax as Table.select(). This API is still
experimental, and may change before 1.0.0 release.

- Added Table.all.xxx attribute accessor, to yield out all the values of a
particular attribute in the table as a sequence.

- Added FixedWidthReader class to simplify import of data from files with
fixed width columns. See examples in HowToUseLittleTable.txt.

- Fixed bug where dict.iteritems() was used in some cases, all
now converted to using items().

- Updated xxx_import methods to return self, so that tables can be
declared and loaded in a single statement:

data_table = Table().csv_import('data_file.csv')

- Added optional row_class argument argument to all xxx_import methods
to designate a user class to use when constructing the rows to be imported
to the table. The default is DataObject, but any class that supports
`Class(**attributes)` construction (including namedtuples and
SimpleNamespace) can be given. If the desired class does not support
this kind of initialization, a factory method can be given instead.

- Deleted deprecated Table.run() and Table.addfield methods. run()
did nothing more than return self; addfield has been replaced by
add_field.

- Also deleted deprecated attribute access to table indexes. Indexed
access is now done as:

employee = emp_data.by.emp_id['12345']
qa_dept_employees = emp_data.by.department_name['QA']

0.11

--------------
- Performance enhancement in insert(), also speeds up pivot() and other
related methods.

- Fixed bug in fetching keys if keys evaluate to a falsey value (such as 0).
Would also manifest as omitting columns from pivot tables for falsey
key values.

0.10

-------------
- Deprecated access to indexed fields using '<tablename>.<fieldname>', as
this obscures the fact that the fields are attributes of the table's objects,
not of the table itself. Instead, index access will be done using the 'by'
index accessor, introduced in version 0.6 (see comments below in notes
for release 0.9). Indexes-as-table-attributes will be completely removed
in release 1.0.

- Deprecated Table.run(). Will be removed in release 1.0.

- Added Table.info() method, to give summary information about a table's
name, columns, indexes, size, etc.

- Extended interface to Table.csv_import, to accept passthru of
additional named arguments (such as 'delimiter' or 'fieldnames') to the
DictReader constructor used to read the import data.

- Extended interface to Table.csv_export and json_export, to support
addition of 'encoding' argument (default='UTF-8') for the output file.
(Python 3 only)

- Added set item support to DataObject, to support "obj['a'] = 100" style
assignments. Note that DataObjects are only semi-mutable: a given key or
attribute can only be assigned once, not overwritten.

- Added more list-like access to Table, including del table[index],
del table[start:end:step] and pop().

- Added 'key' argument to Table.unique, to support passing a callable to
unique for special cases for defining what makes an object 'unique'.
Default is the prior behavior, which is a tuple of all of the values of
the object.

- Added exceptions to DataObject when attempting to modify an existing
attribute. New attributes are still supported, but existing attributes
cannot be overwritten. (Applies to both attribute and indexed assignments.)
Formerly, these assignments would simply fail silently.

- Using OrderedDict when supported, to preserve field order in JSON output.

- Miscellaneous documentation cleanup.

Page 5 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.