https://github.com/techouse/flask-docs-parser
Parse the Flask HTML documentation into a JSON format to be used with Algolia
https://github.com/techouse/flask-docs-parser
documentation flask parser python3
Last synced: about 1 month ago
JSON representation
Parse the Flask HTML documentation into a JSON format to be used with Algolia
- Host: GitHub
- URL: https://github.com/techouse/flask-docs-parser
- Owner: techouse
- License: mit
- Created: 2018-11-06T21:24:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-04T10:19:43.000Z (over 2 years ago)
- Last Synced: 2026-02-20T01:58:28.663Z (4 months ago)
- Topics: documentation, flask, parser, python3
- Language: Python
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask docs parser
## Requirements:
- Python 3.4+
## Installation and usage
```bash
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
sh get_docs.sh
python parser.py
```
The above commands will make a virtual environment in a folder called `env` and install all the requirements listed in `requirements.txt` into that virtual environment.
Once that is done running `sh get_docs.sh` will `clone` the `git` repository of [pallets/flask](https://github.com/pallets/flask) and build the Flask HTML documentation using Sphinx.
Then running `python parser.py` will parse that documentation.
It will output a file called `data.json` which you can later use to your avail.
The output JSON file looks like this:
```json
[
{
"version": "2.0.x",
"id": "flask.Flask.default_config",
"title": "Flask.default_config",
"permalink": "https://flask.palletsprojects.com/en/2.0.x/api/#flask.Flask.default_config",
"categories": [
"Flask"
],
"default": "{'APPLICATION_ROOT': '/', 'DEBUG': None, 'ENV': None, 'EXPLAIN_TEMPLATE_LOADING': False, 'JSONIFY_MIMETYPE': 'application/json', 'JSONIFY_PRETTYPRINT_REGULAR': False, 'JSON_AS_ASCII': True, 'JSON_SORT_KEYS': True, 'MAX_CONTENT_LENGTH': None, 'MAX_COOKIE_SIZE': 4093, 'PERMANENT_SESSION_LIFETIME': datetime.timedelta(days31), 'PREFERRED_URL_SCHEME': 'http', 'PRESERVE_CONTEXT_ON_EXCEPTION': None, 'PROPAGATE_EXCEPTIONS': None, 'SECRET_KEY': None, 'SEND_FILE_MAX_AGE_DEFAULT': datetime.timedelta(seconds43200), 'SERVER_NAME': None, 'SESSION_COOKIE_DOMAIN': None, 'SESSION_COOKIE_HTTPONLY': True, 'SESSION_COOKIE_NAME': 'session', 'SESSION_COOKIE_PATH': None, 'SESSION_COOKIE_SAMESITE': None, 'SESSION_COOKIE_SECURE': False, 'SESSION_REFRESH_EACH_REQUEST': True, 'TEMPLATES_AUTO_RELOAD': None, 'TESTING': False, 'TRAP_BAD_REQUEST_ERRORS': None, 'TRAP_HTTP_EXCEPTIONS': False, 'USE_X_SENDFILE': False}",
"content": "Default configuration parameters."
}
]
```