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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file sqlitestructure-0.2.0.tar.gz.

File metadata

File hashes

Hashes for sqlitestructure-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2db75b7c8cebc2c809749702cdd757738784099c73373f4b99d3d849cef0a1a9
MD5 ddc0ae39e787b54c5b4ef3905487da10
BLAKE2b-256 cc65cec7c69e81ce6d450cb05d93a4aad5e7dcb8d899a1232dc8dbc25a4f5760

See more details on using hashes here.

File details

Details for the file sqlitestructure-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sqlitestructure-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9a98cb346f5e9075968e942d45cfb3ebd52f2bb5aa0a2b03cf2683878a632c15
MD5 43f93c779b8872d2b8d188dd33c4c085
BLAKE2b-256 3575f96d85f9623012e35bda1d1160f32070ae13986a38411b3a1e55147ef28a

See more details on using hashes here.

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