π«§ A one-stop hub, like a sample library πͺ Azure OpenAI 100+ Sample Code π§ͺ Organized by topic for quick reference.
16
stars
2
commits
Jupyter Notebook
primary language
Jan 16, 2026
updated
A one-stop hub, like a sample library. This repository is organized by topic to help reduce the time spent searching for and reviewing sample code. It offers a curated collection of minimal implementations and sample code from various sources.
[!IMPORTANT] πΉFor more details and the latest code updates, please refer to the original link provided in the
README.app.mdfile within each directory.
πΉDisclaimer: Some examples are created for OpenAI-based APIs.
π‘How to switch between OpenAI and Azure OpenAI endpoints with Python
β If you find this repository useful, please consider giving it a star!
You can use the git_cmp.py script (and related files) to compare your local project directories with their corresponding remote GitHub repositories.
Index all projects and their GitHub URLs:
python git_cmp.py --index --root <root_dir> --csv git_cmp_index.csv
This creates a CSV file listing all projects and their remote URLs.
Compare local and remote repositories:
python git_cmp.py --compare --root <root_dir> --csv git_cmp_index.csv --report git_cmp_report.txt --update_csv git_cmp_needs_update.csv
This generates a report and a CSV of projects needing updates. It also copies changed files into .cache/ for review.
Update local files from cache (optional, use with care):
python git_cmp.py --manipulate --root <root_dir> --update_csv git_cmp_needs_update.csv
This copies files from .cache/ back into your project directories, optionally deleting files if flagged.
SUBDIR Mode
target_remote_path refers to a path in a remote repository that should be used as the starting point for comparison.
When the mode is set to SUBDIR, a directory with the same name as project_name is expected to exist under that path. The comparison should target all files and directories within that SUBDIR.
If there are files or directories that exist only in the remote (excluding readme.app.md, .url, and any folderβincluding its subdirectoriesβthat contains a DONOTCMP file), they should all be copied into the SUBDIR.
FILE Mode
When the mode is set to FILE, target_remote_path is not provided. A file with the same name is expected to exist at the specified GitHub URL. The comparison should target only that specific file, excluding readme.app.md, .url, and any folderβincluding its subdirectoriesβthat contains a DONOTCMP file.
ROOT Mode
When the mode is set to ROOT, target_remote_path is also not provided. All files and directories under project_name (excluding readme.app.md, .url, and any folderβincluding its subdirectoriesβthat contains a DONOTCMP file) should be compared with those in the specified GitHub URL. Files or directories that exist only in the remote should be copied into the project_name.
Compare Command
In compare mode, for files and directories that exist only in the remote, zero-size placeholder files will be created locally.
Remote files and directories are treated as the source of truth.
Manipulation Command
In manipulation mode, the remote repository for project_name should be updated. It is first cloned using the git clone command into the .repo_cache directory. After cloning, the actual file copying process to the local directories begins.
All local files and directories should be deleted firstβexcluding readme.app.md, .url, and any folderβincluding its subdirectoriesβthat contains a DONOTCMP fileβand then replaced with the corresponding remote versions. However, this local wipe will only be triggered when allow_delete == 'DELETE' to ensure safety.
DONOTCMP is a marker file used to explicitly indicate that a directory is local-only and should be excluded from comparison.
--delay_sec <seconds>: Add a delay between GitHub API calls to avoid rate limits.--index: Index projects and write a CSV.--compare: Compare projects and write a report.--manipulate: Update local files from the cache based on the update CSV.python git_cmp.py --index --root . --csv git_cmp_index.csv
python git_cmp.py --compare --root . --csv git_cmp_index.csv --report git_cmp_report.txt --update_csv git_cmp_needs_update.csv
python git_cmp.py --manipulate --root . --update_csv git_cmp_needs_update.csv
Note:
- Create
.envfile. Set theGITHUB_TOKEN.e.g.,GITHUB_TOKEN=<your_key>- Review
.cache/and the generated report before running--manipulate.- See comments and docstrings in
git_cmp.pyfor more details.
pip install nbformat nbconvert
import nbformat
from nbconvert import PythonExporter
# Load the notebook
notebook_filename = 'your_notebook.ipynb'
with open(notebook_filename, 'r', encoding='utf-8') as notebook_file:
notebook_content = nbformat.read(notebook_file, as_version=4)
# Convert the notebook to a Python script
python_exporter = PythonExporter()
python_code, _ = python_exporter.from_notebook_node(notebook_content)
# Save the converted Python code to a .py file
python_filename = notebook_filename.replace('.ipynb', '.py')
with open(python_filename, 'w', encoding='utf-8') as python_file:
python_file.write(python_code)
print(f"Notebook converted to Python script: {python_filename}")
β https://github.com/kimtth all rights reserved.
1 commits
1 commits
Jupyter Notebook
96.5%
Python
1.9%
π«§ A one-stop hub, like a sample library πͺ Azure OpenAI 100+ Sample Code π§ͺ Organized by topic for quick reference.
16
stars
2
commits
Jupyter Notebook
primary language
Jan 16, 2026
updated
A one-stop hub, like a sample library. This repository is organized by topic to help reduce the time spent searching for and reviewing sample code. It offers a curated collection of minimal implementations and sample code from various sources.
[!IMPORTANT] πΉFor more details and the latest code updates, please refer to the original link provided in the
README.app.mdfile within each directory.
πΉDisclaimer: Some examples are created for OpenAI-based APIs.
π‘How to switch between OpenAI and Azure OpenAI endpoints with Python
β If you find this repository useful, please consider giving it a star!
You can use the git_cmp.py script (and related files) to compare your local project directories with their corresponding remote GitHub repositories.
Index all projects and their GitHub URLs:
python git_cmp.py --index --root <root_dir> --csv git_cmp_index.csv
This creates a CSV file listing all projects and their remote URLs.
Compare local and remote repositories:
python git_cmp.py --compare --root <root_dir> --csv git_cmp_index.csv --report git_cmp_report.txt --update_csv git_cmp_needs_update.csv
This generates a report and a CSV of projects needing updates. It also copies changed files into .cache/ for review.
Update local files from cache (optional, use with care):
python git_cmp.py --manipulate --root <root_dir> --update_csv git_cmp_needs_update.csv
This copies files from .cache/ back into your project directories, optionally deleting files if flagged.
SUBDIR Mode
target_remote_path refers to a path in a remote repository that should be used as the starting point for comparison.
When the mode is set to SUBDIR, a directory with the same name as project_name is expected to exist under that path. The comparison should target all files and directories within that SUBDIR.
If there are files or directories that exist only in the remote (excluding readme.app.md, .url, and any folderβincluding its subdirectoriesβthat contains a DONOTCMP file), they should all be copied into the SUBDIR.
FILE Mode
When the mode is set to FILE, target_remote_path is not provided. A file with the same name is expected to exist at the specified GitHub URL. The comparison should target only that specific file, excluding readme.app.md, .url, and any folderβincluding its subdirectoriesβthat contains a DONOTCMP file.
ROOT Mode
When the mode is set to ROOT, target_remote_path is also not provided. All files and directories under project_name (excluding readme.app.md, .url, and any folderβincluding its subdirectoriesβthat contains a DONOTCMP file) should be compared with those in the specified GitHub URL. Files or directories that exist only in the remote should be copied into the project_name.
Compare Command
In compare mode, for files and directories that exist only in the remote, zero-size placeholder files will be created locally.
Remote files and directories are treated as the source of truth.
Manipulation Command
In manipulation mode, the remote repository for project_name should be updated. It is first cloned using the git clone command into the .repo_cache directory. After cloning, the actual file copying process to the local directories begins.
All local files and directories should be deleted firstβexcluding readme.app.md, .url, and any folderβincluding its subdirectoriesβthat contains a DONOTCMP fileβand then replaced with the corresponding remote versions. However, this local wipe will only be triggered when allow_delete == 'DELETE' to ensure safety.
DONOTCMP is a marker file used to explicitly indicate that a directory is local-only and should be excluded from comparison.
--delay_sec <seconds>: Add a delay between GitHub API calls to avoid rate limits.--index: Index projects and write a CSV.--compare: Compare projects and write a report.--manipulate: Update local files from the cache based on the update CSV.python git_cmp.py --index --root . --csv git_cmp_index.csv
python git_cmp.py --compare --root . --csv git_cmp_index.csv --report git_cmp_report.txt --update_csv git_cmp_needs_update.csv
python git_cmp.py --manipulate --root . --update_csv git_cmp_needs_update.csv
Note:
- Create
.envfile. Set theGITHUB_TOKEN.e.g.,GITHUB_TOKEN=<your_key>- Review
.cache/and the generated report before running--manipulate.- See comments and docstrings in
git_cmp.pyfor more details.
pip install nbformat nbconvert
import nbformat
from nbconvert import PythonExporter
# Load the notebook
notebook_filename = 'your_notebook.ipynb'
with open(notebook_filename, 'r', encoding='utf-8') as notebook_file:
notebook_content = nbformat.read(notebook_file, as_version=4)
# Convert the notebook to a Python script
python_exporter = PythonExporter()
python_code, _ = python_exporter.from_notebook_node(notebook_content)
# Save the converted Python code to a .py file
python_filename = notebook_filename.replace('.ipynb', '.py')
with open(python_filename, 'w', encoding='utf-8') as python_file:
python_file.write(python_code)
print(f"Notebook converted to Python script: {python_filename}")
β https://github.com/kimtth all rights reserved.
1 commits
1 commits
Jupyter Notebook
96.5%
Python
1.9%