{"id":20433307,"url":"https://github.com/jpcadena/pydantic-sqlalchemy-tutorial","last_synced_at":"2026-02-03T18:35:05.243Z","repository":{"id":237353259,"uuid":"794348892","full_name":"jpcadena/pydantic-sqlalchemy-tutorial","owner":"jpcadena","description":"Tutorial for Pydantic and SQLAlchemy","archived":false,"fork":false,"pushed_at":"2025-05-01T01:50:02.000Z","size":8125,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T00:02:50.638Z","etag":null,"topics":["backend","data-engineering","data-validation","database","etl","etl-pipeline","fastapi","postgresql","pydantic","pydantic-settings","pydantic-v2","python","python3","restful-api","sqlalchemy","sqlalchemy-core","sqlalchemy-database","sqlalchemy-example","sqlalchemy-orm","sqlalchemy-python"],"latest_commit_sha":null,"homepage":"https://github.com/jpcadena/pydantic-sqlalchemy-tutorial","language":"CSS","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/jpcadena.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-01T00:27:01.000Z","updated_at":"2025-02-03T01:06:08.000Z","dependencies_parsed_at":"2024-05-06T03:23:35.072Z","dependency_job_id":"b9ea3de7-bef5-4fea-a84e-390e0b52c6d9","html_url":"https://github.com/jpcadena/pydantic-sqlalchemy-tutorial","commit_stats":null,"previous_names":["jpcadena/pydantic-sqlalchemy-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jpcadena/pydantic-sqlalchemy-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Fpydantic-sqlalchemy-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Fpydantic-sqlalchemy-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Fpydantic-sqlalchemy-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Fpydantic-sqlalchemy-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpcadena","download_url":"https://codeload.github.com/jpcadena/pydantic-sqlalchemy-tutorial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Fpydantic-sqlalchemy-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29052635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"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":["backend","data-engineering","data-validation","database","etl","etl-pipeline","fastapi","postgresql","pydantic","pydantic-settings","pydantic-v2","python","python3","restful-api","sqlalchemy","sqlalchemy-core","sqlalchemy-database","sqlalchemy-example","sqlalchemy-orm","sqlalchemy-python"],"created_at":"2024-11-15T08:18:34.029Z","updated_at":"2026-02-03T18:35:05.224Z","avatar_url":"https://github.com/jpcadena.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pydantic-sqlalchemy-tutorial\n\n\u003c!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 --\u003e\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003c!-- PROJECT SHIELDS --\u003e\n\u003c!--\n*** Markdown \"reference style\" links for readability.\n*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).\n--\u003e\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/othneildrew/Best-README-Template\"\u003e\n    \u003cimg src=\"assets/images/logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n\u003ch3 align=\"center\"\u003ePydantic sqlalchemy tutorial\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Pydantic sqlalchemy tutorial\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/jpcadena/pydantic-sqlalchemy-tutorial\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\n![Project][project-screenshot]\n\nThis tutorial provides a comprehensive guide on leveraging the functionalities of Pydantic and SQLAlchemy within Python applications. Pydantic is utilized primarily for data validation and settings management through data parsing and validation using Python type annotations. SQLAlchemy, on the other hand, serves as a powerful SQL toolkit and Object-Relational Mapping (ORM) system for Python, facilitating database communication more efficiently and intuitively.\n\nThe aim of this tutorial is to showcase how these two libraries can be integrated to build robust data processing applications. You'll learn how to validate data effectively with Pydantic and perform database operations seamlessly with SQLAlchemy. Whether you're managing data flows for web development with FastAPI or orchestrating complex data transformations for ETL processes, this guide will provide you with the necessary tools and knowledge to enhance your projects' architecture and data integrity.\n\n\nThis guide is ideal for developers looking to improve their backend systems, data scientists seeking to streamline their data handling, and anyone in between who wishes to master these powerful Python libraries.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### Built with\n\n[![Python][python-shield]][python-url] [![Pydantic][pydantic-shield]][pydantic-url] [![postgresql][postgresql-shield]][postgresql-url] [![isort][isort-shield]][isort-url] [![Black][black-shield]][black-url] [![Ruff][ruff-shield]][ruff-url] [![MyPy][mypy-shield]][mypy-url] [![pre-commit][pre-commit-shield]][pre-commit-url] [![GitHub Actions][github-actions-shield]][github-actions-url] [![Poetry][poetry-shield]][poetry-url] [![Pycharm][pycharm-shield]][pycharm-url] [![Visual Studio Code][visual-studio-code-shield]][visual-studio-code-url] [![Markdown][markdown-shield]][markdown-url] [![License: MIT][license-shield]][license-url]\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- GETTING STARTED --\u003e\n\n## Getting Started\n\n### Prerequisites\n\n- [Python 3.12+][python-docs]\n\n### Installation\n\n1. Clone the **repository**\n\n   ```bash\n   git clone https://github.com/jpcadena/pydantic-sqlalchemy-tutorial.git\n   ```\n\n2. Change the directory to **root project**\n\n   ```bash\n   cd pydantic-sqlalchemy-tutorial\n   ```\n\n3. Install **Poetry** package manager\n\n   ```bash\n   pip install poetry\n   ```\n\n4. Install the project's **dependencies**\n\n   ```bash\n   poetry install\n   ```\n\n5. Activate the **environment**\n\n   ```bash\n   poetry shell\n   ```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- USAGE EXAMPLES --\u003e\n\n## Usage\n\n1. **Setting up environment variables:**\n\n   If you find a `.env.sample` in the project directory, make a copy of it and rename to `.env`.\n\n   ```bash\n   cp .env.sample .env\n   ```\n\n   This `.env` file will be used to manage your application's environment variables.\n\n2. **Configuring your credentials:**\n\n   Open the `.env` file in a text editor and replace the placeholder values with your actual credentials.\n\n   ```bash\n   # .env file\n   POSTGRES_USER=your_database_user\n   SECRET_KEY=your_api_key\n   ```\n\n3. Execute with console\n\n   ```bash\n   python main.py\n   ```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CONTRIBUTING --\u003e\n\n## Contributing\n\n[![GitHub][github-shield]][github-url]\n\nPlease read our [contributing guide](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- SECURITY --\u003e\n\n## Security\n\nFor security considerations and best practices, please refer to our [Security Guide](SECURITY.md) for a detailed guide.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CODE_OF_CONDUCT --\u003e\n\n## Code of Conduct\n\nWe enforce a code of conduct for all maintainers and contributors. Please read our [Code of Conduct](CODE_OF_CONDUCT.md) to understand the expectations before making any contributions.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- LICENSE --\u003e\n\n## License\n\nDistributed under the MIT License. See [LICENSE](LICENSE) for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CONTACT --\u003e\n\n## Contact\n\n- [![LinkedIn][linkedin-shield]][linkedin-url]\n\n- [![Outlook][outlook-shield]](mailto:jpcadena@espol.edu.ec?subject=[GitHub]pydantic-sqlalchemy-tutorial)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n\n[project-screenshot]: assets/images/project.png\n[python-docs]: https://docs.python.org/3.12/\n[linkedin-shield]: https://img.shields.io/badge/linkedin-%230077B5.svg?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white\n[outlook-shield]: https://img.shields.io/badge/Microsoft_Outlook-0078D4?style=for-the-badge\u0026logo=microsoft-outlook\u0026logoColor=white\n[python-shield]: https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54\n[pycharm-shield]: https://img.shields.io/badge/PyCharm-21D789?style=for-the-badge\u0026logo=pycharm\u0026logoColor=white\n[markdown-shield]: https://img.shields.io/badge/Markdown-000000?style=for-the-badge\u0026logo=markdown\u0026logoColor=white\n[github-shield]: https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge\u0026logo=github\u0026logoColor=white\n[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json\n[black-shield]: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge\u0026logo=appveyor\n[mypy-shield]: https://img.shields.io/badge/mypy-checked-2A6DB2.svg?style=for-the-badge\u0026logo=appveyor\n[visual-studio-code-shield]: https://img.shields.io/badge/Visual_Studio_Code-007ACC?style=for-the-badge\u0026logo=visual-studio-code\u0026logoColor=white\n[poetry-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/python-poetry/website/main/static/badge/v0.json\n[isort-shield]: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat\u0026labelColor=ef8336\n[github-actions-shield]: https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge\u0026logo=githubactions\u0026logoColor=white\n[pre-commit-shield]: https://img.shields.io/badge/pre--commit-F7B93E?style=for-the-badge\u0026logo=pre-commit\u0026logoColor=white\n[pydantic-shield]: https://img.shields.io/badge/Pydantic-FF43A1?style=for-the-badge\u0026logo=pydantic\u0026logoColor=white\n[postgresql-shield]: https://img.shields.io/badge/PostgreSQL-336791?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white\n[license-shield]: https://img.shields.io/badge/License-MIT-yellow.svg\n\n[linkedin-url]: https://linkedin.com/in/juanpablocadenaaguilar\n[python-url]: https://docs.python.org/3.12/\n[pycharm-url]: https://www.jetbrains.com/pycharm/\n[markdown-url]: https://daringfireball.net/projects/markdown/\n[github-url]: https://github.com/jpcadena/pydantic-sqlalchemy-tutorial\n[ruff-url]: https://beta.ruff.rs/docs/\n[black-url]: https://github.com/psf/black\n[mypy-url]: http://mypy-lang.org/\n[visual-studio-code-url]: https://code.visualstudio.com/\n[poetry-url]: https://python-poetry.org/\n[isort-url]: https://pycqa.github.io/isort/\n[github-actions-url]: https://github.com/features/actions\n[pre-commit-url]: https://pre-commit.com/\n[pydantic-url]: https://docs.pydantic.dev\n[postgresql-url]: https://www.postgresql.org/\n[license-url]: https://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcadena%2Fpydantic-sqlalchemy-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpcadena%2Fpydantic-sqlalchemy-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcadena%2Fpydantic-sqlalchemy-tutorial/lists"}