tipg


Nametipg JSON
Version 0.8.0 PyPI version JSON
download
home_pageNone
SummarySimple and Fast Geospatial OGC Features and Tiles API for PostGIS.
upload_time2024-10-17 21:30:18
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2022 Development Seed Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords fastapi ogc features ogc tiles postgis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/10407788/204477834-2533241a-5927-4f56-959e-4e8494027bc0.png"/>
  <p align="center">Simple and Fast Geospatial OGC Features and Tiles API for PostGIS.</p>
</p>
<p align="center">
  <a href="https://github.com/developmentseed/tipg/actions?query=workflow%3ACI" target="_blank">
      <img src="https://github.com/developmentseed/tipg/workflows/CI/badge.svg" alt="Test">
  </a>
  <a href="https://codecov.io/gh/developmentseed/tipg" target="_blank">
      <img src="https://codecov.io/gh/developmentseed/tipg/branch/main/graph/badge.svg" alt="Coverage">
  </a>
  <a href="https://pypi.org/project/tipg" target="_blank">
      <img src="https://img.shields.io/pypi/v/tipg?color=%2334D058&label=pypi%20package" alt="Package version">
  </a>
  <a href="https://github.com/developmentseed/tipg/blob/main/LICENSE" target="_blank">
      <img src="https://img.shields.io/github/license/developmentseed/tipg.svg" alt="License">
  </a>
</p>

---

**Documentation**: <a href="https://developmentseed.org/tipg/" target="_blank">https://developmentseed.org/tipg/</a>

**Source Code**: <a href="https://github.com/developmentseed/tipg" target="_blank">https://github.com/developmentseed/tipg</a>

---

`tipg`, pronounced *T[ee]pg*, is a **Python** package that helps create lightweight OGC **Features** and **Tiles** API with a PostGIS Database backend. The API has been designed for [OGC Features](https://ogcapi.ogc.org/features) and [OGC Tiles](https://ogcapi.ogc.org/tiles/) specifications.

> **Note**
> This project is the result of the merge between [tifeatures](https://github.com/developmentseed/tifeatures) and [timvt](https://github.com/developmentseed/timvt).

## Install

```bash
$ python -m pip install pip -U
$ python -m pip install tipg

# or from source
$ git clone https://github.com/developmentseed/tipg.git
$ cd tipg
$ python -m pip install -e .
```

## OGC Specifications

Specification | Status | link |
|          -- |     -- |   -- |
OGC Common Part 1: Core                |  ✅ | https://docs.ogc.org/DRAFTS/19-072.html
OGC Common Part 2: Geospatial Data     |  ✅ | http://docs.ogc.org/DRAFTS/20-024.html
OGC Features Part 1: Core              |  ✅ | https://docs.ogc.org/is/17-069r4/17-069r4.html
OGC Features Part 2: CRS by Reference  |  ❌ | https://docs.ogc.org/is/18-058r1/18-058r1.html
OGC Features Part 3: Filtering / CQL2  |  ✅ | https://docs.ogc.org/DRAFTS/19-079r1.html
OGC Tiles Part 1: Core                 |  ✅ | https://docs.ogc.org/is/20-057/20-057.html

Notes:

We chose to avoid implementing the second part of the specification to prevent the introduction of CRS-based GeoJSON. We may review this decision in the future.

While we tried to follow OGC specifications to the letter, some API endpoints might have more capabilities (e.g., geometry column selection).

## PostGIS/PostgreSQL

`tipg` relies greatly on PostGIS' `ST_*` functions. PostGIS must be installed on your PostgreSQL database.

```sql
SELECT name, default_version,installed_version
FROM pg_available_extensions WHERE name LIKE 'postgis%' or name LIKE 'address%';
```

```sql
CREATE EXTENSION postgis;
```

### Configuration

To be able to work, the application will need access to the database. `tipg` uses [Starlette](https://www.starlette.io/config/)'s configuration pattern, which makes use of environment variables or a `.env` file to pass variables to the application.

An example of a `.env` file can be found in [.env.example](https://github.com/developmentseed/tipg/blob/main/.env.example)

```
# you need to define the DATABASE_URL directly
DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis
```

More info about configuration options at https://developmentseed.org/tipg/user_guide/configuration/

## Launch

```bash
$ pip install uvicorn

# Set your PostGIS database instance URL in the environment
$ export DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis
$ uvicorn tipg.main:app

# or using Docker

$ docker-compose up app
```

<p align="center">
  <img width="700" src="https://github.com/developmentseed/tipg/assets/10407788/e68ff285-8073-4715-9280-63aa3b67e4cf">
  <img width="700" src="https://github.com/developmentseed/tipg/assets/10407788/ffd95cf0-22f9-4a98-9682-bc9324c0868b">
  <img width="700" src="https://github.com/developmentseed/tipg/assets/10407788/9b02371f-49b9-462f-bec0-a2546ea4ec07">
  <img width="700" src="https://github.com/developmentseed/tipg/assets/10407788/3babe432-bb19-4cf0-a808-cbacd997a9a7">
  <img width="700" src="https://github.com/developmentseed/tipg/assets/10407788/2f16dc77-e82a-4756-b528-fb1544ccb9bc">
  <img width="700" src="https://github.com/developmentseed/tipg/assets/10407788/989b3a58-8cd2-46db-bf53-e60609dd82ba">
  <img width="700" src="https://github.com/developmentseed/tipg/assets/10407788/46d9acb0-465d-470d-bdae-2999b47ad65f">
  <img width="700" src="https://github.com/developmentseed/tipg/assets/10407788/d4a079d0-069a-4399-9b56-307fbba5e383">
  <img width="700" src="https://github.com/developmentseed/tipg/assets/10407788/17494573-da43-4fd5-81f9-1cfb4e8c91f2">
</p>


## Docker images

We are publishing two different docker images on `tag` and on every commit to `main` branch:

| | Gunicorn | Uvicorn |
|          -- |     -- |   -- |
main commit | `ghcr.io/developmentseed/tipg:latest` | `ghcr.io/developmentseed/tipg:uvicorn-latest`
tags | `ghcr.io/developmentseed/tipg:0.0.0` | `ghcr.io/developmentseed/tipg:uvicorn-0.0.0`
dockerfile | [/dockerfiles/Dockerfile.gunicorn](https://github.com/developmentseed/tipg/blob/main/dockerfiles/Dockerfile.gunicorn) | [/dockerfiles/Dockerfile.uvicorn](https://github.com/developmentseed/tipg/blob/main/dockerfiles/Dockerfile.uvicorn)

See all version at https://github.com/developmentseed/tipg/pkgs/container/tipg

```
# Gunicorn image
$ docker run \
    -p 8081:8081 \
    -e PORT=8081 \
    -e DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis \
    ghcr.io/developmentseed/tipg:latest

# or Uvicorn image
$ docker run \
    -p 8081:8081 \
    -e PORT=8081 \
    -e DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis \
    ghcr.io/developmentseed/tipg:uvicorn-latest
```

Note: If you are planning to use the docker image in a kubernetes deployment you may want to use the `uvicorn` image (ref: https://fastapi.tiangolo.com/deployment/server-workers/).

## Contribution & Development

See [CONTRIBUTING.md](https://github.com/developmentseed/tipg/blob/main/CONTRIBUTING.md)

## License

See [LICENSE](https://github.com/developmentseed/tipg/blob/main/LICENSE)

## Authors

Created by [Development Seed](<http://developmentseed.org>)

## Changes

See [CHANGES.md](https://github.com/developmentseed/tipg/blob/main/CHANGES.md).


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tipg",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "FastAPI, OGC Features, OGC Tiles, POSTGIS",
    "author": null,
    "author_email": "Vincent Sarago <vincent@developmentseed.org>, David Bitner <david@developmentseed.org>",
    "download_url": "https://files.pythonhosted.org/packages/24/87/ab6ee219fdbac1f4706422c8eb98b4550572433af2478f9b34ebd9e2f4d8/tipg-0.8.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img width=\"500\" src=\"https://user-images.githubusercontent.com/10407788/204477834-2533241a-5927-4f56-959e-4e8494027bc0.png\"/>\n  <p align=\"center\">Simple and Fast Geospatial OGC Features and Tiles API for PostGIS.</p>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/developmentseed/tipg/actions?query=workflow%3ACI\" target=\"_blank\">\n      <img src=\"https://github.com/developmentseed/tipg/workflows/CI/badge.svg\" alt=\"Test\">\n  </a>\n  <a href=\"https://codecov.io/gh/developmentseed/tipg\" target=\"_blank\">\n      <img src=\"https://codecov.io/gh/developmentseed/tipg/branch/main/graph/badge.svg\" alt=\"Coverage\">\n  </a>\n  <a href=\"https://pypi.org/project/tipg\" target=\"_blank\">\n      <img src=\"https://img.shields.io/pypi/v/tipg?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n  </a>\n  <a href=\"https://github.com/developmentseed/tipg/blob/main/LICENSE\" target=\"_blank\">\n      <img src=\"https://img.shields.io/github/license/developmentseed/tipg.svg\" alt=\"License\">\n  </a>\n</p>\n\n---\n\n**Documentation**: <a href=\"https://developmentseed.org/tipg/\" target=\"_blank\">https://developmentseed.org/tipg/</a>\n\n**Source Code**: <a href=\"https://github.com/developmentseed/tipg\" target=\"_blank\">https://github.com/developmentseed/tipg</a>\n\n---\n\n`tipg`, pronounced *T[ee]pg*, is a **Python** package that helps create lightweight OGC **Features** and **Tiles** API with a PostGIS Database backend. The API has been designed for [OGC Features](https://ogcapi.ogc.org/features) and [OGC Tiles](https://ogcapi.ogc.org/tiles/) specifications.\n\n> **Note**\n> This project is the result of the merge between [tifeatures](https://github.com/developmentseed/tifeatures) and [timvt](https://github.com/developmentseed/timvt).\n\n## Install\n\n```bash\n$ python -m pip install pip -U\n$ python -m pip install tipg\n\n# or from source\n$ git clone https://github.com/developmentseed/tipg.git\n$ cd tipg\n$ python -m pip install -e .\n```\n\n## OGC Specifications\n\nSpecification | Status | link |\n|          -- |     -- |   -- |\nOGC Common Part 1: Core                |  \u2705 | https://docs.ogc.org/DRAFTS/19-072.html\nOGC Common Part 2: Geospatial Data     |  \u2705 | http://docs.ogc.org/DRAFTS/20-024.html\nOGC Features Part 1: Core              |  \u2705 | https://docs.ogc.org/is/17-069r4/17-069r4.html\nOGC Features Part 2: CRS by Reference  |  \u274c | https://docs.ogc.org/is/18-058r1/18-058r1.html\nOGC Features Part 3: Filtering / CQL2  |  \u2705 | https://docs.ogc.org/DRAFTS/19-079r1.html\nOGC Tiles Part 1: Core                 |  \u2705 | https://docs.ogc.org/is/20-057/20-057.html\n\nNotes:\n\nWe chose to avoid implementing the second part of the specification to prevent the introduction of CRS-based GeoJSON. We may review this decision in the future.\n\nWhile we tried to follow OGC specifications to the letter, some API endpoints might have more capabilities (e.g., geometry column selection).\n\n## PostGIS/PostgreSQL\n\n`tipg` relies greatly on PostGIS' `ST_*` functions. PostGIS must be installed on your PostgreSQL database.\n\n```sql\nSELECT name, default_version,installed_version\nFROM pg_available_extensions WHERE name LIKE 'postgis%' or name LIKE 'address%';\n```\n\n```sql\nCREATE EXTENSION postgis;\n```\n\n### Configuration\n\nTo be able to work, the application will need access to the database. `tipg` uses [Starlette](https://www.starlette.io/config/)'s configuration pattern, which makes use of environment variables or a `.env` file to pass variables to the application.\n\nAn example of a `.env` file can be found in [.env.example](https://github.com/developmentseed/tipg/blob/main/.env.example)\n\n```\n# you need to define the DATABASE_URL directly\nDATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis\n```\n\nMore info about configuration options at https://developmentseed.org/tipg/user_guide/configuration/\n\n## Launch\n\n```bash\n$ pip install uvicorn\n\n# Set your PostGIS database instance URL in the environment\n$ export DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis\n$ uvicorn tipg.main:app\n\n# or using Docker\n\n$ docker-compose up app\n```\n\n<p align=\"center\">\n  <img width=\"700\" src=\"https://github.com/developmentseed/tipg/assets/10407788/e68ff285-8073-4715-9280-63aa3b67e4cf\">\n  <img width=\"700\" src=\"https://github.com/developmentseed/tipg/assets/10407788/ffd95cf0-22f9-4a98-9682-bc9324c0868b\">\n  <img width=\"700\" src=\"https://github.com/developmentseed/tipg/assets/10407788/9b02371f-49b9-462f-bec0-a2546ea4ec07\">\n  <img width=\"700\" src=\"https://github.com/developmentseed/tipg/assets/10407788/3babe432-bb19-4cf0-a808-cbacd997a9a7\">\n  <img width=\"700\" src=\"https://github.com/developmentseed/tipg/assets/10407788/2f16dc77-e82a-4756-b528-fb1544ccb9bc\">\n  <img width=\"700\" src=\"https://github.com/developmentseed/tipg/assets/10407788/989b3a58-8cd2-46db-bf53-e60609dd82ba\">\n  <img width=\"700\" src=\"https://github.com/developmentseed/tipg/assets/10407788/46d9acb0-465d-470d-bdae-2999b47ad65f\">\n  <img width=\"700\" src=\"https://github.com/developmentseed/tipg/assets/10407788/d4a079d0-069a-4399-9b56-307fbba5e383\">\n  <img width=\"700\" src=\"https://github.com/developmentseed/tipg/assets/10407788/17494573-da43-4fd5-81f9-1cfb4e8c91f2\">\n</p>\n\n\n## Docker images\n\nWe are publishing two different docker images on `tag` and on every commit to `main` branch:\n\n| | Gunicorn | Uvicorn |\n|          -- |     -- |   -- |\nmain commit | `ghcr.io/developmentseed/tipg:latest` | `ghcr.io/developmentseed/tipg:uvicorn-latest`\ntags | `ghcr.io/developmentseed/tipg:0.0.0` | `ghcr.io/developmentseed/tipg:uvicorn-0.0.0`\ndockerfile | [/dockerfiles/Dockerfile.gunicorn](https://github.com/developmentseed/tipg/blob/main/dockerfiles/Dockerfile.gunicorn) | [/dockerfiles/Dockerfile.uvicorn](https://github.com/developmentseed/tipg/blob/main/dockerfiles/Dockerfile.uvicorn)\n\nSee all version at https://github.com/developmentseed/tipg/pkgs/container/tipg\n\n```\n# Gunicorn image\n$ docker run \\\n    -p 8081:8081 \\\n    -e PORT=8081 \\\n    -e DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis \\\n    ghcr.io/developmentseed/tipg:latest\n\n# or Uvicorn image\n$ docker run \\\n    -p 8081:8081 \\\n    -e PORT=8081 \\\n    -e DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis \\\n    ghcr.io/developmentseed/tipg:uvicorn-latest\n```\n\nNote: If you are planning to use the docker image in a kubernetes deployment you may want to use the `uvicorn` image (ref: https://fastapi.tiangolo.com/deployment/server-workers/).\n\n## Contribution & Development\n\nSee [CONTRIBUTING.md](https://github.com/developmentseed/tipg/blob/main/CONTRIBUTING.md)\n\n## License\n\nSee [LICENSE](https://github.com/developmentseed/tipg/blob/main/LICENSE)\n\n## Authors\n\nCreated by [Development Seed](<http://developmentseed.org>)\n\n## Changes\n\nSee [CHANGES.md](https://github.com/developmentseed/tipg/blob/main/CHANGES.md).\n\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2022 Development Seed\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "Simple and Fast Geospatial OGC Features and Tiles API for PostGIS.",
    "version": "0.8.0",
    "project_urls": {
        "Documentation": "https://developmentseed.org/tipg/",
        "Homepage": "https://developmentseed.org/tipg",
        "Source": "https://github.com/developmentseed/tipg"
    },
    "split_keywords": [
        "fastapi",
        " ogc features",
        " ogc tiles",
        " postgis"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e8908ec8f7e8652828c509b221999b5a08d16852857dad12c49f95602022efed",
                "md5": "46f0527ec8271811e4554da2c4876df4",
                "sha256": "221b2d13c3920694950988b3fd411448755b6ad9dfb2bc5d0d023227e05cfbe3"
            },
            "downloads": -1,
            "filename": "tipg-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "46f0527ec8271811e4554da2c4876df4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 77479,
            "upload_time": "2024-10-17T21:30:20",
            "upload_time_iso_8601": "2024-10-17T21:30:20.203713Z",
            "url": "https://files.pythonhosted.org/packages/e8/90/8ec8f7e8652828c509b221999b5a08d16852857dad12c49f95602022efed/tipg-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2487ab6ee219fdbac1f4706422c8eb98b4550572433af2478f9b34ebd9e2f4d8",
                "md5": "4f62eb84fb3cc1361eb2db2c5c04f325",
                "sha256": "8b1ce4bcd07b3941e7cbc7ca9800c21ea2d1b3c1124815468affb789e8cc3c74"
            },
            "downloads": -1,
            "filename": "tipg-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4f62eb84fb3cc1361eb2db2c5c04f325",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 56674,
            "upload_time": "2024-10-17T21:30:18",
            "upload_time_iso_8601": "2024-10-17T21:30:18.308359Z",
            "url": "https://files.pythonhosted.org/packages/24/87/ab6ee219fdbac1f4706422c8eb98b4550572433af2478f9b34ebd9e2f4d8/tipg-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-17 21:30:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "developmentseed",
    "github_project": "tipg",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tipg"
}
        
Elapsed time: 0.32794s