Documentation generator plugin for DBGear
Project description
dbgear-doc
Documentation generator plugin for DBGear.
Overview
dbgear-doc generates Markdown documentation from DBGear database schema definitions. It provides:
- Automatic documentation generation from
schema.yamlfiles - Table structure documentation with columns, types, and descriptions
- Index and foreign key relationship documentation
- Schema-level overview pages
Installation
pip install dbgear-doc
Or with Poetry:
poetry add dbgear-doc
Usage
Once installed, the doc subcommand becomes available in the dbgear CLI:
# Generate documentation (outputs to ./docs by default)
dbgear --project path/to/project doc
# Specify output directory
dbgear --project path/to/project doc -o ./documentation
Programmatic Usage
from dbgear_doc import DocumentGenerator, generate_docs
from dbgear.models.schema import SchemaManager
from pathlib import Path
# Simple usage
generate_docs("schema.yaml", "./docs")
# Advanced usage with SchemaManager
schema_manager = SchemaManager.load("schema.yaml")
generator = DocumentGenerator(schema_manager)
generated_files = generator.generate(Path("./docs"))
Output Structure
docs/
├── index.md # Main index with schema list
└── {schema_name}/
├── README.md # Schema overview with table list
└── {table_name}.md # Individual table documentation
Generated Documentation
Each table documentation includes:
- Description: Table notes/comments from schema
- Columns: Column name, type, nullable, default, and description
- Primary Key: Primary key columns
- Indexes: Index definitions with columns and uniqueness
- Foreign Keys: Foreign key constraints with references
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbgear_doc-0.4.0.tar.gz.
File metadata
- Download URL: dbgear_doc-0.4.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/5.15.136-tegra
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e6fc481f6014802a8b56f77f6a30a6502030b7432dd690aa5b7cab705913725
|
|
| MD5 |
55aee489e18f86682e6b2d7e718856a2
|
|
| BLAKE2b-256 |
a50e0ba6958b9540cb085cbc1e9cacb19ea3a4bc3eda2280dd08bae0916cd4ce
|
File details
Details for the file dbgear_doc-0.4.0-py3-none-any.whl.
File metadata
- Download URL: dbgear_doc-0.4.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/5.15.136-tegra
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b79cdeaabe5898ddc1d76510a799aba06a5a2e5b4cded5156cea00c8cb93cb86
|
|
| MD5 |
d41b1082b20738bc705b38e7e6021a50
|
|
| BLAKE2b-256 |
cd48fe75ff7760eb5ebac38b5ac250200083c560fd0f1af5c2dbb8a6d5a3553e
|