Metadata-Version: 2.1
Name: django-model-docs
Version: 0.0.0
Summary: Docs generator for Django models
Author: Jake Kara
Maintainer: Jake Kara
License: 
        
        Copyright 2023 Jake Kara
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://github.com/jakekara/django-model-docs/
Project-URL: Bug Reports, https://github.com/jakekara/django-model-docs/issues
Project-URL: Source, https://github.com/jakekara/django-model-docs/
Keywords: sample,setuptools,development
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Documentation
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: py-markdown-table<1
Provides-Extra: dev
Provides-Extra: test
Requires-Dist: tox>=4; extra == "test"

# Generate docs for django models

Generate extensible Markdown documentation for Django models. Developed for
cross-team collaboration when iterating on on data model specifications.

## User quickstart with an existing Django project

Install into your project requirements (`git+https://github.com/jakekara/django-model-docs.git`)

Add to the Django settings `INSTALLED_APPS`.

Generate Markdown documentation `YOUR_APP`

```shell
python manage.py generate-model-docs YOUR_APP
```

## Dev quick start

```shell
# set up a virtual env however you like. here's what I like:
python -m venv venv 
. ./venv bin activate

# set up dev stuff
pip install -r requirements.txt

# install the package in editable mode
pip install -e .

# generate docs for model(s) in the demo app
cd demo_django_project
python manage.py generate-model-docs demo_django_app
```

The output looks like this at the moment:

```markdown
# `demo_django_app`` app`

_This file was auto-generated Django Model Docs Generator.  Do not edit this file directly._

A demo Django App. Note that this text will be pulled from the app's docstring and used in the default output of `generate-model-docs`.

## `person` model

Person(id, first_name, last_name, shoeStyle)

|    Field   |Description|                                                          Data type                                                         |Nullable|Default|
|------------|-----------|----------------------------------------------------------------------------------------------------------------------------|--------|-------|
|    `id`    |           |                                                        BigAutoField                                                        |  False |   -   |
|`first_name`|           |                                                          CharField                                                         |  False |   -   |
| `last_name`|           |                                                          CharField                                                         |  False |   -   |
| `shoeStyle`|           |CharField<br><br>Choices (stored value : human readable)<br><br>- `LO` : `LOAFER`<br>- `BO` : `BOOT`<br>- `DR` : `DRESS`<br>|  False |   -   |


```

## Tests

Tests need to be run in the context of the `demo_django_app`.

```shell
cd demo_django_project
python manage.py test django-model-docs
```

To run the test suite against every supported Python version, use the command `tox` (you must have each Python version available to tox). You should see output like:

```shell
  py39: OK (2.44=setup[2.08]+cmd[0.36] seconds)
  py310: OK (2.04=setup[1.75]+cmd[0.30] seconds)
  py311: OK (2.19=setup[1.86]+cmd[0.33] seconds)
  py312: OK (6.02=setup[5.63]+cmd[0.39] seconds)
  congratulations :) (12.72 seconds)
```

If you're using `pyenv` to manage versions, you need to run `pyenv local 3.9 3.10 3.11 3.12` to make these versions accessible to tox from in the project environment.
