A tool for keeping track of where parts are stored. This tool is optimzed for use by hobbyists and is not intended as an inventory management system for businesses. For example, it does not even try to keep track of quantities.
- Keep track of parts and their locations
- Simple data model. Parts and locations: more than one part can be at a location.
- No extensive metadata. Parts have a description; locations have a name which must be unique.
- Search for parts using either full text or semantic (vector) search by part description
- Intelligent location suggestions when adding a part. Suggests location of similar items.
- An OpenAI API key for creating embeddings of part descriptions; environment variable
OPENAI_API_KEY
must be set and exported. - A PostgreSQL database server with the pgvector extension available; e.g.,pgvector docker image.
- a ~/.pg_service.conf file with a
partdb
service and apartdb-superuser
service configured and ~/.pgpass file if appropriate (not required if pg_hba.conf is configured to trust local users for example). An example~/.pg_service.conf
file is shown below. The user and dbname for thepartdb
service must bepartdb
. The user and dbname for thepartdb-superuser
service must be a postgresql user that has superuser rights.
Example ~/.pg_service.conf
file:
[partdb]
host=127.0.0.1
port=5435
user=partdb
dbname=partdb
[partdb-superuser]
host=127.0.0.1
port=5435
user=postgres
dbname=postgres
pipx install .
or
pipx install --editable .
After ensuring the requirements are met, run the following commands to set up the database:
partdb initdb
To load example data:
partdb loaddb --path <path to example_data/>
partdb update_embeddings
To drop the database for a clean start:
partdb dropdb
To add a new location:
partdb add <location name>
To add a new part:
partdb add <location name> <part description>
To list all parts:
partdb list
To list all parts at a location:
partdb list <location name>
To list all locations:
partdb list --locations
To search for a part using semantic (vector) search (requires OpenAI API call):
partdb search <part description>
To search for a part using full text search:
partdb search --full-text <search phrase>
To delete a part:
partdb delete --id <part id>
To delete a location:
partdb delete --location <location name>
To update the description of a part:
partdb update <part id> <new description>
To move a part to a new location:
partdb move <part id> <new location name>