dbdocs 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dbdocs-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Dat Nguyen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
dbdocs-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.1
2
+ Name: dbdocs
3
+ Version: 0.0.1
4
+ Summary: Auto-generated data documentation site for dbt projects
5
+ Home-page: https://github.com/datnguye/dbt-docs
6
+ License: MIT
7
+ Keywords: flake8,markdown,lint
8
+ Author: Dat Nguyen
9
+ Author-email: datnguyen.it09@gmail.com
10
+ Requires-Python: >=3.9,<4.0
11
+ Classifier: Environment :: Console
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Topic :: Software Development :: Documentation
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ Requires-Dist: click (>=8.1,<9.0)
22
+ Requires-Dist: dbterd (>=1,<2)
23
+ Requires-Dist: jinja2 (>=3.1,<4.0)
24
+ Project-URL: Repository, https://github.com/datnguye/dbt-docs
25
+ Description-Content-Type: text/markdown
26
+
27
+ # dbt-docs
28
+
29
+ <!-- [![PyPI version](https://badge.fury.io/py/dbterd.svg)](https://pypi.org/project/dbterd/)
30
+ ![python-cli](https://img.shields.io/badge/CLI-Python-FFCE3E?labelColor=14354C&logo=python&logoColor=white)
31
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
32
+ [![python](https://img.shields.io/badge/Python-3.9|3.10|3.11-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)
33
+ [![codecov](https://codecov.io/gh/datnguye/dbterd/branch/main/graph/badge.svg?token=N7DMQBLH4P)](https://codecov.io/gh/datnguye/dbterd) -->
34
+
35
+ Alternative dbt docs 🚀
36
+
37
+ ```bash
38
+ pip install dbdocs --upgrade
39
+ ```
40
+
41
+ Verify installation:
42
+
43
+ ```bash
44
+ dbdocs --version
45
+ ```
46
+
dbdocs-0.0.1/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # dbt-docs
2
+
3
+ <!-- [![PyPI version](https://badge.fury.io/py/dbterd.svg)](https://pypi.org/project/dbterd/)
4
+ ![python-cli](https://img.shields.io/badge/CLI-Python-FFCE3E?labelColor=14354C&logo=python&logoColor=white)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![python](https://img.shields.io/badge/Python-3.9|3.10|3.11-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)
7
+ [![codecov](https://codecov.io/gh/datnguye/dbterd/branch/main/graph/badge.svg?token=N7DMQBLH4P)](https://codecov.io/gh/datnguye/dbterd) -->
8
+
9
+ Alternative dbt docs 🚀
10
+
11
+ ```bash
12
+ pip install dbdocs --upgrade
13
+ ```
14
+
15
+ Verify installation:
16
+
17
+ ```bash
18
+ dbdocs --version
19
+ ```
File without changes
@@ -0,0 +1,3 @@
1
+ from dbdocs import main
2
+
3
+ main.main()
File without changes
@@ -0,0 +1,29 @@
1
+ import importlib.metadata
2
+ import click
3
+ from dbdocs.helpers.log import logger
4
+
5
+ __version__ = importlib.metadata.version("dbdocs")
6
+
7
+
8
+ # dbdocs
9
+ @click.group(
10
+ context_settings={"help_option_names": ["-h", "--help"]},
11
+ invoke_without_command=True,
12
+ no_args_is_help=True,
13
+ epilog="Specify one of these sub-commands and you can find more help from there.",
14
+ )
15
+ @click.version_option(__version__)
16
+ @click.pass_context
17
+ def dbdocs(ctx, **kwargs):
18
+ """Auto-generated data documentation site for dbt projects"""
19
+ logger.info(f"Run with dbdocs=={__version__}")
20
+
21
+
22
+ # dbtdocs run
23
+ @dbdocs.command(name="generate")
24
+ @click.pass_context
25
+ def generate(ctx, **kwargs):
26
+ """
27
+ Generate static sites
28
+ """
29
+ pass
File without changes
@@ -0,0 +1,37 @@
1
+ import logging
2
+
3
+
4
+ class LogFormatter(logging.Formatter):
5
+
6
+ grey = "\x1b[38;20m"
7
+ blue = "\x1b[34;20m"
8
+ yellow = "\x1b[33;20m"
9
+ red = "\x1b[31;20m"
10
+ bold_red = "\x1b[31;1m"
11
+ reset = "\x1b[0m"
12
+ format = (
13
+ "%(asctime)s - %(name)s - %(levelname)s - %(message)s (%(filename)s:%(lineno)d)"
14
+ )
15
+
16
+ FORMATS = {
17
+ logging.DEBUG: blue + format + reset,
18
+ logging.INFO: grey + format + reset,
19
+ logging.WARNING: yellow + format + reset,
20
+ logging.ERROR: red + format + reset,
21
+ logging.CRITICAL: bold_red + format + reset,
22
+ }
23
+
24
+ def format(self, record):
25
+ log_fmt = self.FORMATS.get(record.levelno)
26
+ formatter = logging.Formatter(log_fmt)
27
+ return formatter.format(record)
28
+
29
+
30
+ logger = logging.getLogger("dbterd")
31
+ logger.setLevel(logging.DEBUG)
32
+
33
+ if len(logger.handlers) == 0:
34
+ ch = logging.StreamHandler()
35
+ ch.setLevel(logging.DEBUG)
36
+ ch.setFormatter(LogFormatter())
37
+ logger.addHandler(ch)
@@ -0,0 +1,6 @@
1
+ from dbdocs.cli import main as cli
2
+
3
+
4
+ def main():
5
+ """dbdocs entrypoint"""
6
+ cli.dbdocs()
@@ -0,0 +1,97 @@
1
+ [tool.poetry]
2
+ name = "dbdocs"
3
+ version = "0.0.1"
4
+ description = "Auto-generated data documentation site for dbt projects"
5
+ authors = ["Dat Nguyen <datnguyen.it09@gmail.com>"]
6
+ license = "MIT"
7
+ readme = "README.md"
8
+ homepage = "https://github.com/datnguye/dbt-docs"
9
+ repository = "https://github.com/datnguye/dbt-docs"
10
+ keywords = ["flake8", "markdown", "lint"]
11
+ classifiers = [
12
+ "Environment :: Console",
13
+ "Operating System :: OS Independent",
14
+ "Topic :: Software Development :: Documentation",
15
+ "Topic :: Software Development :: Libraries :: Python Modules",
16
+ "Topic :: Software Development :: Quality Assurance",
17
+ ]
18
+ include = [
19
+ "LICENSE",
20
+ ]
21
+ packages = [
22
+ {include = "dbdocs"},
23
+ {include = "README.md"},
24
+ ]
25
+
26
+ [tool.poetry.scripts]
27
+ dbdocs = "dbdocs.main:main"
28
+
29
+ [tool.poetry.dependencies]
30
+ python = "^3.9"
31
+ click = "^8.1"
32
+ dbterd = "^1"
33
+ jinja2 = "^3.1"
34
+
35
+ [tool.poetry.group.dev.dependencies]
36
+ dbt-postgres = "^1.5"
37
+ pytest = "^6.2.5"
38
+ pytest-sugar = "^0.9.6"
39
+ black = "^22.10.0"
40
+ coverage = {version = "^6.5.0", extras = ["toml"]}
41
+ poethepoet = "^0.16.4"
42
+ pre-commit = "^2.20.0"
43
+ flake8 = "^6.0.0"
44
+ isort = "^5.12.0"
45
+ autoflake = "^2.0.1"
46
+ mkdocs = "^1.4.2"
47
+ mkdocs-minify-plugin = "^0.6.4"
48
+ mkdocs-material = "^9.1.5"
49
+ mike = "^1.1.2"
50
+ pdoc = "^14.4.0"
51
+
52
+ [build-system]
53
+ requires = ["poetry-core>=1.0.0"]
54
+ build-backend = "poetry.core.masonry.api"
55
+
56
+ [tool.isort]
57
+ multi_line_output = 3
58
+ force_to_top = ["os"]
59
+ profile = "black"
60
+ skip_gitignore = true
61
+
62
+ [tool.autoflake]
63
+ recursive = true
64
+ in-place = true
65
+ remove-all-unused-imports = true
66
+ ignore-init-module-imports = true
67
+ remove-unused-variables = true
68
+ ignore-pass-statements = false
69
+
70
+ [tool.coverage.run]
71
+ omit = ["tests/*"]
72
+
73
+ [tool.poe.tasks]
74
+ git-hooks = { shell = "pre-commit install --install-hooks && pre-commit install --hook-type commit-msg" }
75
+ format = [
76
+ {cmd = "autoflake ."},
77
+ {cmd = "black ."},
78
+ {cmd = "isort ."},
79
+ ]
80
+ lint = [
81
+ {cmd = "black --check ."},
82
+ {cmd = "isort --check-only ."},
83
+ {cmd = "flake8 ."},
84
+ ]
85
+ test = [
86
+ {cmd = "pytest . -vv"},
87
+ ]
88
+ test-cov = [
89
+ {cmd = "pytest --version"},
90
+ {cmd = "coverage run -m pytest ."},
91
+ {cmd = "coverage report --show-missing"},
92
+ {cmd = "coverage xml"},
93
+ ]
94
+ build-doc-and-serve = [
95
+ {cmd = "mkdocs build"},
96
+ {cmd = "mkdocs serve"}
97
+ ]