{"id":15691006,"url":"https://github.com/adonath/scipy-2023-pydantic-tutorial","last_synced_at":"2026-03-12T15:01:15.811Z","repository":{"id":130775168,"uuid":"608271375","full_name":"adonath/scipy-2023-pydantic-tutorial","owner":"adonath","description":"Repository with draft content for the Pydantic tutorial at SciPy 2023","archived":false,"fork":false,"pushed_at":"2023-07-25T15:18:54.000Z","size":826,"stargazers_count":13,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-17T13:57:52.872Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adonath.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}},"created_at":"2023-03-01T17:11:45.000Z","updated_at":"2025-08-07T12:49:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"8630cf60-b425-426b-b3c1-c16afd4c0900","html_url":"https://github.com/adonath/scipy-2023-pydantic-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adonath/scipy-2023-pydantic-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adonath%2Fscipy-2023-pydantic-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adonath%2Fscipy-2023-pydantic-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adonath%2Fscipy-2023-pydantic-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adonath%2Fscipy-2023-pydantic-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adonath","download_url":"https://codeload.github.com/adonath/scipy-2023-pydantic-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adonath%2Fscipy-2023-pydantic-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30429287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"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":[],"created_at":"2024-10-03T18:18:50.045Z","updated_at":"2026-03-12T15:01:15.773Z","avatar_url":"https://github.com/adonath.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"![example workflow](https://github.com/adonath/scipy-2023-pydantic-tutorial/actions/workflows/ci.yml/badge.svg)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/adonath/scipy-2023-pydantic-tutorial/HEAD)\n\n# Building better data structures, APIs and configuration systems for scientific software using Pydantic\n\nPresented by **Axel Donath** and **Nick Langellier**\n\nThis tutorial is an introduction to [Pydantic](https://pydantic.dev), a library for data validation and settings management using Python type annotations. Using a semi-realistic ML and / or scientific software pipeline scenario we demonstrate how Pydantic can be used to support type validations for scientific data structures, APIs and configuration systems. We show how the use of Pydantic in scientific and ML software leads to a more pleasant user experience as well as more robust and easier to maintain code. A minimum knowledge of Python type annotations, class definitions and data structures will be helpful for beginners but not required.\n\n**Prerequisites**: A minimum knowledge of Python type annotations, class definitions and data structures will be helpful for beginners but not required. Some minimal knowledge of Pandas and Numpy for the hands-on exercises and Jupyter notebooks.\n\n**Prior Python Programming Level of Knowledge Expected**: Advanced beginners\n\n\n## Setup instructions\n\nTo execute the notebooks and examples from this tutorial, you are expected to have a working Python \u003e=3.9 installation of your choice and `git` installed. First clone this repository:\n\n```bash\ngit clone https://github.com/adonath/scipy-2023-pydantic-tutorial\n\n```\n:warning: **Note:** If you have cloned the repository before July 10, 2023, please make sure to update it to the latest version following the [instructions below](#updating-the-repository).\n\n\nAnd change to the cloned folder:\n\n```bash\ncd scipy-2023-pydantic-tutorial\n```\nWe recommend to use a virtual environment to install the required dependencies for this tutorial. For this we provide two options:\n\n- **System Python:** If you use a normal system Python installation you can create and activate the environment using:\n  \n  ```bash\n  python -m venv scipy-2023-pydantic-tutorial\n  source ./scipy-2023-pydantic-tutorial/bin/activate\n  python -m pip install -r requirements.txt\n  ```\n\n- **Conda / Mamba:** If you prefer to use a package manager such as [conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) or [mamba](https://mamba.readthedocs.io/en/latest/installation.html) we also provide an `environment.yaml` file. In this case you can create and activate the environment using:\n\n  ```bash\n  conda env create -f environment.yaml\n  conda activate scipy-2023-pydantic-tutorial\n  ```\n\nOnce the environment is created and activated execute the following script to check your setup:\n\n```bash\npython check-setup.py\n```\n\nIf everything is installed correctly you should see the following message:\n\n```\n******************************************************************\n* Congratulations! You are ready to begin the Pydantic tutorial! *\n******************************************************************\n```\nTo execute the notebooks along with the presentation, start the Jupyter server:\n\n```bash\njupyter notebook\n```\n\n### Updating the repository\n\nIf you have cloned the repository before July 10, 2023, please make sure to update it to the latest version.\nIn case you have local changes, we would recommend to store those in a separate branch before updating the repository. To do so, change to the cloned folder and execute the following commands:\n\n```bash\ngit checkout -b my-local-changes\ngit add .\ngit commit -m \"My local changes\"\n```\n\nThen you can update the repository using:\n\n```bash\ngit checkout main\ngit pull origin main\n```\n\nNow you should have the latest version of the repository.\n\n### Updating the Environment\nIn case you have cloned the repository before July 10, 2023, please make sure to update the environment to the latest version. To do so, change to the cloned folder and execute the following commands:\n\nIf you use a normal system Python installation you can update the environment using:\n\n```bash\npython -m pip install -r requirements.txt\n```\n\nIf you use conda or mamba you can update the environment using:\n\n```bash\nconda env update -f environment.yaml\n```\n\n\n## Binder \nIf you do not have a working installation (for whatever reason) before the tutorial starts, you can also execute the tutorial in the browser using Binder. Just click on the following badge to start the Binder service:\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/adonath/scipy-2023-pydantic-tutorial/HEAD)\n\nThis will open a new tab with a clone of the repository and a running instance of [Jupyter Lab](https://jupyter.org) in your browser. The loading of the environment might take some time.\n\n**Important:** The Binder service might not work reliably if a large number of participants is using it the same time. Installing and executing the tutorials locally is the preferred option. \n\n\n## Content Overview\nWe will cover the following chapters:\n\n  1. [Introduction and Installation](notebooks/1-introduction-and-refreshers.ipynb)\n  1. [Basic Usage](notebooks/2-basic-usage.ipynb)\n  1. [Advanced Usage I](notebooks/3-advanced-usage-part-I.ipynb)\n  1. [Advanced Usage II](notebooks/3-advanced-usage-part-II.ipynb)\n  1. [Serialisation and Deserialisation](notebooks/4-serialisation-and-deserialisation.ipynb)\n  1. [Summary and Conclusion](notebooks/5-summary-and-conclusion.ipynb)\n\nHere is a more complete [overview](overview.md).\n\nYou can find the rendered notebooks and smaple solutions to the exercises on the [GitHub pages](https://adonath.github.io/scipy-2023-pydantic-tutorial/) of this repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadonath%2Fscipy-2023-pydantic-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadonath%2Fscipy-2023-pydantic-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadonath%2Fscipy-2023-pydantic-tutorial/lists"}