1
1
<p align =" center " >
2
2
<img src =" https://github.com/radiantearth/stac-site/raw/master/images/logo/stac-030-long.png " width =400 >
3
- <p align =" center " >FastAPI implemention of the STAC API spec.</p >
3
+ <p align =" center " >FastAPI implemention of the STAC API spec using < a href = " https://github.com/stac-utils/pgstac " >PgSTAC</ a > .</p >
4
4
</p >
5
5
<p align =" center " >
6
- <a href =" https://github.com/stac-utils/stac-fastapi/actions?query=workflow%3Acicd " target =" _blank " >
7
- <img src="https://github.com/stac-utils/stac-fastapi/workflows/stac-fastapi/badge.svg" alt="Test">
6
+ <a href =" https://github.com/stac-utils/stac-fastapi-pgstac /actions?query=workflow%3Acicd " target =" _blank " >
7
+ <img src="https://github.com/stac-utils/stac-fastapi-pgstac /workflows/stac-fastapi-pgstac /badge.svg" alt="Test">
8
8
</a >
9
- <a href =" https://pypi.org/project/stac-fastapi " target =" _blank " >
10
- <img src="https://img.shields.io/pypi/v/stac-fastapi.api ?color=%2334D058 &label=pypi%20package" alt="Package version">
9
+ <a href =" https://pypi.org/project/stac-fastapi-pgstac " target =" _blank " >
10
+ <img src="https://img.shields.io/pypi/v/stac-fastapi-pgstac ?color=34D058 &label=pypi%20package" alt="Package version">
11
11
</a >
12
- <a href =" https://github.com/stac-utils/stac-fastapi/blob/master/LICENSE " target =" _blank " >
13
- <img src="https://img.shields.io/github/license /stac-utils/stac- fastapi.svg " alt="License">
12
+ <a href =" https://github.com/stac-utils/stac-fastapi-pgstac /blob/master/LICENSE " target =" _blank " >
13
+ <img src="https://img.shields.io/pypi/l /stac-fastapi-pgstac " alt="License">
14
14
</a >
15
15
</p >
16
16
17
17
---
18
18
19
- ** Documentation** : [ https://stac-utils.github.io/stac-fastapi/ ] ( https://stac-utils.github.io/stac-fastapi/ )
19
+ ** Documentation** : [ https://stac-utils.github.io/stac-fastapi-pgstac / ] ( https://stac-utils.github.io/stac-fastapi-pgstac / )
20
20
21
- ** Source Code** : [ https://github.com/stac-utils/stac-fastapi ] ( https://github.com/stac-utils/stac-fastapi )
21
+ ** Source Code** : [ https://github.com/stac-utils/stac-fastapi ] ( https://github.com/stac-utils/stac-fastapi-pgstac )
22
22
23
23
---
24
24
25
- Python library for building a STAC compliant FastAPI application. The project is split up into several namespace
26
- packages:
27
-
28
- - ** stac_fastapi.api** : An API layer which enforces the [ stac-api-spec] ( https://github.com/radiantearth/stac-api-spec ) .
29
- - ** stac_fastapi.extensions** : Abstract base classes for [ STAC API extensions] ( https://github.com/radiantearth/stac-api-spec/blob/master/extensions.md ) and third-party extensions.
30
- - ** stac_fastapi.types** : Shared types and abstract base classes used by the library.
31
-
32
- #### Backends
33
- - ** stac_fastapi.sqlalchemy** : Postgres backend implementation with sqlalchemy.
34
- - ** stac_fastapi.pgstac** : Postgres backend implementation with [ PGStac] ( https://github.com/stac-utils/pgstac ) .
25
+ PostgreSQL/PostGIS backend implementation for the [ stac-fastapi] ( https://github.com/stac-utils/stac-fastapi ) library.
35
26
36
27
` stac-fastapi ` was initially developed by [ arturo-ai] ( https://github.com/arturo-ai ) .
37
28
38
29
## Installation
39
30
40
31
``` bash
41
32
# Install from pypi.org
42
- pip install stac-fastapi.api stac-fastapi.types stac-fastapi.extensions
43
-
44
- # Install a backend of your choice
45
- pip install stac-fastapi.sqlalchemy
46
- # or
47
33
pip install stac-fastapi.pgstac
48
34
49
35
# /////////////////////
50
- # Install from sources
51
-
52
- git clone https://github.com/stac-utils/stac-fastapi.git && cd stac-fastapi
53
- pip install \
54
- -e stac_fastapi/api \
55
- -e stac_fastapi/types \
56
- -e stac_fastapi/extensions
57
-
58
- # Install a backend of your choice
59
- pip install -e stac_fastapi/sqlalchemy
60
- # or
61
- pip install -e stac_fastapi/pgstac
36
+ # Install from source
37
+
38
+ git clone https://github.com/stac-utils/stac-fastapi-pgstac.git && cd stac-fastapi-pgstac
39
+ pip install -e .
62
40
```
63
41
64
42
## Local Development
@@ -69,14 +47,12 @@ make image
69
47
make docker-run-all
70
48
```
71
49
72
- - The SQLAlchemy backend app will be available on < http://localhost:8081 > .
73
- - The PGStac backend app will be available on < http://localhost:8082 > .
50
+ - The app will be available on < http://localhost:8082 > .
74
51
75
- You can also launch only one of the applications with either of these commands :
52
+ You can also launch the application without ingesting the ` joplin ` example data :
76
53
77
54
``` shell
78
- make docker-run-pgstac
79
- make docker-run-sqlalchemy
55
+ make docker-run-app
80
56
```
81
57
82
58
The application will be started on < http://localhost:8080 > .
@@ -99,34 +75,16 @@ Before running the tests, ensure the database and apps run with docker-compose a
99
75
docker-compose down
100
76
```
101
77
102
- The database container provided by the docker-compose stack must be running. This can be started with:
103
-
104
- ``` shell
105
- make run-database
106
- ```
107
-
108
- To run tests for both the pgstac and sqlalchemy backends, execute:
78
+ To run tests:
109
79
110
80
``` shell
111
81
make test
112
82
```
113
83
114
- To only run pgstac backend tests:
115
-
116
- ``` shell
117
- make test-pgstac
118
- ```
119
-
120
- To only run sqlalchemy backend tests:
121
-
122
- ``` shell
123
- make test-sqlalchemy
124
- ```
125
-
126
84
Run individual tests by running pytest within a docker container:
127
85
128
86
``` shell
129
- make docker-shell-pgstac # or docker-shell-sqlalchemy
130
- $ pip install -e stac_fastapi/pgstac [dev]
131
- $ pytest -v stac_fastapi/pgstac/ tests/api/test_api.py
87
+ make docker-shell
88
+ $ pip install -e . [dev]
89
+ $ pytest -v tests/api/test_api.py
132
90
```
0 commit comments