Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tolstoyevsky/cusdeb-helpik
Microservice intended for gathering synopses from CusDeb Wiki to display them on the client
https://github.com/tolstoyevsky/cusdeb-helpik
aiohttp cusdeb mediawiki mediawiki-api python3 restful-api
Last synced: 5 days ago
JSON representation
Microservice intended for gathering synopses from CusDeb Wiki to display them on the client
- Host: GitHub
- URL: https://github.com/tolstoyevsky/cusdeb-helpik
- Owner: tolstoyevsky
- License: apache-2.0
- Created: 2020-03-25T16:34:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-20T15:10:21.000Z (over 1 year ago)
- Last Synced: 2024-10-10T18:43:07.045Z (26 days ago)
- Topics: aiohttp, cusdeb, mediawiki, mediawiki-api, python3, restful-api
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS.md
Awesome Lists containing this project
README
# CusDeb Helpik
CusDeb Helpik is a microservice intended primarily, but **not** exclusively, for gathering synopses from [CusDeb Wiki](http://wiki.cusdeb.com) to display them on the [client](https://github.com/tolstoyevsky/cusdeb-web-client).
Helpik interacts directly with the [MediaWiki API](https://mediawiki.org/wiki/API:Main_page) and, therefore, it can be used with any wiki based on MediaWiki.
## Installation
```
$ git clone https://github.com/tolstoyevsky/cusdeb-helpik.git
$ virtualenv -ppython3 cusdeb-helpik-env
$ source cusdeb-helpik-env/bin/activate
(cusdeb-helpik-env) $ cd cusdeb-helpik
(cusdeb-helpik-env) $ python3 setup.py install
(cusdeb-helpik-env) $ python3 bin/server.py
```### How to run tests
```
(cusdeb-helpik-env) $ python3 -m pytest test/run_tests.py
```## API
* **URI:** `/helpik_api/`
* **Method:** `GET`
* **Params**
* `page=[string]`
* `lang=[string]`
* `sec=[string]``page` is the name of the target page.
`lang` is the language of the target page. If the page in the specified language doesn't exist, Helpik fallbacks to English. If the fallback doesn't work the microservice returns a 404 status code (see below).
`sec` allows, if passed, the client to fetch the synopsis of the specified section on the target page instead of the synopsis of the page itself.
* **Success Response**
* **Code:** 200
* **Content:** `{"text": "", "url": ""}`, where
* `` is the synopsis of either the target page or the specified section on the target page;
* `` is the URL of the target page.
* **Error Responses**
* **Code:** 404
* **Content:** None
* **Reason:** either the target page or the specified section on the target page doesn't exist.
* **Code:** 503
* **Content:** None
* **Reason:** the MediaWiki API is unavailable when invoking the `/helpik_api/` endpoint.## Authors
See [AUTHORS](AUTHORS.md).
## Licensing
CusDeb Helpik is available under the [Apache License, Version 2.0](LICENSE).