Agate

Latest version: v1.10.2

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

Scan your dependencies

Page 4 of 7

1.4.0

--------------------

This release adds several new features, fixes numerous small bug-fixes, and improves performance for common use cases. There are some minor breaking changes, but few user are likely to encounter them. The most important changes in this release are:

1. There is now a :meth:`.TableSet.having` method, which behaves similarly to SQL's ``HAVING`` keyword.

2. :meth:`.Table.from_csv` is much faster. In particular, the type inference routines for parsing numbers have been optimized.

3. The :meth:`.Table.compute` method now accepts a ``replace`` keyword which allows new columns to replace existing columns "in place."" (As with all agate operations, a new table is still created.)

4. There is now a :class:`.Slug` computation which can be used to compute a column of slugs. The :meth:`.Table.rename` method has also added new options for slugifying column and row names.

The complete list of changes is as follows:

* Added a deprecation warning for ``patch`` methods. New extensions should not use it. (594)
* Added :class:`.Slug` computation (466)
* Added ``slug_columns`` and ``slug_rows`` arguments to :meth:`Table.rename`. (466)
* Added :meth:`.utils.slugify` to standardize a sequence of strings. (466)
* :meth:`.Table.__init__` now prints row and column on ``CastError``. (593)
* Fix null sorting in :meth:`.Table.order_by` when ordering by multiple columns. (607)
* Implemented configuration system.
* Fixed bug in :meth:`.Table.print_bars` when ``value_column`` contains ``None`` (608)
* :meth:`.Table.print_table` now restricts header on max_column_width. (605)
* Cookbook: filling gaps in a dataset with Table.homogenize. (538)
* Reduced memory usage and improved performance of :meth:`.Table.from_csv`.
* :meth:`.Table.from_csv` no longer accepts a sequence of row ids for :code:`skip_lines`.
* :meth:`.Number.cast` is now three times as fast.
* :class:`.Number` now accepts :code:`group_symbol`, :code:`decimal_symbol` and :code:`currency_symbols` arguments. (224)
* Tutorial: clean up state data under computing columns (570)
* :meth:`.Table.__init__` now explicitly checks that ``row_names`` are not ints. (322)
* Cookbook: CPI deflation, agate-lookup. (559)
* :meth:`.Table.bins` now includes values outside ``start`` or ``end`` in computed ``column_names``. (596)
* Fixed bug in :meth:`.Table.bins` where ``start`` or ``end`` arguments were ignored when specified alone. (599)
* :meth:`.Table.compute` now accepts a :code:`replace` argument that allows columns to be overwritten. (597)
* :meth:`.Table.from_fixed` now creates an agate table from a fixed-width file. (358)
* :mod:`.fixed` now implements a general-purpose fixed-width file reader. (358)
* :class:`TypeTester` now correctly parses negative currency values as Number. (595)
* Cookbook: removing a column (`select` and `exclude`). (592)
* Cookbook: overriding specific column types. (591)
* :class:`.TableSet` now has a :meth:`.TableSet._fork` method used internally for deriving new tables.
* Added an example of SQL's :code:`HAVING` to the cookbook.
* :meth:`.Table.aggregate` interface has been revised to be more similar to :meth:`.TableSet.aggregate`.
* :meth:`.TableSet.having` is now implemented. (587)
* There is now a better error when a forced column name does not exist. (591)
* Arguments to :meth:`.Table.print_html` now mirror :meth:`.Table.print_table`.

1.3.1

----------------------

The major feature of this release is new API documentation. Several minor features and bug fixes are also included. There are no major breaking changes in this release.

Internally, the agate codebase has been reorganized to be more modular, but this should be invisible to most users.

* The :class:`.MaxLength` aggregation now returns a `Decimal` object. (574)
* Fixed an edge case where datetimes were parsed as dates. (568)
* Fixed column alignment in tutorial tables. (572)
* :meth:`.Table.print_table` now defaults to printing ``20`` rows and ``6`` columns. (589)
* Added Eli Murray to AUTHORS.
* :meth:`.Table.__init__` now accepts a dict to specify partial column types. (580)
* :meth:`.Table.from_csv` now accepts a ``skip_lines`` argument. (581)
* Moved every :class:`.Aggregation` and :class:`.Computation` into their own modules. (565)
* :class:`.Column` and :class:`.Row` are now importable from `agate`.
* Completely reorgnized the API documentation.
* Moved unit tests into modules to match new code organization.
* Moved major :class:`.Table` and :class:`.TableSet` methods into their own modules.
* Fixed bug when using non-unicode encodings with :meth:`.Table.from_csv`. (560)
* :meth:`.Table.homogenize` now accepts an array of values as compare values if key is a single column name. (539)

1.3.0

-------------------------

This version implements several new features and includes two major breaking changes.

Please take note of the following breaking changes:

1. There is no longer a :code:`Length` aggregation. The more obvious :class:`.Count` is now used instead.

2. Agate's replacements for Python's CSV reader and writer have been moved to the :code:`agate.csv` namespace. To use as a drop-in replacement: :code:`from agate import csv`.

The major new features in this release are primarly related to transforming (reshaping) tables. They are:

1. :meth:`.Table.normalize` for converting columns to rows.
2. :meth:`.Table.denormalize` for converting rows to columns.
3. :meth:`.Table.pivot` for generating "crosstabs".
4. :meth:`.Table.homogenize` for filling gaps in data series.

Please see the following complete list of changes for a variety of other bug fixes and improvements.

* Moved CSV reader/writer to :code:`agate.csv` namespace.
* Added numerous new examples to the R section of the cookbook. (529-535)
* Updated Excel cookbook entry for pivot tables. (536)
* Updated Excel cookbook entry for VLOOKUP. (537)
* Fix number rendering in :meth:`.Table.print_table` on Windows. (528)
* Added cookbook examples of using :meth:`.Table.pivot` to count frequency/distribution.
* :meth:`.Table.bins` now has smarter output column names. (524)
* :meth:`.Table.bins` is now a wrapper around pivot. (522)
* :meth:`.Table.counts` has been removed. Use :meth:`.Table.pivot` instead. (508)
* :class:`.Count` can now count non-null values in a column.
* Removed :class:`.Length`. :class:`.Count` now works without any arguments. (520)
* :meth:`.Table.pivot` implemented. (495)
* :meth:`.Table.denormalize` implemented. (493)
* Added ``columns`` argument to :meth:`Table.join`. (479)
* Cookbook: Custom statistics/agate.Summary
* Added Kevin Schaul to AUTHORS.
* :meth:`Quantiles.locate` now correctly returns `Decimal` instances. (509)
* Cookbook: Filter for distinct values of a column (498)
* Added :meth:`.Column.values_distinct()` (498)
* Cookbook: Fuzzy phonetic search example. (207)
* Cookbook: Create a table from a remote file. (473)
* Added ``printable`` argument to :meth:`.Table.print_bars` to use only printable characters. (500)
* :class:`.MappedSequence` now throws an explicit error on __setitem__. (499)
* Added ``require_match`` argument to :meth:`.Table.join`. (480)
* Cookbook: Rename columns in a table. (469)
* :meth:`.Table.normalize` implemented. (487)
* Added :class:`.Percent` computation with example in Cookbook. (490)
* Added Ben Welsh to AUTHORS.
* :meth:`.Table.__init__` now throws a warning if auto-generated columns are used. (483)
* :meth:`.Table.__init__` no longer fails on duplicate columns. Instead it renames them and throws a warning. (484)
* :meth:`.Table.merge` now takes a ``column_names`` argument to specify columns included in new table. (481)
* :meth:`.Table.select` now accepts a single column name as a key.
* :meth:`.Table.exclude` now accepts a single column name as a key.
* Added :meth:`.Table.homogenize` to find gaps in a table and fill them with default rows. (407)
* :meth:`.Table.distinct` now accepts sequences of column names as a key.
* :meth:`.Table.join` now accepts sequences of column names as either a left or right key. (475)
* :meth:`.Table.order_by` now accepts a sequence of column names as a key.
* :meth:`.Table.distinct` now accepts a sequence of column names as a key.
* :meth:`.Table.join` now accepts a sequence of column names as either a left or right key. (475)
* Cookbook: Create a table from a DBF file. (472)
* Cookbook: Create a table from an Excel spreadsheet.
* Added explicit error if a filename is passed to the :class:`.Table` constructor. (438)

1.2.2

------------------------

This release adds several minor features. The only breaking change is that default column names will now be lowercase instead of uppercase. If you depended on these names in your scripts you will need to update them accordingly.

* :class:`.TypeTester` no longer takes a ``locale`` argument. Use ``types`` instead.
* :class:`.TypeTester` now takes a ``types`` argument that is a list of possible types to test. (461)
* Null conversion can now be disabled for :class:`.Text` by passing ``cast_nulls=False``. (460)
* Default column names are now lowercase letters instead of uppercase. (464)
* :meth:`.Table.merge` can now merge tables with different columns or columns in a different order. (465)
* :meth:`.MappedSequence.get` will no longer raise ``KeyError`` if a default is not provided. (467)
* :class:`.Number` can now test/cast the ``long`` type on Python 2.

1.2.1

------------------------

This release implements several new features and bug fixes. There are no significant breaking changes.

Special thanks to `Neil Bedi <https://github.com/nbedi>`_ for his extensive contributions to this release.

* Added a ``max_column_width`` argument to :meth:`.Table.print_table`. Defaults to ``20``. (442)
* :meth:`.Table.from_json` now defers most functionality to :meth:`.Table.from_object`.
* Implemented :meth:`.Table.from_object` for parsing JSON-like Python objects.
* Fixed a bug that prevented :meth:`.Table.order_by` on empty table. (454)
* :meth:`.Table.from_json` and :meth:`TableSet.from_json` now have ``column_types`` as an optional argument. (451)
* :class:`.csv.Reader` now has ``line_numbers`` and ``header`` options to add column for line numbers (447)
* Renamed ``maxfieldsize`` to ``field_size_limit`` in :class:`.csv.Reader` for consistency (447)
* :meth:`.Table.from_csv` now has a ``sniff_limit`` option to use :class:`.csv.Sniffer` (444)
* :class:`.csv.Sniffer` implemented. (444)
* :meth:`.Table.__init__` no longer fails on empty rows. (445)
* :meth:`.TableSet.from_json` implemented. (373)
* Fixed a bug that breaks :meth:`TypeTester.run` on variable row length. (440)
* Added :meth:`.TableSet.__str__` to display :class:`.Table` keys and row counts. (418)
* Fixed a bug that incorrectly checked for column_types equivalence in :meth:`.Table.merge` and :meth:`.TableSet.__init__`. (435)
* :meth:`.TableSet.merge` now has the ability to specify grouping factors with ``group``, ``group_name`` and ``group_type``. (406)
* :class:`.Table` can now be constructed with ``None`` for some column names. Those columns will receive letter names. (432)
* Slightly changed the parsing of dates and datetimes from strings.
* Numbers are now written to CSV without extra zeros after the decimal point. (429)
* Made it possible for ``datetime.date`` instances to be considered valid :class:`.DateTime` inputs. (427)
* Changed preference order in type testing so :class:`.Date` is preferred to :class:`.DateTime`.
* Removed ``float_precision`` argument from :class:`.Number`. (428)
* :class:`.AgateTestCase` is now available as ``agate.AgateTestCase``. (426)
* :meth:`.TableSet.to_json` now has an ``indent`` option for use with ``nested``.
* :meth:`.TableSet.to_json` now has a ``nested`` option for writing a single, nested JSON file. (417)
* :meth:`.TestCase.assertRowNames` and :meth:`.TestCase.assertColumnNames` now validate the row and column instance keys.
* Fixed a bug that prevented :meth:`.Table.rename` from renaming column names in :class:`.Row` instances. (423)

1.2.0

------------------------

This version introduces one breaking change, which is only relevant if you are using custom :class:`.Computation` subclasses.

1. :class:`.Computation` has been modified so that :meth:`.Computation.run` takes a :class:`.Table` instance as its argument, rather than a single row. It must return a sequence of values to use for a new column. In addition, the :meth:`.Computation._prepare` method has been renamed to :meth:`.Computation.validate` to more accurately describe it's function. These changes were made to facilitate computing moving averages, streaks and other values that require data for the full column.

* Existing :class:`.Aggregation` subclasses have been updated to use :meth:`.Aggregate.validate`. (This brings a noticeable performance boost.)
* :class:`.Aggregation` now has a :meth:`.Aggregation.validate` method that functions identically to :meth:`.Computation.validate`. (421)
* :meth:`.Change.validate` now correctly raises :class:`.DataTypeError`.
* Added a ``SimpleMovingAverage`` implementation to the cookbook's examples of custom :class:`.Computation` classes.
* :meth:`.Computation._prepare` has been renamed to :meth:`.Computation.validate`.
* :meth:`.Computation.run` now takes a :class:`.Table` instance as an argument. (415)
* Fix a bug in Python 2 where printing a table could raise ``decimal.InvalidOperation``. (412)
* Fix :class:`.Rank` so it returns Decimal. (411)
* Added Taurus Olson to AUTHORS.
* Printing a table will now print the table's structure.
* :meth:`.Table.print_structure` implemented. (393)
* Added Geoffrey Hing to AUTHORS.
* :meth:`.Table.print_html` implemented. (408)
* Instances of :class:`.Date` and :class:`.DateTime` can now be pickled. (362)
* :class:`.AgateTestCase` is available as ``agate.testcase.AgateTestCase`` for extensions to use. (384)
* :meth:`.Table.exclude` implemented. Opposite of :meth:`.Table.select`. (388)
* :meth:`.Table.merge` now accepts a ``row_names`` argument. (403)
* :class:`.Formula` now automatically casts computed values to specified data type unless ``cast`` is set to ``False``. (398)
* Added Neil Bedi to AUTHORS.
* :meth:`.Table.rename` is implemented. (389)
* :meth:`.TableSet.to_json` is implemented. (374)
* :meth:`.Table.to_csv` and :meth:`.Table.to_json` will now create the target directory if it does not exist. (392)
* :class:`.Boolean` will now correctly cast numerical ``0`` and ``1``. (386)
* :meth:`.Table.merge` now consistently maps column names to rows. (402)

Page 4 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.