{"id":42326567,"url":"https://github.com/dvrpc/link-api","last_synced_at":"2026-01-27T13:10:50.388Z","repository":{"id":189990834,"uuid":"681659087","full_name":"dvrpc/link-api","owner":"dvrpc","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-13T16:42:17.000Z","size":115,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-13T18:24:25.496Z","etag":null,"topics":["api"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvrpc.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-22T13:35:31.000Z","updated_at":"2025-11-13T16:42:21.000Z","dependencies_parsed_at":"2023-08-22T20:21:20.891Z","dependency_job_id":"9e1d11d4-a3a1-47c4-8ada-3317a851b089","html_url":"https://github.com/dvrpc/link-api","commit_stats":null,"previous_names":["dvrpc/connect-api","dvrpc/link-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dvrpc/link-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvrpc%2Flink-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvrpc%2Flink-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvrpc%2Flink-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvrpc%2Flink-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvrpc","download_url":"https://codeload.github.com/dvrpc/link-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvrpc%2Flink-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28813296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"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":["api"],"created_at":"2026-01-27T13:10:50.326Z","updated_at":"2026-01-27T13:10:50.379Z","avatar_url":"https://github.com/dvrpc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# link-api\n\n## Overview\nThis is an API for the [Link](https://github.com/dvrpc/link) react app. \nMost of the calls use SQLAlchemy models and schemas to access a Postgres DB, but the /analyze endpoint uses \nthe LTS Connectivity tool (linked below). \n\nIt uses: \n* FastAPI\n* Postgres (with PostGIS and PGrouting)\n* DVRPC's [LTS/sidewalk connectivity tool.](https://github.com/dvrpc/LTS_island_connectivity) \n* ogr2ogr\n \n\n## Setup/Installation\n\n#### 1. Install dependencies, if not installed. For postgres with extensions, consider using\n```shell\nsudo apt install postgresql-16-pgrouting\n```\nwhich will install PostgreSQL, PostGIS, and PGrouting. If you have postgres already, you need to install the other two individually. Setup any roles you want.\n\nYou also need ogr2ogr. For Linux:\n```shell\n  sudo apt install gdal-bin\n```\n\n#### 2. Create an empty virtual environment\n```shell\npython -m venv ve\n```\nThen activate the environment. \n```shell\n. ve/bin/activate\n```\n\n#### 3. Install the requirements with:\n```shell \npip install wheel \u0026\u0026 pip install -r requirements_base.txt\n```\n\n#### 4. Add a .env file \nCreate a .env file at the root of the project. An example is below, which contains a URI to a database.\n```\nDB_URI=postgresql://user:pw@host:port/db\n```\n\nYou may also alter the path by including a URL_ROOT variable (that starts with a `/`). If not included, it will not be used.\n```\nDB_URI=postgresql://user:pw@host:port/db\nURL_ROOT=/api\n```\n\n#### 5. Add config file for pg-data-etl\nYou'll need to add a configuration file for pg-data-etl at the root of this project. \nIt must be named 'database_connections.cfg', and should be formatted like this:\n\n\n```\n[localhost] \nhost = host\nun = postgres\npw = password\nport = port\ndb_name = db_name\n```\nDon't edit the localhost in brackets, as the script searches for it (see analyze endpoint) \nbut change all the other variables.\n\n#### 6. Import database backup\nIf you're putting this onto a remote server, you need to pipe a copy of the database from a machine that's behind the DVRPC firewall, as all of the data import and setup scripts can only be run behind the firewall, pulling from DVRPC's GIS postgres server.\nThe most recent backup can be found in 'G:\\Shared drives\\Bike LTS and Connectivity Analysis Webmap\\Rethinking Connectivity\\DB_Backups'. \n\nPipe a copy in with:\n```shell\npsql -U your_username -h your_host -p your_port -d target_database \u003c backup.sql  \n```\n\n## Usage\nStart the development server with\n```shell\ncd app\nuvicorn main:app --reload\n```\nSee what API calls are supported by visiting [localhost:8000/docs](localhost:8000/docs). (Note that if you set `URL_ROOT`, this would be different, e.g. a `URL_ROOT` of `/api ` would result in [localhost:8000/api/docs](localhost:8000/api/docs)). \n\n\n## License\nThe project uses the GPL 3.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvrpc%2Flink-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvrpc%2Flink-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvrpc%2Flink-api/lists"}