Tool for generating demo SQLite databases
Project description
sqlite-generate
Tool for generating demo SQLite databases
Installation
Install this plugin using pip
:
$ pip install sqlite-generate
Usage
To generate a SQLite database file called data.db
with 10 randomly named tables in it, run the following:
sqlite-generate data.db
You can use the --tables
option to generate a different number of tables:
sqlite-generate data.db --tables 20
By default each table will contain a random number of rows between 0 and 200. You can customize this with the --rows
option:
sqlite-generate data.db --rows 20
This will insert 20 rows into each table.
sqlite-generate data.db --tables 500,2000
This inserts a random number of rows between 500 and 2000 into each table.
Each table will have 5 columns. You can change this using --columns
:
sqlite-generate data.db --columns 10
You can control the random number seed used with the --seed
option. This will result in the exact same database file being created by multiple runs of the tool:
sqlite-generate data.db --seed=myseed
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd sqlite-generate
python -mvenv venv
source venv/bin/activate
Or if you are using pipenv
:
pipenv shell
Now install the dependencies and tests:
pip install -e '.[test]'
To run the tests:
pytest
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
Built Distribution
File details
Details for the file sqlite-generate-0.2.tar.gz
.
File metadata
- Download URL: sqlite-generate-0.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9942334e37a3302d7411eb4237a525f7d9dd00c312589a672df65f1cef6ee9d |
|
MD5 | a55c5671ee34be37748f6059d9e1addf |
|
BLAKE2b-256 | 67439f2fffbc4c82aebe7df2c83494436abc492502bd61e65e56c63599a5a16b |
File details
Details for the file sqlite_generate-0.2-py3-none-any.whl
.
File metadata
- Download URL: sqlite_generate-0.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89042a0fffa48894234b5d3cfe5fbefed341fcc5a97434b41363b1685a193ac4 |
|
MD5 | 06ea68752d4c49083964abc02854f62c |
|
BLAKE2b-256 | beb1d94a3759156d01672800f609637d59dc27fa168871419e0b1098d322547a |