{"id":13856718,"url":"https://github.com/iwpnd/fastapi-tile38","last_synced_at":"2025-03-20T08:33:06.701Z","repository":{"id":37934542,"uuid":"358386657","full_name":"iwpnd/fastapi-tile38","owner":"iwpnd","description":"Interact with Tile38 in-memory geodatabase in your FastAPI","archived":false,"fork":false,"pushed_at":"2025-03-12T08:37:22.000Z","size":1016,"stargazers_count":22,"open_issues_count":5,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T09:35:38.585Z","etag":null,"topics":["fastapi","fastapi-crud","fastapi-template","pyle38","tile38"],"latest_commit_sha":null,"homepage":"","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/iwpnd.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-15T20:38:16.000Z","updated_at":"2025-03-12T08:37:26.000Z","dependencies_parsed_at":"2023-02-15T09:46:16.911Z","dependency_job_id":"ac101998-bc49-4073-9912-6805d8b2e623","html_url":"https://github.com/iwpnd/fastapi-tile38","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwpnd%2Ffastapi-tile38","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwpnd%2Ffastapi-tile38/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwpnd%2Ffastapi-tile38/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwpnd%2Ffastapi-tile38/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iwpnd","download_url":"https://codeload.github.com/iwpnd/fastapi-tile38/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066237,"owners_count":20392405,"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":["fastapi","fastapi-crud","fastapi-template","pyle38","tile38"],"created_at":"2024-08-05T03:01:10.492Z","updated_at":"2025-03-20T08:33:06.405Z","avatar_url":"https://github.com/iwpnd.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003eFastAPI-Tile38\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Showcase using Tile38 via pyle38 in a FastAPI application.\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/iwpnd/fastapi-tile38/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/iwpnd/fastapi-tile38/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003e\u003ch2 style=\"display: inline-block\"\u003eTable of Contents\u003c/h2\u003e\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=\"#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=\"#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\u003c!-- ABOUT THE PROJECT --\u003e\n\n## About The Project\n\nShowcase of using [Tile38](https://github.com/tidwall/tile38) with [Pyle38](https://github.com/iwpnd/pyle38) in a [FastAPI](https://github.com/tiangolo/fastapi)\napplication. Can be used as is, or be extended upon with other methods in the [pyle38 repertoire](https://github.com/iwpnd/pyle38#commands) of commands.\n\n### Built With\n\n-   [FastAPI](https://github.com/tiangolo/fastapi)\n-   [Pyle38](https://github.com/iwpnd/pyle38)\n-   [Tile38](https://github.com/tidwall/tile38)\n-   [pydantic](https://github.com/samuelcolvin/pydantic/)\n\n\u003c!-- GETTING STARTED --\u003e\n\n## Getting Started\n\n### Installation\n\n1. Clone and install\n    ```sh\n    git clone https://github.com/iwpnd/fastapi-tile38.git\n    poetry install\n    ```\n2. Setup environment\n    ```sh\n    cp .env.dist .env\n    ```\n3. Start your local stack\n    ```python\n    docker-compose up\n    ```\n4. Test it!\n    ```sh\n    pytest . -vv -s\n    ```\n\n## Usage\n\nOnce the application is started you can checkout and interact with it via on [localhost:8001/docs](http://localhost:8001/docs).\n\nOr you can use it with [http](https://httpie.io/)/[curl](https://curl.se/):\n\n```sh\necho '{ \"data\": { \"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [13.37, 52.25]}, \"properties\": {\"id\": \"truck\"}}}' \\\n      | http post http://localhost:8001/vehicle x-api-key:test\n\n\u003e {\n    \"elapsed\": \"37.5µs\",\n    \"ok\": true\n}\n\n\nhttp get http://localhost:8001/search/within lat==52.25 lon==13.37 radius==1000 \\\n  x-api-key:test\n\n\u003e {\n    \"data\": [\n        {\n            \"id\": \"truck\",\n            \"object\": {\n                \"geometry\": {\n                    \"coordinates\": [\n                        13.37,\n                        52.25\n                    ],\n                    \"type\": \"Point\"\n                },\n                \"properties\": {\n                    \"id\": \"truck\"\n                },\n                \"type\": \"Feature\"\n            }\n        }\n    ]\n}\n```\n\nOr you use it with [httpx](https://www.python-httpx.org/)/[requests](https://docs.python-requests.org/en/master/):\n\n```python\nimport httpx\n\nvehicle = {\n    \"type\": \"Feature\",\n    \"geometry\": {\"type\": \"Point\", \"coordinates\": [13.37, 52.25]},\n    \"properties\": {\"id\": \"truck\"},\n}\n\n# store a vehicle\nr = httpx.post(\n      url=\"http://localhost:8001/vehicle\",\n      headers={\"x-api-key\":\"test\"},\n      json={\"data\": vehicle}\n      )\n\nprint(r.json())\n\n\u003e {\n    \"elapsed\": \"70.8µs\",\n    \"ok\": true\n}\n\n# get vehicle in a radius around a location\nr = httpx.get(\n      url=\"http://localhost:8001/search/within\",\n      headers={\"x-api-key\":\"test\"},\n      params={\"lat\":52.25,\"lon\":13.37,\"radius\":1000}\n      )\n\nprint(r.json())\n\n\u003e {\n    \"data\": [\n        {\n            \"id\": \"truck\",\n            \"object\": {\n                \"geometry\": {\n                    \"coordinates\": [\n                        13.37,\n                        52.25\n                    ],\n                    \"type\": \"Point\"\n                },\n                \"properties\": {\n                    \"id\": \"truck\"\n                },\n                \"type\": \"Feature\"\n            }\n        }\n    ]\n}\n```\n\nYou get the idea. And can use the rest.\n\nInputs are being validated at runtime with [pydantic](https://pydantic-docs.helpmanual.io/).\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003c!-- CONTACT --\u003e\n\n## Contact\n\nBenjamin Ramser - [@imwithpanda](https://twitter.com/imwithpanda) - ahoi@iwpnd.pw  \nProject Link: [https://github.com/iwpnd/fastapi-tile38](https://github.com/iwpnd/fastapi-tile38)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwpnd%2Ffastapi-tile38","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiwpnd%2Ffastapi-tile38","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwpnd%2Ffastapi-tile38/lists"}