{"id":24481098,"url":"https://github.com/brews/atoywebapi","last_synced_at":"2026-05-04T12:39:26.160Z","repository":{"id":271639003,"uuid":"914097391","full_name":"brews/atoywebapi","owner":"brews","description":"atoywebapi is a simple toy RESTful web API server written in Python with fastapi and sqlmodel.","archived":false,"fork":false,"pushed_at":"2025-03-21T23:09:03.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-31T06:32:11.592Z","etag":null,"topics":["application","container","example","fastapi","postgresql","python","restful-api","toy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brews.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}},"created_at":"2025-01-09T00:15:02.000Z","updated_at":"2025-03-21T23:09:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"04e3eaf3-4d71-4498-b083-12f00fcebcdf","html_url":"https://github.com/brews/atoywebapi","commit_stats":null,"previous_names":["brews/atoywebapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brews/atoywebapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brews%2Fatoywebapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brews%2Fatoywebapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brews%2Fatoywebapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brews%2Fatoywebapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brews","download_url":"https://codeload.github.com/brews/atoywebapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brews%2Fatoywebapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32608221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"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":["application","container","example","fastapi","postgresql","python","restful-api","toy"],"created_at":"2025-01-21T11:18:57.164Z","updated_at":"2026-05-04T12:39:26.155Z","avatar_url":"https://github.com/brews.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# atoywebapi\n\natoywebapi is a simple toy RESTful web API server written in Python with fastapi and sqlmodel.\n\nThe API does CRUD for facilities-level clean energy investments. The service is backed by a Postgresql database.\n\n\u003e [!CAUTION]\n\u003e This is a toy. Don't use any of this in production.\n\n\n## Examples\n\nYou can interact with the server through various HTTP requests, once the server and database are deployed and running.\n\nFrom a terminal shell, for example:\n\n```shell\n\nSERVER_URL=\"http://localhost:8080\"\n\n# Posts a facility\ncurl --location --request POST \"${SERVER_URL}/facilities/\" \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n  \"uid\": \"M.B.6K_TN.0\",\n  \"segment\": \"Manufacturing\",\n  \"company\": \"6K Energy\",\n  \"technology\": \"Batteries\",\n  \"subcategory\": \"EAM\",\n  \"investment_status\": \"U\",\n  \"latitude\": 35.606,\n  \"longitude\": -88.83,\n  \"estimated_investment\": 200438887,\n  \"announcement_date\": \"2023-04-18\"\n}'\n\n# Get what we just posted\ncurl --location --request GET \"${SERVER_URL}/facilities/M.B.6K_TN.0\"\n\n# Post another facility\ncurl --location --request POST \"${SERVER_URL}/facilities/\" \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n  \"uid\": \"M.B.ABB_VA.0\",\n  \"segment\": \"Manufacturing\",\n  \"company\": \"ABB Group\",\n  \"technology\": \"Batteries\",\n  \"subcategory\": \"Modules\",\n  \"investment_status\": \"O\",\n  \"latitude\": 37.63792,\n  \"longitude\": -77.39912,\n  \"estimated_investment\": 6013167,\n  \"announcement_date\": \"2023-06-19\"\n}'\n\n# What if you try to post something that already exists?\ncurl --location --request POST \"${SERVER_URL}/facilities/\" \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n  \"uid\": \"M.B.ABB_VA.0\",\n  \"segment\": \"Manufacturing\",\n  \"company\": \"ABB Group\",\n  \"technology\": \"Batteries\",\n  \"subcategory\": \"Modules\",\n  \"investment_status\": \"O\",\n  \"latitude\": 37.63792,\n  \"longitude\": -77.39912,\n  \"estimated_investment\": 6013167,\n  \"announcement_date\": \"2029-06-19\"\n}'\n# This ^ should get a 409 status code and details on the error.\n\n# Get list of all facilities posted.\ncurl --location --request GET \"${SERVER_URL}/facilities/\"\n\n# Get list of all facilities posted with segment of \"Manufacturing\".\ncurl --location --request GET \"${SERVER_URL}/facilities/?segment=Manufacturing\"\n\n# Get list of all facilities posted with segment of \"Bacon\".\ncurl --location --request GET \"${SERVER_URL}/facilities/?segment=Bacon\"\n\n# Get list of all facilities posted with announcement dates before and after a range.\ncurl --location --request GET \"${SERVER_URL}/facilities/?announced_after=2023-01-01\u0026announced_before=2023-06-01\"\n\n# Another example of getting a list of all facilities posted with announcement dates before and after a range.\ncurl --location --request GET \"${SERVER_URL}/facilities/?announced_after=2023-06-01\u0026announced_before=2024-12-25\"\n\n# Test limit option with pagination\ncurl --location --request GET \"${SERVER_URL}/facilities/?segment=Manufacturing\u0026limit=1\"\n\n# Test limit option with pagination, get the second page. Should be different from first page.\ncurl --location --request GET \"${SERVER_URL}/facilities/?segment=Manufacturing\u0026limit=1\u0026offset=1\"\n\n# Delete a facility\ncurl --location --request DELETE \"${SERVER_URL}/facilities/M.B.6K_TN.0\"\n# It should no longer exist here...\ncurl --location --request GET \"${SERVER_URL}/facilities/M.B.6K_TN.0\"\n```\n\nYou can also view GET requests from the comfort of your browser. For example:\nhttp://localhost:8080/facilities/?segment=Manufacturing\u0026announced_after=2023-12-23\u0026limit=1000\n\nSee Swagger/OpenAPI documentation at http://localhost:8080/docs\n\n\n## Getting things running\n\nYou can run the server and database locally with Docker Compose:\n\n```\ndocker compose up\n```\n\ngets everything up. And you can interact with the server as described above in [Examples](#examples).\n\nTo tear things down, run\n\n```\ndocker compose down\n```\n\nThis also removes data stored in the backing database.\n\n## Support\nSource code is available online at https://github.com/brews/atoywebapi/. This software is Open Source and available under the Apache License, Version 2.0.\n\nPlease file bugs in the [bug tracker](https://github.com/brews/atoywebapi/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrews%2Fatoywebapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrews%2Fatoywebapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrews%2Fatoywebapi/lists"}