{"id":38680874,"url":"https://github.com/empa-scientific-it/python-tutorial","last_synced_at":"2026-01-17T10:13:26.320Z","repository":{"id":65577861,"uuid":"593234387","full_name":"empa-scientific-it/python-tutorial","owner":"empa-scientific-it","description":"Material for a Jupyter-based Python tutorial, with Introductory, Advanced, Libraries modules","archived":false,"fork":false,"pushed_at":"2025-11-05T11:52:30.000Z","size":4811,"stargazers_count":43,"open_issues_count":36,"forks_count":31,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-05T12:04:45.495Z","etag":null,"topics":["jupyter-notebooks","numpy","python","python-jupyter-notebooks","python-pandas","python-tutorials","python4everybody","scipy"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/empa-scientific-it.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-25T14:50:30.000Z","updated_at":"2025-10-31T15:38:38.000Z","dependencies_parsed_at":"2023-10-03T17:46:35.225Z","dependency_job_id":"11b1c033-e6dc-4892-bfe6-9c1944ef8d8c","html_url":"https://github.com/empa-scientific-it/python-tutorial","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/empa-scientific-it/python-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empa-scientific-it%2Fpython-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empa-scientific-it%2Fpython-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empa-scientific-it%2Fpython-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empa-scientific-it%2Fpython-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/empa-scientific-it","download_url":"https://codeload.github.com/empa-scientific-it/python-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empa-scientific-it%2Fpython-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28505845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter-notebooks","numpy","python","python-jupyter-notebooks","python-pandas","python-tutorials","python4everybody","scipy"],"created_at":"2026-01-17T10:13:26.261Z","updated_at":"2026-01-17T10:13:26.307Z","avatar_url":"https://github.com/empa-scientific-it.png","language":"Jupyter Notebook","readme":"# python-tutorial\n\n[![Renku](https://renkulab.io/renku-badge.svg)](https://renkulab.io/v2/projects/empa-scientific-it/empa-it-python-tutorial/sessions/01JRT57GABCS15JB5NGNTQVTRB/start)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/empa-scientific-it/python-tutorial.git/main?labpath=00_index.ipynb)\n\n[![Build Docker container](https://github.com/empa-scientific-it/python-tutorial/actions/workflows/docker-build.yml/badge.svg)](https://github.com/empa-scientific-it/python-tutorial/actions/workflows/docker-build.yml)\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true\u0026ref=main\u0026repo=593234387)\n\n## Run the tutorial on your computer\n\nYou have two ways in which you can run the tutorial **locally**.\n\n### 1. With a `conda` environment\n\n#### 0. Prerequisites\n\nTo run the tutorial locally, you should first install [conda](https://docs.conda.io/en/latest/miniconda.html) (or [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html)).\n\nIt is also suggested that you have a recent version of `git`. Check out [how to install `git`](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) on your operating system.\n\n#### 1. Download the material\n\nGo to the directory on your machine where you want to download the material and clone the repository:\n\n```console\ngit clone https://github.com/empa-scientific-it/python-tutorial\n```\n\nAlternatively, you can manually download a ZIP archive with the latest version of the material:\n\n[Download ZIP archive](https://github.com/empa-scientific-it/python-tutorial/archive/refs/heads/main.zip)\n\nExtract the archive in a directory of your choice.\n\n#### 2. Create a dedicated environment\n\nEnter the tutorial folder with\n\n```console\ncd /path/to/python-tutorial\n\n```\n\n\u003e If you have installed Anaconda, then you can use Anaconda Prompt to run the following commands.\n\nYou should now create a new environment with `conda`:\n\n```console\nconda env create -f binder/environment.yml\n```\n\n\u003e [!WARNING]\n\u003e\n\u003e If you are on Windows and using Command Prompt or the PowerShell, please make sure to adjust the paths in the commands above accordingly.\n\nThen activate the environment with\n\n```console\nconda activate python-tutorial\n```\n\nYou can update the existing environment (that is, downloading the latest version of the packages) with:\n\n```console\nconda env update -f binder/environment.yml\n```\n\n#### 3. Launch the tutorial via Jupyter\n\nFinally, launch JupyterLab with\n\n```console\njupyter lab\n```\n\n### 2. With Docker\n\n\u003e [!NOTE]\n\u003e\n\u003e The following instructions are for Windows. With minor changes, the steps work on macOS or Linux as well.\n\n1. Install Docker Desktop: First, you need to install Docker Desktop on your Windows machine. You can download it from the official Docker website: https://www.docker.com/products/docker-desktop.\n\n2. Create a folder: Open File Explorer and create a new folder where you want to save the tutorial's materials. For example, you could create a folder called \"python-tutorial\" on your Desktop.\n\n3. Open PowerShell: Once Docker Desktop is installed, open PowerShell on your Windows machine. You can do this by pressing the \"Windows\" key and typing \"PowerShell\" in the search bar.\n\n4. Pull the Docker image: In PowerShell, run the following command to pull the Docker image:\n\n```console\ndocker pull ghcr.io/empa-scientific-it/python-tutorial:latest\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e The `latest` tag points to the CPU-only variant of the image, which is optimized for size and compatibility. If you have a CUDA-compatible GPU and want to use GPU acceleration for PyTorch operations, you can use the CUDA-enabled variant by replacing `latest` with `cuda`:\n\u003e\n\u003e ```console\n\u003e docker pull ghcr.io/empa-scientific-it/python-tutorial:cuda\n\u003e ```\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e Using the CUDA variant requires a NVIDIA GPU with compatible drivers properly installed and configured for Docker. See [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) for setup instructions.\n\n5. Run the Docker container: Once the image is downloaded, run the following command to start a Docker container from the image:\n\n```console\ndocker run -p 8888:8888 --name python_tutorial -v /path/to/python-tutorial:/home/jovyan/python-tutorial ghcr.io/empa-scientific-it/python-tutorial:latest jupyter lab --ip 0.0.0.0 --no-browser\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e If you pulled the CUDA variant, replace `:latest` with `:cuda` in the command above.\n\nReplace `/path/to/python-tutorial` with the path to the folder you created in step 2, for example `C:/Users/yourusername/Desktop/python-tutorial`.\n\n\u003e [!NOTE]\n\u003e\n\u003e The above command will **mirror** the content of your local folder (e.g., `C:/Users/yourusername/Desktop/python-tutorial`) to the `~/python-tutorial` folder **inside the container**. In this way, every file or folder you copy or create into `~/python-tutorial` will be saved on your machine, and will remain there **even if you stop Docker**.\n\n6. Access the Jupyter Notebook: Open a web browser and navigate to `http://localhost:8888/lab`. You should see the Jupyter Notebook interface. Enter the token provided in the PowerShell console to access the notebook. Alternatively, you can directly click on the link that appears in the PowerShell after the container has started.\n\nYou can now use the Jupyter in the Docker container to run the python-tutorial. When you're done, you can stop the container by pressing `Ctrl+C` in the PowerShell console.\n\n\u003e [!NOTE]\n\u003e\n\u003e If you want to restart the container, you can simply run the command `docker container start python_tutorial`.\n\n## Setup a local dev environment\n\nIf you prefer not to use Conda and/or Docker, you can set up a *lightweight* development environment using either \"uv\" (a faster alternative to pip) or traditional \"pip\". Both methods will install the development dependencies specified in the `pyproject.toml` file.\n\nBoth setups assume that you have already cloned the repository with `git clone https://github.com/empa-scientific-it/python-tutorial`. The commands below should be run from inside the tutorial directory.\n\n### Using `uv` (Recommended for speed)\n\n[uv](https://github.com/astral-sh/uv) is a fast, Python package installer and resolver written in Rust.\n\n1. Install uv via `pip` or [any other method](https://docs.astral.sh/uv/getting-started/installation/):\n   ```console\n   pip install uv\n   ```\n\n2. Create a virtual environment and install dev dependencies:\n   ```console\n   # Create and activate a virtual environment\n   uv venv\n   # On Windows\n   .venv\\Scripts\\activate\n   # On macOS/Linux\n   source .venv/bin/activate\n\n   # Install dev dependencies\n   uv pip install -e \".[dev]\"\n   ```\n\n3. Launch JupyterLab:\n   ```console\n   jupyter lab\n   ```\n\n### Using `pip`\n\n1. Create a virtual environment and install dev dependencies:\n   ```console\n   # Create and activate a virtual environment\n   python -m venv .venv\n   # On Windows\n   .venv\\Scripts\\activate\n   # On macOS/Linux\n   source .venv/bin/activate\n\n   # Install dev dependencies\n   pip install -e \".[dev]\"\n   ```\n\n2. Launch JupyterLab:\n   ```console\n   jupyter lab\n   ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fempa-scientific-it%2Fpython-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fempa-scientific-it%2Fpython-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fempa-scientific-it%2Fpython-tutorial/lists"}