Skip to main content

sqlitestructure is a Python library to dump table structure of a SQLite database file.

Project description

sqlitestructure

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

Summary

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

Installation

pip install sqlitestructure

Usage

for verbosity_level in range(4):
    print("===== verbosity level {} =====".format(verbosity_level))
    writer = sqlitestructure.TableStructureWriter(db_path, verbosity_level)
    print("{}\n".format(writer.dumps()))
===== 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+

Test dependencies

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlitestructure-0.2.0.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

sqlitestructure-0.2.0-py2.py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page