udata-hydra-csvapi 0.3.2.dev11__py3-none-any.whl → 0.3.3.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {udata_hydra_csvapi-0.3.2.dev11.dist-info → udata_hydra_csvapi-0.3.3.dev1.dist-info}/METADATA +25 -12
- {udata_hydra_csvapi-0.3.2.dev11.dist-info → udata_hydra_csvapi-0.3.3.dev1.dist-info}/RECORD +5 -5
- {udata_hydra_csvapi-0.3.2.dev11.dist-info → udata_hydra_csvapi-0.3.3.dev1.dist-info}/WHEEL +0 -0
- {udata_hydra_csvapi-0.3.2.dev11.dist-info → udata_hydra_csvapi-0.3.3.dev1.dist-info}/licenses/LICENSE +0 -0
- {udata_hydra_csvapi-0.3.2.dev11.dist-info → udata_hydra_csvapi-0.3.3.dev1.dist-info}/top_level.txt +0 -0
{udata_hydra_csvapi-0.3.2.dev11.dist-info → udata_hydra_csvapi-0.3.3.dev1.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: udata-hydra-csvapi
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3.dev1
|
|
4
4
|
Summary: API for CSV converted by udata-hydra
|
|
5
5
|
Author-email: "data.gouv.fr" <opendatateam@data.gouv.fr>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -33,26 +33,39 @@ The production API is deployed on data.gouv.fr infrastructure at [`https://tabul
|
|
|
33
33
|
- **[uv](https://docs.astral.sh/uv/)** for dependency management
|
|
34
34
|
- **Docker & Docker Compose**
|
|
35
35
|
|
|
36
|
+
### Docker Compose profiles
|
|
37
|
+
|
|
38
|
+
| Profile | Use when | Services started |
|
|
39
|
+
|----------|----------|------------------|
|
|
40
|
+
| **test** | Run locally with the test database (PostgreSQL + PostgREST + optional Tabular API + Metrics API in Docker) | `postgres-test`, `postgrest-test`, `tabular-api`, `metrics-api` |
|
|
41
|
+
| **hydra** | Use a real Hydra CSV database; PostgREST only in Docker, run the API with uv on the host | `postgrest` |
|
|
42
|
+
|
|
43
|
+
**Run everything locally in Docker:** `docker compose --profile test up -d` → Tabular API at http://localhost:8005, Metrics API at http://localhost:8006, PostgREST at http://localhost:8080.
|
|
44
|
+
|
|
36
45
|
### 🧪 Run with a test database
|
|
37
46
|
|
|
38
|
-
1. **Start the
|
|
47
|
+
1. **Start the stack**
|
|
48
|
+
|
|
49
|
+
With the **test** profile, you can either run the full stack in Docker (recommended for a quick local run) or only the infrastructure and run the API with uv (for development with hot reload).
|
|
39
50
|
|
|
40
|
-
|
|
51
|
+
**Option A – All in Docker (easiest for running locally):**
|
|
41
52
|
```shell
|
|
42
53
|
docker compose --profile test up -d
|
|
43
54
|
```
|
|
44
|
-
|
|
55
|
+
This starts the test PostgreSQL, PostgREST, Tabular API (port 8005), and Metrics API (port 8006). You can use the APIs at http://localhost:8005 and http://localhost:8006.
|
|
45
56
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
**Option B – Only infrastructure in Docker, API with uv (for development):**
|
|
58
|
+
```shell
|
|
59
|
+
docker compose --profile test up -d postgres-test postgrest-test
|
|
60
|
+
```
|
|
61
|
+
PostgREST is available at http://localhost:8080. Then start the API proxy on the host:
|
|
49
62
|
```shell
|
|
50
63
|
uv sync
|
|
51
|
-
uv run adev runserver -p8005 api_tabular/tabular/app.py #
|
|
52
|
-
uv run adev runserver -p8006 api_tabular/metrics/app.py
|
|
64
|
+
uv run adev runserver -p8005 api_tabular/tabular/app.py # Tabular API (dev server)
|
|
65
|
+
uv run adev runserver -p8006 api_tabular/metrics/app.py # Metrics API (dev server)
|
|
53
66
|
```
|
|
54
67
|
|
|
55
|
-
**Note:** For production, use gunicorn with aiohttp worker:
|
|
68
|
+
**Note:** For production (on the host), use gunicorn with aiohttp worker:
|
|
56
69
|
```shell
|
|
57
70
|
# Tabular API (port 8005)
|
|
58
71
|
uv run gunicorn api_tabular.tabular.app:app_factory \
|
|
@@ -69,9 +82,9 @@ The production API is deployed on data.gouv.fr infrastructure at [`https://tabul
|
|
|
69
82
|
--access-logfile -
|
|
70
83
|
```
|
|
71
84
|
|
|
72
|
-
The
|
|
85
|
+
The API provides a controlled layer over PostgREST (security and access control); exposing PostgREST directly would be too permissive.
|
|
73
86
|
|
|
74
|
-
|
|
87
|
+
2. **Test the API**
|
|
75
88
|
|
|
76
89
|
Query the API using a `resource_id`. Several test resources are available in the fake database:
|
|
77
90
|
|
|
@@ -16,8 +16,8 @@ api_tabular/metrics/app.py,sha256=JY7GZSqCsihEcQy7SFTiKqvoyxfGRFaJ48CovNQTq4Y,44
|
|
|
16
16
|
api_tabular/tabular/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
api_tabular/tabular/app.py,sha256=tbf1Ni_r_bbeivxlMNllVKRoqpajZId6SiurCn1hTas,6645
|
|
18
18
|
api_tabular/tabular/utils.py,sha256=BL2nl04-3imBQG-RZiYvVMjxoBORi4lwrKq8NiWecLY,4487
|
|
19
|
-
udata_hydra_csvapi-0.3.
|
|
20
|
-
udata_hydra_csvapi-0.3.
|
|
21
|
-
udata_hydra_csvapi-0.3.
|
|
22
|
-
udata_hydra_csvapi-0.3.
|
|
23
|
-
udata_hydra_csvapi-0.3.
|
|
19
|
+
udata_hydra_csvapi-0.3.3.dev1.dist-info/licenses/LICENSE,sha256=fb-HAYw94ffh--z1cZrWbpk6YKM0p9WFG7kdd0K7uGQ,1062
|
|
20
|
+
udata_hydra_csvapi-0.3.3.dev1.dist-info/METADATA,sha256=yl3877grTSX2NMHGDX3jhLi3A6aMUfOszqYUGve9bCc,21210
|
|
21
|
+
udata_hydra_csvapi-0.3.3.dev1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
22
|
+
udata_hydra_csvapi-0.3.3.dev1.dist-info/top_level.txt,sha256=MAaK09hxwPhIBBC0i1TdEBAgdu3W_gXnAZqk767gVak,12
|
|
23
|
+
udata_hydra_csvapi-0.3.3.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{udata_hydra_csvapi-0.3.2.dev11.dist-info → udata_hydra_csvapi-0.3.3.dev1.dist-info}/top_level.txt
RENAMED
|
File without changes
|