The objective of this project is show how to connect whith a relational database with Python 3. The database used is SQLite3.
The project is divided in 10 parts, in each one we see how to install the database, connect with Python in scripts, divide the code using functions. Then we group the code in classes using Object Oriented Programming. Finally we apply concepts of abstract classes, static methods, and separate the classes in different files.
Our goal is make a code less couple with the database.
Each Part has a README file with instructions of how to run the code, the specific objective of that part.
The section of DOCS contains files with notes of requirements, how to install project and the database.
I hope this code could help you in your own project.
Thank you for your attention.
- DOCS: The documentation, to install project and execute it.
- part01: Create the database, the required table and insert the required records.
- part02: Connect to database and execute sql statements from python.
- part03: Group the code in functions.
- part04: Factorization of code.
- part05: POO: Classes.
- part06: POO: Inheritance.
- part07: POO: static methods.
- part08: Handle exeptions.
- part09: Work with abstract classes in python.
- part10: Separate the classes in different files.
- .gitignore: The files or folders to be ignore to be versioned.
- Pipfile: The file used by pipenv to define dependencies.
- Pipfile.lock: The file used by pipenv to install dependencies.