https://github.com/techouse/django-docs-parser
Parse the Django HTML documentation into a JSON format to be used with Algolia
https://github.com/techouse/django-docs-parser
django documentation parser python3
Last synced: about 2 months ago
JSON representation
Parse the Django HTML documentation into a JSON format to be used with Algolia
- Host: GitHub
- URL: https://github.com/techouse/django-docs-parser
- Owner: techouse
- License: mit
- Created: 2018-11-03T15:00:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-26T08:05:33.000Z (over 2 years ago)
- Last Synced: 2024-10-19T14:23:10.718Z (over 1 year ago)
- Topics: django, documentation, parser, python3
- Language: Python
- Size: 17.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django docs parser
## Requirements:
- Python 3.4+
## Installation and usage
```bash
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
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 `python parser.py` will go to the Django documentation for versions __4.0__, __3.2__, __3.1__, __3.0__, __2.2__, __2.1__, __2.0__, __1.11__, __1.10__ and __1.8__, grab their zipped HTML versions and parse them respectively.
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.2,
"id": "django.contrib.postgres.fields.ArrayField",
"title": "ArrayField",
"permalink": "https://docs.djangoproject.com/en/2.2/ref/contrib/postgres/fields/#django.contrib.postgres.fields.ArrayField",
"categories": [
"class ",
"contrib",
"postgres",
"fields"
],
"content": "A field for storing lists of data. Most field types can be used, you simply pass another field instance as the base_field. You may also specify a size. ArrayField can be nested to store multi-dimensional arrays."
}
]
```