You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
874 B
874 B
Plan for Python + SQL
Lessons
- Install a Python virtual environment
- Install psychopg2-binary
- Connect to Postgres via Python
- Running Queries with Python
- Migrating data to a SQLite
- Exporting data to CSV
- Create an API with Flask
- Create a web UI to customize automation
Install a Python virtual environment
python3 -m venv ~/my-env
source ~/my-env/bin/activate
Install psychopg2-binary
python -m pip install psycopg2-binary
Connect to Postgres via Python
import psycopg2
conn = psycopg2.connect(
database="supertest_lab"
)
Running Queries with Python
cursor = conn.cursor()
cursor.execute("SELECT * FROM people")
print(cursor.fetchall())
Labs
- create a terminal based customer relationship management tool
- migrate the CRM from previous lab to simple web app with an API