An intro to using SQLAlchemy, Alembic and Postgres for implementing relational databases in python.
- Python 3.8 - The programming language used.
- SQLAlchemy - The python SQL toolkit and Object Relational Mapper used.
- Alembic - The database migration tool used.
- PostgreSQL - The relational database used.
What things you need to install the software and how to install them
- python 3
Linux:
sudo apt-get install python3.8
Windows:
Download from python.org
Mac OS:
brew install python3
- pip
Linux and Mac OS:
pip install -U pip
Windows:
python -m pip install -U pip
Clone this repository:
git clone https://github.com/SpencerOfwiti/SQLAlchemy-Primer.git
To set up virtual environment and install dependencies:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
To run alembic migrations:
alembic upgrade head
To run python scripts:
python3 main.py
To remove alembic migrations:
alembic downgrade base
- Spencer Ofwiti - Initial work