Metadata-Version: 2.0
Name: sqlitestructure
Version: 0.1.0
Summary:     sqlitestructure is a Python library to dump table structure of
    a SQLite database file.
    
Home-page: https://github.com/thombashi/sqlitestructure
Author: Tsuyoshi Hombashi
Author-email: gogogo.vm@gmail.com
License: MIT License
Keywords: SQLite,library
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: click
Requires-Dist: DataProperty (>=0.8.1)
Requires-Dist: SimpleSQLite (>=0.4.4)
Requires-Dist: six

sqlitestructure
===============

.. image:: https://img.shields.io/pypi/pyversions/sqlitestructure.svg
   :target: https://pypi.python.org/pypi/sqlitestructure
.. image:: https://travis-ci.org/thombashi/sqlitestructure.svg?branch=master
    :target: https://travis-ci.org/thombashi/sqlitestructure
.. image:: https://coveralls.io/repos/github/thombashi/sqlitestructure/badge.svg?branch=master
    :target: https://coveralls.io/github/thombashi/sqlitestructure?branch=master


Summary
=======
Python library to dump table structure of a SQLite database file.


Installation
============

::

    pip install sqlitestructure


Usage
=====

.. code:: python

    for verbosity_level in range(4):
        six.print_("===== verbosity level {} =====".format(verbosity_level))
        writer = sqlitestructure.TableStructureWriterFactory.create(
            db_path, verbosity_level)
        writer.echo_via_pager()
        six.print_()

.. code::

    ===== verbosity level 0 =====
    testdb0
    testdb1

    ===== verbosity level 1 =====
    testdb0 (attr_a, attr_b)
    testdb1 (foo, bar, hoge)

    ===== verbosity level 2 =====
    testdb0 (attr_a INTEGER, attr_b INTEGER)
    testdb1 (foo INTEGER, bar REAL, hoge TEXT)

    ===== verbosity level 3 =====
    CREATE TABLE 'testdb0' ('attr_a' INTEGER, 'attr_b' INTEGER)
    CREATE TABLE 'testdb1' ('foo' INTEGER, 'bar' REAL, 'hoge' TEXT)

    CREATE INDEX testdb1_foo_index ON testdb1('foo')
    CREATE INDEX testdb1_hoge_index ON testdb1('hoge')


Dependencies
============

Python 2.7+ or 3.3+

- `click <https://github.com/pallets/click>`__
- `DataPropery <https://github.com/thombashi/DataProperty>`__
- `SimpleSQLite <https://github.com/thombashi/SimpleSQLite>`__
- `six <https://pypi.python.org/pypi/six/>`__

Test dependencies
-----------------

-  `pytest <https://pypi.python.org/pypi/pytest>`__
-  `pytest-runner <https://pypi.python.org/pypi/pytest-runner>`__
-  `tox <https://pypi.python.org/pypi/tox>`__


