Commune API
provides two categories of information, first one is about all high schools in France and the other is postal codes for all communities/cities in France and oversea territories.
The raw data is downloaded from data.gouv on the following links;
Python3.9
FastAPI
Unicorn
RethinkDB
The list of endpoints avaliable are as follows:
List all high schools in France (paginated at 100 per page)
GET /v1/lycees/
Search for high school using parameters like num_siret, code_postal, nom_etablissement and statut
. E.g. GET /v1/lycees/search?num_siret=12345678
GET /v1/lycees/q?{search_field=searach_param}
You can get the list of high schools in a given postal code using the endpoint below
GET /v1/lycees/{code_postal}
List all communities in France (paginated at 100 per page)
GET /v1/postaux/
Search for communities using parameters like codePostal, nomCommune
. E.g. GET /v1/postaux/search?codePostal=12345678
GET /v1/postaux/q?search_field=searach_param
FastAPI
comes with automatic documentation with OpenAPI UI which can be accessed from
/v1
The alternative documentation (redoc) is accessible from
/
Make sure you have Python3.9
above installed and on your PATH
before you continue to the next step.
git clone https://github.com/mdauthentic/commune-api.git`
cd commune-api
python3 -m venv my-env
source my-env/bin/activate
pip3 install -r requirements.txt
uvicorn app.main:app --reload
Ensure you have docker
installed and follow the steps below;
git clone https://github.com/mdauthentic/commune-api.git`
cd commune-api
docker-compose up -d --build
docker-compose up