Changelog
=========


Version 1.3.4
-------------

Pin sqlalchemy dependency to version ``1.3.*``.

Add explicit ``.alias()`` or ``.as_scalar()`` to implicit subqueries.

Decrease progress logging verbosity.

Add test checksums for Glottolog v4.3-treedb-fixes.

Improve test reporting, update test environment.


Version 1.3.3
-------------

Restrict foreign key pragma and regexp operator to sqlite3 connections.


Version 1.3.2
-------------

Format timespan years with 4 digits.

Refactor recursive tree queries to improve code sharing.

Simplify stats query and ``iterdescendants()`` query.

Stats.ipynb: fix n_descendants query, add count to min/max boxes, plot more
frequency distributions.


Version 1.3.1
-------------

Fix default root (change from . to ./glottolog/ as documented).

Fix ``treedb.write_json_lines()`` under Python 3.6 when passed a file object.

Extend showcase notebook and test coverage.


Version 1.3
-----------

Add ``treedb.write_json_lines()``.

Use ``lang=None`` outside of the database (checksum change).


Version 1.2
-----------

Normalize providers and sites into lookup tables.

Fix exception when config file is not found.

Improve logging: log sqlite3.Connection to identify in-memory databases,
debug log package location.

Improve tests.


Version 1.1
-----------

Fix some aggregation orders in ``get_json_query()`` that depended on the
insertion order.

Fix ```get_query()`` link markup. Use the same aggregation order as
``get_json_query``.

Fixed ``treedb.iterdescendants()`` to include roots with no descencants.

Improve ``treedb.print_languoid_stats()`` performance and the query used for
the ``stats`` view.

Reduce file size adding WITHOUT ROWID to tables with non-integer or composite
primary keys.

Stabilize ``treedb.print_query_sql()`` notebook output with ``flush=True``.

Change __dataset__ and __producer__ primary key from BOOLEAN to INTEGER.

Use ``sqlite.sqlite_version`` instead of querying the engine.


Version 1.0
-----------

Build with Glottolog ``v4.2.1`` per default.

Improve ``treedb.print_schema()`` output for views.

Improve tests and logging.


Version 0.11
------------

Add support for the new optional core `timespan` field.

Add new test flags: --glottolog-repo-root and --force-rebuild.

Extend tests and integrate with Travis and Codevov.


Version 0.10
------------

Insert languoids in ``id`` order if possible.

Gzip dump-like csv files per default (bump csv23 to 0.3+).

Change default name of ``treedb.write_csv`` to ``treedb.query.csv```.

Register ``pandas`` as optional dependency.

Fix xenial compat. Fix Python 3.6 compat.

Fix re-load with ``exclude_raw``.

Improve logging.

Increase test coverage. Log ``sqlite_version()``.


Version 0.9
-----------

Add ``treedb.checkout_or_clone()``.

Add ``treedb.print_query_sql(pretty=True)`` formatting with ``sqlparse`` if
importable (``pip install treedb[pretty]`` to include it).

Improve query readability by adding unique labels.

Move recurse condition for ``Languoid.tree()`` from whereclause to join.

Add tests using ``pytest``.


Version 0.8.2
-------------

Add ``example`` view with ``treedb.get_query()``.

Reorganized `treedb.load()` to better support repeated changes to
`exclude_views`.


Version 0.8.1
-------------

Add ``roots`` (top-level languoids) count to ``treedb.print_languoid_stats()``.

Gzip-compress `treedb.dump_sql()` by default.

Fix reference to old license.

Add ``raw=False`` to ``treedb.write_json_query_csv()``.

Update documentation.


Version 0.8
-----------

Add ``stats`` and ``path_json`` SQL views.

Extend formatting of ``treedb.print_languoid_stats()```and warn in case of
inconsistencies.

Fix ``Languoid.tree(include_self=False)``.

Add names to query aliases for better SQL output.


Version 0.7.1
-------------

Add ``treedb.print_languoid_stats()`` (reproducing
https://glottolog.org/glottolog/glottologinformation).

Add ``treedb.write_json_query_csv()``. To support this,
``treedb.get_json_query()`` now yields pairs of path and languoid json
(instead of json of a two-item array with a path_part array as first element).


Version 0.7
-----------

Add ``treedb.configure()`` trying to read the Glottolog ``repo_root`` from
``treedb.ini`` in the current working directory.

Add ``logging`` config to the development environment as ``treedb.ini``
(write ``treedb.log``).

Added handling of present databases when loading from transient in-memory
database.

Add ``__producer__`` table recording the ``treedb`` package version used.


Version 0.6
-----------

Add ``treedb.checksum()``.


Version 0.5.1
-------------

Add ``replace`` kwarg to ``treedb.write_files()`` and
``treedb.raw.write_files()``.


Version 0.5
-----------

Add ``treeb.write_files()``.

Replace ``treedb.compare_with_raw(root, bind)`` with
``treedb.compare_with_files(bind, root)``.


Version 0.4
-----------

Add ``treedb.print_query_sql()`` for printing standalone SQL with literal
binds that can be pasted into query tools.

Normalize bibitem references (change database structure).


Version 0.3.1
-------------

Add missing ``os.path.expanduser()`` to ``treedb.export()``.

``treedb.pd_read_sql()`` now uses the default query when called without
argument.

Add ``csv23`` as dependency (factored out stream handling).


Version 0.3
-----------

Rename ``treedb.create_engine()`` to ``treedb.set_engine()``
(backwards incompatible).

Improve ``treedb.backup()`` implementation.

Add helper functions and shortcuts.

Refactor ``subprocess`` usage.

Improve logging.


Version 0.2.2
-------------

Add ``treedb.backup()`` (requires Python 3.7+).

Add ``exclude_raw=False`` to ``treedb.export()``.


Version 0.2.1
-------------

Fix ``treedb.write_csv()`` endangerment_source column output.

Use ``os.path.expanduser()`` on filename arguments.

Fix setup.py old license classifier.


Version 0.2
-----------

Drop Python 2 and 3.5 support.

Parse endangerment source references into individual fields.

Switch license to MIT license.


Version 0.1.6
-------------

Make endangerment sources open-ended.


Version 0.1.5
-------------

Update endangerment sources.

Add PyPI ``project_urls`` to setup.py.


Version 0.1.4
-------------

Represent countries as dicts instead of tuples in ``treedb.iterlanguoids()``.

Update endangerment sources.


Version 0.1.3
-------------

Update for new altname providers and endangerment sources in Glottolog 4.1.


Version 0.1.2
-------------

Use ``expanduser()``in ``treedb.create_engine()`` and ``treedb.set_root()``.


Version 0.1.1
-------------

Allow to specify glottolog repository location via ``TREEDB_REPO`` environment
variable (alternative to ``treedb.set_root()``).

Use current working as default Glottolog repository location if ``treedb`` is
imported as plain installed package instead of a git checkout.


Version 0.1
-----------

Initial release.
