Familarity with Python programming language, at an intermediate level. At least an understanding of and ability to code the following concepts:
- Variables
- Data types
- Operators
- Control structures
- Loops
- Built-in methods and functions
- Classes and objects
This lesson contains a lot of installations. Learners should expect hiccups and some waiting time while instructor is troubleshooting issues for other learners.
Conceptual knowledge, refer to slides.
- Download and install git here
- Git is a version control system that we will be using throughout this program, to manage our codes
- Download and install miniconda here
- Conda is a package and environment manager that we will be using throughout this program, to manage our Python packages and environments
- Download and install DBeaver Community here
- DBeaver is a SQL client that we will be using throughout this program, to connect to databases and write SQL codes
- Download and install vscode here
- VSCode is an IDE (Integrated Development Environment) that we will be using throughout this program, to write Python and SQL codes
Go to the Extensions
tab, search for the following extensions in the marketplace and install them:
- Python
- Jupyter
We can use conda to install different versions of Python. Conda also allows us to create and manage virtual environments for different projects. A conda environment
is a self-contained virtual environment that contains its own Python installation and packages. This allows us to have different versions of Python and packages for different projects, without them conflicting with each other.
conda create -n <env_name> python=<python_version>
for example:
conda create -n myenv python=3.10
conda activate <env_name>
conda deactivate
conda remove -n <env_name> --all
conda install -n <env_name> <package_name>
or activate the environment first, then:
conda install <package_name>
to install multiple packages at once:
conda install <package_name_1> <package_name_2> <package_name_3>
conda uninstall -n <env_name> <package_name>
or activate the environment first, then:
conda uninstall <package_name>
Freezing dependencies is the process of writing the dependencies of an environment to a file. This allows us to recreate the exact same environment for the application, with the exact same versions of packages.
Activate the environment first, then:
conda env export > environment.yml
Walk through the creation of an environment for this module
conda env create -f environment.yml
After activating the environment, run:
python <script_name.py>
Git is a version control system which allows us to track changes to our codes.
git init
git add <file_name>
or add all files to staging area:
git add .
git commit -m "<commit_message>"
for example:
git commit -m "Initial commit"
git status
git log
Github is a cloud-based hosting service for git repositories. It allows us to store our git repositories in the cloud, and collaborate with other developers.
git clone <repo_url>
git pull
git push
Walk through the forking of this repository and cloning of the forked repository to the local machine. Then attempt the 1st question of the assignment, and push the changes to the forked repository.