# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['unihan_db']

package_data = \
{'': ['*']}

install_requires = \
['SQLAlchemy', 'appdirs', 'unihan-etl>=0.11.0,<0.12.0']

setup_kwargs = {
    'name': 'unihan-db',
    'version': '0.2.0',
    'description': 'SQLAlchemy models for UNIHAN database',
    'long_description': '*unihan-db* - database `SQLAlchemy`_ models for `UNIHAN`_. Part of the `cihai`_\nproject. Powered by `unihan-etl`_. See also: `libUnihan`_.\n\n|pypi| |docs| |build-status| |coverage| |license|\n\nBy default, unihan-db creates a SQLite database in an `XDG data directory`_.\nYou can specify a custom database destination by passing a database url\ninto `get_session`_.\n\n.. _SQLAlchemy: https://www.sqlalchemy.org/\n.. _get_session: http://unihan-db.git-pull.com/en/latest/api.html#unihan_db.bootstrap.get_session\n.. _XDG data directory: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html\n\nExample usage\n-------------\n.. code-block:: python\n\n   #!/usr/bin/env python\n   import pprint\n\n   from sqlalchemy.sql.expression import func\n\n   from unihan_db import bootstrap\n   from unihan_db.tables import Unhn\n\n   session = bootstrap.get_session()\n\n   bootstrap.bootstrap_unihan(session)\n\n   random_row = session.query(Unhn).order_by(\n       func.random()\n   ).limit(1).first()\n\n   pp = pprint.PrettyPrinter(indent=0)\n\n   pp.pprint(random_row.to_dict())\n\nRun::\n\n   $ ./examples/01_bootstrap.py\n\nOutput:\n\n.. code-block:: python\n\n   {\'char\': \'鎷\',\n   \'kCantonese\': [{\'char_id\': \'鎷\', \'definition\': \'maa5\', \'id\': 24035}],\n   \'kDefinition\': [],\n   \'kHanYu\': [{\'char_id\': \'鎷\',\n             \'id\': 24014,\n             \'locations\': [{\'character\': 5,\n                          \'generic_indice_id\': 24014,\n                          \'generic_reading_id\': None,\n                          \'id\': 42170,\n                          \'page\': 4237,\n                          \'virtual\': 0,\n                          \'volume\': 6}],\n             \'type\': \'kHanYu\'}],\n   \'kHanyuPinyin\': [{\'char_id\': \'鎷\',\n                   \'id\': 18090,\n                   \'locations\': [{\'character\': 5,\n                                \'generic_indice_id\': None,\n                                \'generic_reading_id\': 18090,\n                                \'id\': 42169,\n                                \'page\': 4237,\n                                \'virtual\': 0,\n                                \'volume\': 6}],\n                   \'readings\': [{\'generic_reading_id\': 18090,\n                               \'id\': 26695,\n                               \'reading\': \'mǎ\'}],\n                   \'type\': \'kHanyuPinyin\'}],\n   \'kMandarin\': [{\'char_id\': \'鎷\', \'hans\': \'mǎ\', \'hant\': \'mǎ\', \'id\': 23486}],\n   \'ucn\': \'U+93B7\'}\n\nDeveloping\n----------\n`poetry`_ is a required package to develop.\n\n``git clone https://github.com/cihai/unihan-etl.git``\n\n``cd unihan-etl``\n\n``poetry install -E "docs test coverage lint format"``\n\nMakefile commands prefixed with ``watch_`` will watch files and rerun.\n\nTests\n"""""\n\n``poetry run py.test``\n\nHelpers: ``make test``\nRerun tests on file change: ``make watch_test`` (requires `entr(1)`_)\n\nDocumentation\n"""""""""""""\nDefault preview server: http://localhost:8041\n\n``cd docs/`` and ``make html`` to build. ``make serve`` to start http server.\n\nHelpers:\n``make build_docs``, ``make serve_docs``\n\nRebuild docs on file change: ``make watch_docs`` (requires `entr(1)`_)\n\nRebuild docs and run server via one terminal: ``make dev_docs``  (requires above, and a \n``make(1)`` with ``-J`` support, e.g. GNU Make)\n\nFormatting / Linting\n""""""""""""""""""""\nThe project uses `black`_ and `isort`_ (one after the other) and runs `flake8`_ via \nCI. See the configuration in `pyproject.toml` and `setup.cfg`:\n\n``make black isort``: Run ``black`` first, then ``isort`` to handle import nuances\n``make flake8``, to watch (requires ``entr(1)``): ``make watch_flake8`` \n\nReleasing\n"""""""""\nAs of 0.1, `poetry`_ handles virtualenv creation, package requirements, versioning,\nbuilding, and publishing. Therefore there is no setup.py or requirements files.\n\nUpdate `__version__` in `__about__.py` and `pyproject.toml`::\n\n\tgit commit -m \'build(unihan-db): Tag v0.1.1\'\n\tgit tag v0.1.1\n\tgit push\n\tgit push --tags\n\tpoetry build\n\tpoetry deploy\n\n.. _cihai: https://cihai.git-pull.com\n.. _unihan-etl: https://unihan-etl.git-pull.com\n.. _libUnihan: http://libunihan.sourceforge.net/\n.. _API: http://unihan-db.git-pull.com/en/latest/api.html\n.. _UNIHAN: http://www.unicode.org/charts/unihan.html\n.. _poetry: https://python-poetry.org/\n.. _entr(1): http://eradman.com/entrproject/\n.. _black: https://github.com/psf/black\n.. _isort: https://pypi.org/project/isort/\n.. _flake8: https://flake8.pycqa.org/\n\n.. |pypi| image:: https://img.shields.io/pypi/v/unihan-db.svg\n    :alt: Python Package\n    :target: http://badge.fury.io/py/unihan-db\n\n.. |docs| image:: https://github.com/cihai/unihan-db/workflows/Publish%20Docs/badge.svg\n   :alt: Docs\n   :target: https://github.com/cihai/unihan-db/actions?query=workflow%3A"Publish+Docs"\n\n.. |build-status| image:: https://github.com/cihai/unihan-db/workflows/test/badge.svg\n   :alt: Build Status\n   :target: https://github.com/cihai/unihan-db/actions?query=workflow%3A"test"\n\n.. |coverage| image:: https://codecov.io/gh/cihai/unihan-db/branch/master/graph/badge.svg\n    :alt: Code Coverage\n    :target: https://codecov.io/gh/cihai/unihan-db\n\n.. |license| image:: https://img.shields.io/github/license/cihai/unihan-db.svg\n    :alt: License \n',
    'author': 'Tony Narlock',
    'author_email': 'tony@git-pull.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://unihan-db.git-pull.com',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.6,<4.0',
}


setup(**setup_kwargs)
