Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/briangershon/python-vscode-dev
A ready-to-go Python dev environment for LLM projects. Leverages devcontainers in VSCode for virtual environments. Sample LangChain and LangGraph code using OpenAI.
https://github.com/briangershon/python-vscode-dev
devcontainer-template graphviz jupyter-notebook langchain langgraph python starter-template vscode
Last synced: 6 days ago
JSON representation
A ready-to-go Python dev environment for LLM projects. Leverages devcontainers in VSCode for virtual environments. Sample LangChain and LangGraph code using OpenAI.
- Host: GitHub
- URL: https://github.com/briangershon/python-vscode-dev
- Owner: briangershon
- License: mit
- Created: 2024-08-25T19:35:04.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-18T00:56:30.000Z (2 months ago)
- Last Synced: 2024-09-18T04:23:43.992Z (2 months ago)
- Topics: devcontainer-template, graphviz, jupyter-notebook, langchain, langgraph, python, starter-template, vscode
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-vscode-dev
Use a VSCode dev container as your virtual Python development environment.
Includes dependencies for LangChain, LangGraph, Juypter Notebook, and PyGraphviz (for visualization).
Example LangChain and LangGraph code.
Load environment variables via `.env` file.
## Getting Started
### Prerequisites
- install [Docker](https://www.docker.com/get-started)
- install [VSCode](https://code.visualstudio.com/download)### Setup
- **Important: You must create an `.env` file by copying `.env.example` to `.env` and filling in the values for the dev container to run**
- add your Python packages to `requirements.txt`### Open your project in VSCode
```bash
ssh-add ~/.ssh/id_rsa # to share your git credentials with container
code . # open project in VSCode
```In VSCode, choose "Reopen in Container" to fire up container. Ensure you setup an `.env` file before launching dev container.
Open up a terminal in VSCode.
Run `env` to verify env vars look good.
`python src/app.py`
## Running a Jupyter Notebook
In VSCode terminal, run `jupyter notebook --allow-root`. Open up a browser and navigate to the URL shown in terminal. `--allow-root` is fine since Python is running in a dev container.
In browser UI, create a new Python 3 notebook to get started.
If you copy in `app.py` into the notebook, you can run the code in the notebook and also see graphviz visualizations of the workflow.