-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding structured roadmaps, env vars
- Loading branch information
Showing
9 changed files
with
616 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>' |
257 changes: 250 additions & 7 deletions
257
docs/public/notebooks/100/lab-01.html → docs/public/notebooks/100-01.html
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.