Skip to content

Commit

Permalink
Adding structured roadmaps, env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
nitya committed Apr 6, 2024
1 parent 50b8f9a commit f275e30
Show file tree
Hide file tree
Showing 9 changed files with 616 additions and 66 deletions.
11 changes: 11 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# OpenAI Provider
OPENAI_API_KEY='<add your OpenAI API key here>'

## Azure OpenAI
AZURE_OPENAI_KEY='<add your AOAI key here>'
AZURE_OPENAI_ENDPOINT='<add your AOIA service endpoint here>'
AZURE_OPENAI_DEPLOYMENT='<add your chat completion model name here>'
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT='<add your embeddings model name here>'

## Hugging Face
HUGGING_FACE_API_KEY='<add your HuggingFace API or token here>'

Large diffs are not rendered by default.

Binary file added docs/src/assets/prompt-engineering-roadmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/python-roadmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
239 changes: 239 additions & 0 deletions docs/src/content/docs/100/100-01.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 100-01: Getting Started\n",
"\n",
"Use this notebook to validate that you have your development environment setup correctly, and that you are familiar with basics of relevant tools for learning Python and Python-adjacent topics on the roadmap. Notebooks are meant to be code-centric (Python cells) with short explainers (Markdown cells) to provide learning context or instructions. \n",
"\n",
"Resources referenced for learning will be listed in the Table Of Contents for the level (100). Where required, additional resources used only in a specific notebook will be listed within it, at this title level."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"### 1. Verify Setup with \"Hello, World!\"\n",
"\n",
"- We'll use comments in Python code cells to explain context or provide instructions\n",
"- Use \"#\" for single-line comments, typically for explainers\n",
"- Use triple quotes for multi-line comments, typically for instructions\n",
"- See example below - this code also helps verify that your setup is correct"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello, World!\n"
]
}
],
"source": [
"# This is a single line comment used for short explanations or context.\n",
"# I can add multiple lines by marking each line separately.\n",
"\n",
"''' \n",
"This is a multi-line comment useful for writing instructions or long explainers\n",
"Example:\n",
"Let's use this code to verify that our environment is setup correctly.\n",
"1. Launch a dev container with this repo (local Docker Desktop or cloud Github Codespaces)\n",
"1. Open this file in Visual Studio Code in that dev container environment\n",
"1. \"Select kernel\" (top right) and pick the default Python environment (e.g., Python 3.10.13)\n",
"1. Select \"Run\" (just this cell, left) to execute code below\n",
"1. Verify you see \"Hello, World!\" output below this cell (comments are ignored by Python interpreter)\n",
"\n",
"Congratulations. You just ran your first Python program in Jupyter-Codespaces.\n",
"'''\n",
"\n",
"# This is your first Python program\n",
"print(\"Hello, World!\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"### 2. Use Python Interpreter from Command-Line\n",
"\n",
"- The Python interpreter can be used to run Python code directly from the command line.\n",
"- You can run the Python interpreter by typing `python3` in the Visual Studio Code terminal.\n",
"- Open a terminal in Visual Studio Code from menu or by typing <kbd>Ctrl+`</kbd>\n",
"- Then start the interpreter and explore Python commands interactively.\n",
"\n",
"The **Markdown cell** below shows a sample session (empty lines added for clarity only)\n",
"- The `python3` command is used to start the Python interpreter.\n",
"- The `>>>` prompt indicates the Python interpreter is ready to accept commands.\n",
"- The `exit()` command is used to quit the Python interpreter.\n",
"\n",
"> Note that the cell below is not executable code! \n",
"> You can use it for reference and type those commands into the terminal yourself."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"```python\n",
"codespace ➜ .../src/content/docs/100 (main) $ python3\n",
"Python 3.10.13 (main, Mar 5 2024, 18:35:01) [GCC 9.4.0] on linux\n",
"Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n",
"\n",
">>> hudson_valley = \"The most amazing place on earth!\"\n",
"\n",
">>> print(\"Hudson Valley is ..\\n\", hudson_valley)\n",
"Hudson Valley is ..\n",
" The most amazing place on earth!\n",
"\n",
">>> exit()\n",
"codespace ➜ .../src/content/docs/100 (main) $ \n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"### 3. Execute terminal commands from Jupyter Notebook cells\n",
"\n",
"Sometimes you will need to execute terminal commands prior to running code in a Jupyter cell. For instance, you may want to install a package for a specific purpose (and perhaps uninstall it when done) without having to switch contexts between Jupyter notebook and Visual Studio Code terminal. You can do this by running shell commands directly with `!` or by using a Python module called `subprocess` to invoke shell commands from within Python code. **By documenting and executing these from a Jupyter Notebook cell, you make your code reproducible.**\n",
"\n",
"Try the exercises below to see options in action:\n",
"- Use `!` to run shell commands from a Jupyter Notebook cell.\n",
"- Use `!pip ` to run shell commands to list, install or manage Python packages.\n",
"- Use the `subprocess` module to run shell commands from within Python code.\n",
"- Check the docs for more details on [`subprocess.run()`](https://docs.python.org/3/library/subprocess.html#using-the-subprocess-module)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hudson Valley is beautiful\n"
]
}
],
"source": [
"# Print \"Hudson Valley is beautiful\" in command line\n",
"! echo \"Hudson Valley is beautiful\""
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33mWARNING: Package(s) not found: mkdocs-material\u001b[0m\u001b[33m\n",
"\u001b[0m"
]
}
],
"source": [
"# Test if a specific package is installed (e.g. mkdocs-material)\n",
"! pip show mkdocs-material"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# Install the package (e.g. mkdocs-material) \n",
"# Use -q to suppress verbose output (use -qq or -qqq for less output)\n",
"# Suppression levels are: warnings, errors, and critical\n",
"! pip install mkdocs-material -q "
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found existing installation: mkdocs-material 9.5.17\n",
"Uninstalling mkdocs-material-9.5.17:\n",
" Successfully uninstalled mkdocs-material-9.5.17\n"
]
},
{
"data": {
"text/plain": [
"CompletedProcess(args=['pip', 'uninstall', 'mkdocs-material', '-y'], returncode=0)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Uninstall the installed package (mkdocs-material)\n",
"\n",
"# Option 1: Use shell command with -y to automatically confirm prompts\n",
"# !pip uninstall mkdocs-material -y` \n",
"\n",
"# Option 2: Use \"subprocess\" module to run command from Python code\n",
"# This introduces the concept of Python modules and imports (covered in depth later)\n",
"import subprocess\n",
"subprocess.run(['pip', 'uninstall', 'mkdocs-material', '-y'])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"### "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
59 changes: 42 additions & 17 deletions docs/src/content/docs/100/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,53 @@ title: Table Of Contents
description: Start by learning Python3 syntax and basics
---

The table below will be populated with links to the relevant notebook with a brief description of the recipe covered. To open the notebook you must be running in a GitHub Codespace or have a relevant Jupyter Notebook environment setup.
:::tip About Lessons

|Lab Notebook | Recipe Notes |
|---|---|
| [Lab 01](../../../../../notebooks/100/lab-01.ipynb) - [HTML](/python/notebooks/100/lab-01.html) | Learn Basic Python Syntax, Get Familiar with Notebooks. | Learn Basic Python Syntax, Get Familiar with Notebooks - |
| | |
| | |
| | |
Each Lesson has a Lab and an HTML link.
- The first is an executable Jupyter notebook for interactive learning. You must open this in Visual Studio Code with a suitable runtime (e.g., GitHub Codespaces). It cannot be viewed in a browser.
- The second is a static HTML version of the notebook suitable for viewing in a browser. To view it within Visual Studio Code use `<kbd>Ctrl</kbd>+<kbd>K</kbd>, <kbd>V</kbd>`.

:::

---
<!--
Use this command to convert a notebook in a folder to HTML and save it in the public folder.
jupyter nbconvert --output-dir ./../../../../public/notebooks --to html <notebook-name.ipynb>
-->

## Roadmap

For this bucket, I'll start by following the broad outlines of the [Python Developer Roadmap](https://roadmap.sh/python) shown below (captured Apr 2024). Please refer to the source for the latest version. Each box has a list of relevant resources that I will use as a starting point.

![](./../../../assets/python-roadmap.png)

## Resources
I wanted to start with a structured set of courses or modules that would have an associated community (for support) and a credential (for achievement). So I decided to focus on the [Python 3 Programming Specialization](https://www.coursera.org/specializations/python-3-programming) offered by the University Of Michigan, on Coursera.

It consists of these 5 courses _with an estimated completion time of 3 months at 10 hrs/week_. I expect to complete at least 2-of-5 courses in #30Days.
Let's Follow the

1. [Python Basics](https://www.coursera.org/learn/python-basics?specialization=python-3-programming) Course - 34 hours, 4 modules
1. [Python Functions, Files & Dictionaries](https://www.coursera.org/learn/python-functions-files-dictionaries?specialization=python-3-programming) Course - 31 hours, 5 modules
1. [Data Collection & Processing With Python](https://www.coursera.org/learn/data-collection-processing-python?specialization=python-3-programming) - 16 hours, 3 modules
1. [Python Classes & Inheritance](https://www.coursera.org/learn/python-classes-inheritance?specialization=python-3-programming) - 18 hours, 3 modules
1. [Python Project: pillow, tesseract, opencv](https://www.coursera.org/learn/python-project?specialization=python-3-programming) - 21 hours, 3 modules
| Notebook | Web View | Description |
|---|---|---|
| [Lab 01](./100-01.ipynb) | [HTML](./../../../../public/notebooks/100-01.html) | **Getting Started.** Use this lab to validate your development environment is setup correctly. Learn to use Jupyter Notebooks, invoke commands from Python cells, and run commands from a VS Code terminal. |
| Lab 02 | HTML | **Learn The Basics**. Basic Syntax. Variables & Data Types. Conditionals. Type Casting & Exceptions. Functions & Built-in Functions. Lists, Tuples, Sets & Dictionaries. |
| Lab 03 | HTML | **Data Structures and Algorithms**. Arrays. Linked Lists. Heaps, Stacks & Queues. Hash Tables. Binary Search Trees. Recursion. Sorting Algorithms. |
| Lab 04 | HTML | **Advanced Topics I**. Iterators. RegEx. Decorators. Lambdas. |
| Lab 05 | HTML | **Object Oriented Programming.** Classes. Inheritance. Methods. Dunder. |
| Lab 06 | HTML | **Modules.** Built-in Modules. Custom Modules. |
| Lab 07 | HTML | **Package Managers**. PyPi. Pip. Conda. |
| Lab 08 | HTML | **Advanced Topics II.** List Comprehensions. Generator Expressions. Paradigms.|
| Lab 09 | HTML | **Testing**. doctest. nose. pytest. unittest/pyUnit. Playwright. |
| Lab 07 | HTML | **Miscellaneous**. Developer Tools. Best Practices. End-to-End Workflows. |
| | | |


<br/>

## Resources

Once this specialization is complete, I'll continue to add new sections focused on _applied learning_ exploring the usage of Python3 in specific application contexts like **data science**, **generative AI** and **web app development**.
This will be an evolving set of resources as labs are completed.

| Resource | Source | Description |
|---|---|---|
| [Python Developer Roadmap](https://roadmap.sh/python) | Roadmap.sh | Python Developer Roadmap. |
| [Python 3 Documentation](https://docs.python.org/3/) | Python.org | Official Python 3 Documentation. |
| [Learn on Kaggle](https://www.kaggle.com/learn/) | Kaggle | Python - Intro to ML - Pandas - Data Viz - Deep Learning etc. |
| [Python 3 Specialization](https://www.coursera.org/specializations/python-3-programming) | Coursera | Python 3 Programming Specialization from U.Mich (5 courses). |
| | | |
Loading

0 comments on commit f275e30

Please sign in to comment.