Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benjamindpb/flask-api
Flask API for Wikidata Atlas project
https://github.com/benjamindpb/flask-api
api backend flask geolocalization mediawiki-api preprocessing python wikidata wikidata-dump
Last synced: 15 days ago
JSON representation
Flask API for Wikidata Atlas project
- Host: GitHub
- URL: https://github.com/benjamindpb/flask-api
- Owner: benjamindpb
- License: bsd-3-clause
- Created: 2022-10-27T03:48:02.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-02T06:38:55.000Z (over 1 year ago)
- Last Synced: 2024-10-31T14:05:42.384Z (2 months ago)
- Topics: api, backend, flask, geolocalization, mediawiki-api, preprocessing, python, wikidata, wikidata-dump
- Language: Python
- Homepage:
- Size: 1.19 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Flask API for [Wikidata Atlas](https://wdatlas.dcc.uchile.cl/) project
## Requirements
The Python version must be greater than or equal to **3.9**.
To install the additional requirements of the API, the following command must be executed in the terminal, located in the main folder of the API.
```console
pip install -r requirements.txt
```## API execution
Once all the API requirements have been installed, it is possible to run it.
To do this, you must execute the following command in the terminal:
```console
python app.py
```
With this, the default API will be hosted in **localhost:5000** (http://127.0.0.1:5000)## Uses (API calls)
The API has the following endpoints to obtain information from the Wikidata database:- Getting instances of a georeferential type
```console
localhost:5000/data//
```
Where **search** corresponds to the label of the type and **limit** to the number of instances to get.- Returns a dictionary with all georeferenceable types found after preprocessing the dump.
```console
localhost:5000/types
```
- Returns the information corresponding to a type, given its ID.
```console
localhost:5000/type/
```
Where **id** corresponds to the unique identifier of the entity ([entity ID](https://www.wikidata.org/wiki/Wikidata:Identifiers))- This endpoint is related to type search autocompletion. It is based on the percentage of georeferenceable instances of a given type to get all types whose label starts with the lookup that is entered as input.
```console
localhost:5000/autocomplete/
```
Where **search** corresponds to a string that symbolizes the desired search.---
[![Alt text](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Wikidata_Stamp_Rec_Dark.svg/200px-Wikidata_Stamp_Rec_Dark.svg.png "Powered by Wikidata")](https://www.wikidata.org/wiki/Wikidata:Main_Page)