{"id":15587984,"url":"https://github.com/david-lor/fastapi-pydantic-sqlalchemy-petshelter-api","last_synced_at":"2026-01-20T11:04:28.437Z","repository":{"id":55508562,"uuid":"324339924","full_name":"David-Lor/FastAPI-Pydantic-SQLAlchemy-PetShelter-API","owner":"David-Lor","description":"Example of a full REST API created with Python, FastAPI, Pydantic \u0026 SQLAlchemy to persist data for a fictional Pet Shelter","archived":false,"fork":false,"pushed_at":"2021-01-01T16:16:01.000Z","size":36,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-06T22:17:24.716Z","etag":null,"topics":["fastapi","fastapi-crud","fastapi-sqlalchemy","pet-shelter","pet-shop","pydantic","python","python3","python36","python37","python38","python39","sqlalchemy","sqlalchemy-orm","sqlalchemy-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/David-Lor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-25T10:23:01.000Z","updated_at":"2025-02-14T02:20:36.000Z","dependencies_parsed_at":"2022-08-15T02:01:05.415Z","dependency_job_id":null,"html_url":"https://github.com/David-Lor/FastAPI-Pydantic-SQLAlchemy-PetShelter-API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/David-Lor/FastAPI-Pydantic-SQLAlchemy-PetShelter-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FFastAPI-Pydantic-SQLAlchemy-PetShelter-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FFastAPI-Pydantic-SQLAlchemy-PetShelter-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FFastAPI-Pydantic-SQLAlchemy-PetShelter-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FFastAPI-Pydantic-SQLAlchemy-PetShelter-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/David-Lor","download_url":"https://codeload.github.com/David-Lor/FastAPI-Pydantic-SQLAlchemy-PetShelter-API/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FFastAPI-Pydantic-SQLAlchemy-PetShelter-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28602175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T10:46:13.255Z","status":"ssl_error","status_checked_at":"2026-01-20T10:42:51.865Z","response_time":117,"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":["fastapi","fastapi-crud","fastapi-sqlalchemy","pet-shelter","pet-shop","pydantic","python","python3","python36","python37","python38","python39","sqlalchemy","sqlalchemy-orm","sqlalchemy-python"],"created_at":"2024-10-02T22:20:38.143Z","updated_at":"2026-01-20T11:04:28.409Z","avatar_url":"https://github.com/David-Lor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI + Pydantic + SQLAlchemy - \"Pet Shelter\" REST API Example\n\nThis project aims to be an example of a full REST API, created with FastAPI \u0026 Pydantic, using async SQLAlchemy to persist the data on a supported database (currently using PostgreSQL).\n\n## Main principles\n\nThe main principles intended to follow are:\n\n- Usage of Pydantic models for all request/response bodies\n- Usage of Alembic migrations for SQLAlchemy\n- Persistence of different data entities (different tables on a database), with relationships between them\n- Request-handling codebase organized in `request handling`, `controller`, `repository`\n- Contextual logging (each log record have its request id), using Loguru\n- Create the whole OpenAPI documentation with the maximum detail, including full, detailed models for requests, responses and errors.\n- Usage of Pydantic BaseSettings to load settings from .env file or environment variables\n- Acceptance tests only (live tests using the API and a real database)\n- Git Flow:\n  - usage of [main](https://github.com/David-Lor/FastAPI-Pydantic-SQLAlchemy-PetShelter-API/tree/main) and [develop](https://github.com/David-Lor/FastAPI-Pydantic-SQLAlchemy-PetShelter-API/tree/develop) branches\n  - one branch per feature/bug/issue\n  - following [Conventional Commits](https://www.conventionalcommits.org) (on main/develop branches only)\n  - priorize squash merge (feature branches may have several \"WIP-like\" commits, that do not follow Conventional Commits)\n\n## API description\n\nThe API simulates the backend of the management system of a fictional pet shelter, providing endpoint to perform CRUD operations.\nTwo entities are persisted - animals and shelters (physical places where the animals live), so a relationship between these two entities is made.\nIn the future, more entities could be added - like people working at the shelters or people adopting the pets.\n\n## Getting started\n\n### Requirements\n\n- Python \u003e= 3.6\n- Requirements listed in [requirements.txt](requirements.txt)\n- Virtual env or Conda/Miniconda env recommended\n\n### Running the API\n\n```bash\nmake install-requirements\nmake run\n```\n\n### Running the tests\n\n```bash\nmake install-test-requirements\nmake test\n```\n\n## Changelog\n\n- 0.0.1:\n  - initial version\n  - API skeleton\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-lor%2Ffastapi-pydantic-sqlalchemy-petshelter-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavid-lor%2Ffastapi-pydantic-sqlalchemy-petshelter-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-lor%2Ffastapi-pydantic-sqlalchemy-petshelter-api/lists"}