Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ Partdb is a webapp for querying the part to drawer mapping databases for the bac
We were provided with a virus-infested MS Access DB of the part-number->drawer-number mapping catalog, with a VB6 frontend.
We dumped this Access db into a sqlite3 db using MDBtool, and wrote a Flask app to query it, with a static js/html frontend.

## External Requirements

To adapt the database file itself,you will need [MDB Tools](https://github.com/mdbtools). This is available in Debian packages,
MacOS brew, and probably other unix package repos.

## Populating the DB from the MDB dumps
```bash
$ ./data/insert_csv.sh data/db1.mdb > data.sql # generate a file of INSERTs from the mdb
$ flask initdb # uses schema.sql and data.sql to generate a new db
$ flask --app partdb.py initdb # uses schema.sql and data.sql to generate a new db
$ flask --app partdb.py run # runs the app
```

## License
Expand Down
2 changes: 1 addition & 1 deletion data/insert_csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BASEDIR=$(dirname "$0")
tables="$(mdb-tables $1)"

for table in $tables; do
echo "select Drawer, TableName, PARTNUM, Description from $table" | mdb-sql -HFp $1 \
echo "select Drawer, TableName, PARTNUM, Description from $table" | mdb-sql -HFP $1 \
| awk 'NF' - \
| python "$BASEDIR/tsv_to_insert.py"
done;
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[tool.poetry]
name = "partdb"
version = "0.1.0"
description = "Partdb is a webapp for querying the part to drawer mapping databases for the back-room sorters at Sector67."
authors = ["Erin Marshall <erinzm@github>"]
license = "GPLv3"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.7"
flask = "^2.2.3"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"