Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Api-tabular

This connects to udata-hydra and serves the converted CSVs as an API.

Run locally

Start udata-hydra via docker compose.

Launch this project:

docker compose up

You can now access the raw postgrest API on http://localhost:8080.

Now you can launch the proxy (ie the app):

poetry install
poetry run adev runserver -p8005 api_tabular/app.py        # Api related to apified CSV files by udata-hydra
poetry run adev runserver -p8005 api_tabular/metrics.py    # Api related to udata's metrics

And query postgrest via the proxy using a resource_id, cf below. Test resource_id is 27d469ff-9908-4b7e-a2e0-9439bb38a395

API

Meta informations on resource

curl http://localhost:8005/api/resources/27d469ff-9908-4b7e-a2e0-9439bb38a395/
{
  "created_at": "2023-02-11T11:44:03.875615+00:00",
  "url": "https://data.toulouse-metropole.fr//explore/dataset/boulodromes/download?format=csv&timezone=Europe/Berlin&use_labels_for_header=false",
  "links": [
    {
      "href": "/api/resources/27d469ff-9908-4b7e-a2e0-9439bb38a395/profile/",
      "type": "GET",
      "rel": "profile"
    },
    {
      "href": "/api/resources/27d469ff-9908-4b7e-a2e0-9439bb38a395/data/",
      "type": "GET",
      "rel": "data"
    }
  ]
}

Profile (csv-detective output) for a resource

curl http://localhost:8005/api/resources/27d469ff-9908-4b7e-a2e0-9439bb38a395/profile/
{
  "profile": {
    "header": [
        "geo_point_2d",
        "geo_shape",
        "ins_nom",
        "ins_complexe_nom_cplmt",
        "ins_codepostal",
        "secteur",
        "..."
    ]
  },
  "...": "..."
}

Data for a resource (ie resource API)

curl http://localhost:8005/api/resources/27d469ff-9908-4b7e-a2e0-9439bb38a395/data/
{
  "data": [
    {
      "__id": 1,
      "geo_point_2d": "43.58061543292057,1.401751073689455",
      "geo_shape": {
        "coordinates": [
          [
              1.401751073689455,
              43.58061543292057
            ]
          ],
          "type": "MultiPoint"
        },
      "ins_nom": "BOULODROME LOU BOSC",
      "ins_complexe_nom_cplmt": "COMPLEXE SPORTIF DU MIRAIL",
      "ins_codepostal": 31100,
      "secteur": "Toulouse Ouest",
      "quartier": 6.3,
      "acces_libre": null,
      "ins_nb_equ": 1,
      "ins_detail_equ": "",
      "ins_complexe_nom": "",
      "ins_adresse": "",
      "ins_commune": "",
      "acces_public_horaires": null,
      "acces_club_scol": null,
      "ins_nom_cplmt": "",
      "ins_id_install": ""
    }
  ],
  "links": {
    "next": "/api/resources/60963939-6ada-46bc-9a29-b288b16d969b/data/?page=2&page_size=1",
    "prev": null,
    "profile": "/api/resources/60963939-6ada-46bc-9a29-b288b16d969b/profile/"
  },
  "meta": {"page": 1, "page_size": 1, "total": 2}
}

This endpoint can be queried with the following operators as query string:

# sort by column
column_name__sort=asc
column_name__sort=desc

# contains
column_name__contains=word

# exacts
column_name__exact=word

# less
column_name__less=12

# greater
column_name__greater=12

Pagination is made throught queries with page and page_size:

curl http://localhost:8005/api/resources/27d469ff-9908-4b7e-a2e0-9439bb38a395/data/?page=2&page_size=30

Metadata

Release files for udata-hydra-csvapi 0.1.0.dev209

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for udata-hydra-csvapi 0.1.0.dev209
File Size Uploaded
udata_hydra_csvapi-0.1.0.dev209.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for udata-hydra-csvapi 0.1.0.dev209
File Interpreter ABI Platform
udata_hydra_csvapi-0.1.0.dev209-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / udata_hydra_csvapi-0.1.0.dev209.tar.gz

Download URL udata_hydra_csvapi-0.1.0.dev209.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3bd5341a76825d779778dc8c841834bdb763d11342da9cb75b649423b4814094
BLAKE2b-256 checksum
How to use checksums
a1b13a3c06e42ce8f85ed35c48df767f33036dce0e5d0740dd21d23d6e8be991
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.9.15 Linux/5.15.0-1039-aws

Release files / udata_hydra_csvapi-0.1.0.dev209-py3-none-any.whl

Download URL udata_hydra_csvapi-0.1.0.dev209-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41e8db295606c16dcf7013e0fcc3983fa90e9ef4656f85d9c2df7f20a6e9bd4a
BLAKE2b-256 checksum
How to use checksums
b1a3a6649b5e26524b5e7c3bf534f995e43ebfc0738a96e141cd639d0c3e2005
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.9.15 Linux/5.15.0-1039-aws

Release history Release notifications | RSS feed

0.3.1

1 release file

0.3.0

1 release file

0.2.12

1 release file

0.2.11

1 release file

0.2.10

1 release file

0.2.9

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.0

1 release file

This release

0.1.0.dev209 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page