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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: udata-hydra-csvapi
3
- Version: 0.3.2.dev11
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 Infrastructure**
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
- Start the test CSV database and test PostgREST container:
51
+ **Option A – All in Docker (easiest for running locally):**
41
52
  ```shell
42
53
  docker compose --profile test up -d
43
54
  ```
44
- The `--profile test` flag tells Docker Compose to start the PostgREST and PostgreSQL services for the test CSV database. This starts PostgREST on port 8080, connecting to the test CSV database. You can access the raw PostgREST API on http://localhost:8080.
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
- 2. **Launch the main API proxy**
47
-
48
- Install dependencies and start the proxy services:
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 # Api related to apified CSV files by udata-hydra (dev server)
52
- uv run adev runserver -p8006 api_tabular/metrics/app.py # Api related to udata's metrics (dev server)
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 main API provides a controlled layer over PostgREST - exposing PostgREST directly would be too permissive, so this adds a security and access control layer.
85
+ The API provides a controlled layer over PostgREST (security and access control); exposing PostgREST directly would be too permissive.
73
86
 
74
- 3. **Test the API**
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.2.dev11.dist-info/licenses/LICENSE,sha256=fb-HAYw94ffh--z1cZrWbpk6YKM0p9WFG7kdd0K7uGQ,1062
20
- udata_hydra_csvapi-0.3.2.dev11.dist-info/METADATA,sha256=lXWF7fYmcYSjCifS9tpH3Wyep-08wbK73zMcbocu6FM,20386
21
- udata_hydra_csvapi-0.3.2.dev11.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
22
- udata_hydra_csvapi-0.3.2.dev11.dist-info/top_level.txt,sha256=MAaK09hxwPhIBBC0i1TdEBAgdu3W_gXnAZqk767gVak,12
23
- udata_hydra_csvapi-0.3.2.dev11.dist-info/RECORD,,
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,,