{"id":21672515,"url":"https://github.com/redis-developer/redis-om-fastapi","last_synced_at":"2025-07-17T15:35:56.783Z","repository":{"id":44882826,"uuid":"426043458","full_name":"redis-developer/redis-om-fastapi","owner":"redis-developer","description":"Examples of using Redis OM Python with FastAPI","archived":false,"fork":false,"pushed_at":"2022-01-20T17:57:54.000Z","size":36,"stargazers_count":24,"open_issues_count":2,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-12T03:52:39.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redis-developer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-09T00:54:12.000Z","updated_at":"2025-03-18T13:19:22.000Z","dependencies_parsed_at":"2022-08-12T11:40:19.185Z","dependency_job_id":null,"html_url":"https://github.com/redis-developer/redis-om-fastapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/redis-developer/redis-om-fastapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fredis-om-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fredis-om-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fredis-om-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fredis-om-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redis-developer","download_url":"https://codeload.github.com/redis-developer/redis-om-fastapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fredis-om-fastapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265623102,"owners_count":23800102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-11-25T13:29:46.326Z","updated_at":"2025-07-17T15:35:56.766Z","avatar_url":"https://github.com/redis-developer.png","language":"Python","readme":"# redis-om-fastapi\n\nThis repository contains an example of how to use [Redis OM Python](https://github.com/redis/redis-om-python) with FastAPI.\n\n## Installing\n\nYou install this project with Poetry.\n\nFirst, [install Poetry](https://python-poetry.org/docs/#installation). You can probably pip install it into your Python environment:\n\n    $ pip install poetry\n\nThen install the example app's dependencies:\n\n    $ poetry install\n    \n## Running the Examples\n\nThis project contains two identical FastAPI applications, one synchronous (main.py) and one asynchronous (async_main.py). Both use Redis OM for Python to save and retrieve data from Redis.\n\nTo try the API, first, start the one of the servers.\n\nYou can start the synchronous server like this, from your terminal:\n\n    $ poetry run uvicorn main:app\n    \nOr the async server like this:\n\n    $ poetry run uvicorn async_main:app\n\nThen, in another shell, create a customer:\n\n    $ curl -X POST  \"http://localhost:8000/customer\" -H 'Content-Type: application/json' -d '{\"first_name\":\"Andrew\",\"last_name\":\"Brookins\",\"email\":\"a@example.com\",\"age\":\"38\",\"join_date\":\"2020-01-02\"}'\n    {\"pk\":\"01FM2G8EP38AVMH7PMTAJ123TA\",\"first_name\":\"Andrew\",\"last_name\":\"Brookins\",\"email\":\"a@example.com\",\"join_date\":\"2020-01-02\",\"age\":38,\"bio\":\"\"}\n\nCopy the \"pk\" value, which is the model's primary key, and make another request to get that customer:\n\n    $ curl \"http://localhost:8000/customer/01FM2G8EP38AVMH7PMTAJ123TA\"\n    {\"pk\":\"01FM2G8EP38AVMH7PMTAJ123TA\",\"first_name\":\"Andrew\",\"last_name\":\"Brookins\",\"email\":\"a@example.com\",\"join_date\":\"2020-01-02\",\"age\":38,\"bio\":\"\"}\n\nYou can also get a list of all customer PKs:\n\n    $ curl \"http://localhost:8000/customers\"\n    {\"customers\":[\"01FM2G8EP38AVMH7PMTAJ123TA\"]}\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis-developer%2Fredis-om-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredis-developer%2Fredis-om-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis-developer%2Fredis-om-fastapi/lists"}