pydantic-visualizer 0.1.0__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.
Files changed (27) hide show
  1. pydantic_visualizer-0.1.0/.gitattributes +2 -0
  2. pydantic_visualizer-0.1.0/.github/workflows/ci.yml +93 -0
  3. pydantic_visualizer-0.1.0/.github/workflows/publish.yml +41 -0
  4. pydantic_visualizer-0.1.0/.gitignore +195 -0
  5. pydantic_visualizer-0.1.0/LICENSE +21 -0
  6. pydantic_visualizer-0.1.0/MANIFEST.in +13 -0
  7. pydantic_visualizer-0.1.0/PACKAGE_SETUP_COMPLETE.md +220 -0
  8. pydantic_visualizer-0.1.0/PKG-INFO +263 -0
  9. pydantic_visualizer-0.1.0/README.md +230 -0
  10. pydantic_visualizer-0.1.0/SETUP_GUIDE.md +273 -0
  11. pydantic_visualizer-0.1.0/examples/01_basic_usage.py +50 -0
  12. pydantic_visualizer-0.1.0/examples/02_nested_models.py +73 -0
  13. pydantic_visualizer-0.1.0/examples/03_enum_handling.py +95 -0
  14. pydantic_visualizer-0.1.0/examples/04_custom_colors.py +68 -0
  15. pydantic_visualizer-0.1.0/examples/05_complex_relationships.py +133 -0
  16. pydantic_visualizer-0.1.0/examples/06_save_html.py +69 -0
  17. pydantic_visualizer-0.1.0/examples/07_save_markdown.py +69 -0
  18. pydantic_visualizer-0.1.0/examples/08_add_multiple_models.py +113 -0
  19. pydantic_visualizer-0.1.0/examples/output/task_mermaid.html +146 -0
  20. pydantic_visualizer-0.1.0/examples/output/task_mermaid.md +53 -0
  21. pydantic_visualizer-0.1.0/pydantic_visualizer/__init__.py +11 -0
  22. pydantic_visualizer-0.1.0/pydantic_visualizer/pydantic_visualizer.py +634 -0
  23. pydantic_visualizer-0.1.0/pydantic_visualizer/type_checkers.py +58 -0
  24. pydantic_visualizer-0.1.0/pyproject.toml +109 -0
  25. pydantic_visualizer-0.1.0/tests/__init__.py +1 -0
  26. pydantic_visualizer-0.1.0/tests/test_pydantic_visualizer.py +650 -0
  27. pydantic_visualizer-0.1.0/tests/test_type_checkers.py +199 -0
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,93 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest, windows-latest]
16
+ python-version: ["3.11", "3.12", "3.13"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v3
28
+
29
+ - name: Install dependencies
30
+ run: |
31
+ uv pip install --system -e ".[dev]"
32
+
33
+ - name: Run tests
34
+ run: |
35
+ pytest --cov=pydantic_visualizer --cov-report=xml --cov-report=term-missing
36
+
37
+ - name: Upload coverage to Codecov
38
+ uses: codecov/codecov-action@v4
39
+ with:
40
+ file: ./coverage.xml
41
+ flags: unittests
42
+ name: codecov-umbrella
43
+ fail_ci_if_error: false
44
+
45
+ lint:
46
+ runs-on: ubuntu-latest
47
+
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+
51
+ - name: Set up Python
52
+ uses: actions/setup-python@v5
53
+ with:
54
+ python-version: "3.11"
55
+
56
+ - name: Install uv
57
+ uses: astral-sh/setup-uv@v3
58
+
59
+ - name: Install dependencies
60
+ run: |
61
+ uv pip install --system -e ".[dev]"
62
+
63
+ - name: Run ruff check
64
+ run: |
65
+ ruff check .
66
+
67
+ - name: Run ruff format check
68
+ run: |
69
+ ruff format --check .
70
+
71
+ type-check:
72
+ runs-on: ubuntu-latest
73
+
74
+ steps:
75
+ - uses: actions/checkout@v4
76
+
77
+ - name: Set up Python
78
+ uses: actions/setup-python@v5
79
+ with:
80
+ python-version: "3.11"
81
+
82
+ - name: Install uv
83
+ uses: astral-sh/setup-uv@v3
84
+
85
+ - name: Install dependencies
86
+ run: |
87
+ uv pip install --system -e ".[dev]"
88
+
89
+ - name: Run mypy
90
+ run: |
91
+ mypy pydantic_visualizer
92
+
93
+
@@ -0,0 +1,41 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build-and-publish:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Set up Python
15
+ uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.11"
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v3
21
+
22
+ - name: Install dependencies
23
+ run: |
24
+ uv pip install --system build twine
25
+
26
+ - name: Build package
27
+ run: |
28
+ python -m build
29
+
30
+ - name: Check package
31
+ run: |
32
+ twine check dist/*
33
+
34
+ - name: Publish to PyPI
35
+ env:
36
+ TWINE_USERNAME: __token__
37
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
38
+ run: |
39
+ twine upload dist/*
40
+
41
+
@@ -0,0 +1,195 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # Ruff stuff:
171
+ .ruff_cache/
172
+
173
+ # PyPI configuration file
174
+ .pypirc
175
+
176
+ # Package build artifacts
177
+ *.egg
178
+ *.egg-info/
179
+ dist/
180
+ build/
181
+ *.whl
182
+
183
+ # Example outputs
184
+ examples/*.md
185
+ examples/*.html
186
+ output_diagram.*
187
+
188
+ # Cursor
189
+ # Cursor is an AI-powered code editor.`.cursorignore` specifies files/directories to
190
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
191
+ # refer to https://docs.cursor.com/context/ignore-files
192
+ .cursorignore
193
+ .cursorindexingignore
194
+ .DS_Store
195
+ uv.lock
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Maxime Gillot
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.
@@ -0,0 +1,13 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include CONTRIBUTING.md
5
+ include pyproject.toml
6
+
7
+ recursive-include pydantic_visualizer *.py
8
+ recursive-include tests *.py
9
+ recursive-include examples *.py
10
+
11
+ global-exclude __pycache__
12
+ global-exclude *.py[cod]
13
+ global-exclude .DS_Store
@@ -0,0 +1,220 @@
1
+ # 🎉 Package Setup Complete!
2
+
3
+ Your **pydantic-visualizer** project has been successfully transformed into a professional, open-source pip package!
4
+
5
+ ## ✅ What Has Been Done
6
+
7
+ ### 📁 Project Structure
8
+ ```
9
+ pydantic-visualizer/
10
+ ├── .github/
11
+ │ └── workflows/
12
+ │ ├── ci.yml # Continuous Integration
13
+ │ └── publish.yml # PyPI Publishing
14
+ ├── pydantic_visualizer/ # Main package directory
15
+ │ ├── __init__.py # Package initialization
16
+ │ ├── generator.py # Main generator class (refactored)
17
+ │ └── type_checkers.py # Type checking utilities
18
+ ├── tests/ # Test suite
19
+ │ ├── __init__.py
20
+ │ ├── test_generator.py # Generator tests
21
+ │ └── test_type_checkers.py # Type checker tests
22
+ ├── examples/
23
+ │ └── basic_usage.py # Usage examples
24
+ ├── .gitignore # Updated with package-specific ignores
25
+ ├── .gitattributes
26
+ ├── CHANGELOG.md # Version history
27
+ ├── CONTRIBUTING.md # Contribution guidelines
28
+ ├── LICENSE # MIT License
29
+ ├── MANIFEST.in # Package manifest
30
+ ├── pyproject.toml # Modern Python packaging config
31
+ ├── README.md # Comprehensive documentation
32
+ ├── SETUP_GUIDE.md # Setup and publishing guide
33
+ └── PACKAGE_SETUP_COMPLETE.md # This file
34
+ ```
35
+
36
+ ### 🔧 Key Features Implemented
37
+
38
+ 1. **Modern Package Structure**
39
+ - Proper Python package with `__init__.py`
40
+ - Clean separation of concerns
41
+ - Fixed import paths (removed backend.utils references)
42
+
43
+ 2. **Build Configuration (pyproject.toml)**
44
+ - Uses `hatchling` as build backend
45
+ - Python 3.11+ requirement
46
+ - Comprehensive metadata (author, license, keywords)
47
+ - Development dependencies included
48
+ - Configured for `uv` package manager
49
+
50
+ 3. **Documentation**
51
+ - **README.md**: Installation, usage, examples, API reference
52
+ - **CONTRIBUTING.md**: Development setup, testing, PR guidelines
53
+ - **CHANGELOG.md**: Version history tracking
54
+ - **SETUP_GUIDE.md**: Detailed setup and publishing instructions
55
+ - Comprehensive docstrings in all modules
56
+
57
+ 4. **Testing Infrastructure**
58
+ - Full test suite with pytest
59
+ - Tests for generator functionality
60
+ - Tests for type checking utilities
61
+ - Coverage reporting configured
62
+
63
+ 5. **CI/CD Pipelines**
64
+ - **ci.yml**: Runs tests on multiple OS and Python versions
65
+ - **publish.yml**: Automated PyPI publishing on releases
66
+ - Linting with Ruff
67
+ - Type checking with MyPy
68
+
69
+ 6. **Code Quality Tools**
70
+ - Ruff for linting and formatting
71
+ - MyPy for type checking
72
+ - Pytest for testing
73
+ - All configured in pyproject.toml
74
+
75
+ 7. **Examples**
76
+ - Comprehensive usage examples
77
+ - Multiple scenarios covered
78
+ - Real-world use cases demonstrated
79
+
80
+ ## 🚀 Next Steps
81
+
82
+ ### 1. Install Dependencies
83
+
84
+ ```bash
85
+ # Using uv (recommended)
86
+ uv pip install -e ".[dev]"
87
+
88
+ # Or using pip
89
+ pip install -e ".[dev]"
90
+ ```
91
+
92
+ ### 2. Run Tests
93
+
94
+ ```bash
95
+ # Run all tests
96
+ pytest
97
+
98
+ # Run with coverage
99
+ pytest --cov=pydantic_visualizer --cov-report=html
100
+ ```
101
+
102
+ ### 3. Try the Examples
103
+
104
+ ```bash
105
+ python examples/basic_usage.py
106
+ ```
107
+
108
+ ### 4. Set Up GitHub Repository
109
+
110
+ ```bash
111
+ # Initialize git (if not already done)
112
+ git init
113
+ git add .
114
+ git commit -m "feat: initial package setup"
115
+
116
+ # Add remote and push
117
+ git remote add origin https://github.com/YOUR_USERNAME/pydantic-visualizer.git
118
+ git branch -M main
119
+ git push -u origin main
120
+ ```
121
+
122
+ ### 5. Configure GitHub Secrets
123
+
124
+ For automated PyPI publishing:
125
+
126
+ 1. Get a PyPI API token from https://pypi.org/manage/account/
127
+ 2. Add it to GitHub: Settings → Secrets → Actions → New repository secret
128
+ 3. Name: `PYPI_API_TOKEN`
129
+ 4. Value: Your PyPI token
130
+
131
+ ### 6. Create Your First Release
132
+
133
+ ```bash
134
+ # Tag the release
135
+ git tag v0.1.0
136
+ git push origin v0.1.0
137
+
138
+ # Or create a release on GitHub UI
139
+ # The publish workflow will automatically deploy to PyPI
140
+ ```
141
+
142
+ ## 📦 Publishing Checklist
143
+
144
+ Before publishing to PyPI:
145
+
146
+ - [ ] All tests pass locally
147
+ - [ ] Documentation is complete and accurate
148
+ - [ ] CHANGELOG.md is updated
149
+ - [ ] Version number is correct in pyproject.toml and __init__.py
150
+ - [ ] Examples work correctly
151
+ - [ ] GitHub Actions are configured
152
+ - [ ] PyPI API token is set in GitHub secrets
153
+ - [ ] README badges are updated (after first publish)
154
+
155
+ ## 🔍 Package Information
156
+
157
+ - **Package Name**: `pydantic-visualizer`
158
+ - **Version**: `0.1.0`
159
+ - **Python Requirement**: `>=3.11`
160
+ - **License**: MIT
161
+ - **Main Dependency**: `pydantic>=2.0.0`
162
+
163
+ ## 📚 Important Files to Review
164
+
165
+ 1. **pyproject.toml** - Package configuration and metadata
166
+ 2. **README.md** - User-facing documentation
167
+ 3. **SETUP_GUIDE.md** - Development and publishing guide
168
+ 4. **CONTRIBUTING.md** - Contribution guidelines
169
+
170
+ ## 🎯 Installation (After Publishing)
171
+
172
+ Once published to PyPI, users can install with:
173
+
174
+ ```bash
175
+ # Using pip
176
+ pip install pydantic-visualizer
177
+
178
+ # Using uv
179
+ uv pip install pydantic-visualizer
180
+ ```
181
+
182
+ ## 💡 Tips
183
+
184
+ - Keep CHANGELOG.md updated with each release
185
+ - Use semantic versioning (MAJOR.MINOR.PATCH)
186
+ - Test on TestPyPI before publishing to PyPI
187
+ - Run all quality checks before committing
188
+ - Write clear commit messages (use conventional commits)
189
+
190
+ ## 🐛 Troubleshooting
191
+
192
+ If you encounter issues:
193
+
194
+ 1. Check SETUP_GUIDE.md for detailed instructions
195
+ 2. Ensure all dependencies are installed
196
+ 3. Verify Python version is 3.11+
197
+ 4. Clear cache: `rm -rf build/ dist/ *.egg-info/`
198
+ 5. Reinstall: `uv pip install -e ".[dev]"`
199
+
200
+ ## 📞 Support
201
+
202
+ - **Issues**: https://github.com/maxime-gillot/pydantic-visualizer/issues
203
+ - **Discussions**: https://github.com/maxime-gillot/pydantic-visualizer/discussions
204
+
205
+ ## 🎊 Congratulations!
206
+
207
+ Your package is now ready for the world! 🌍
208
+
209
+ The project follows Python packaging best practices and is set up for:
210
+ - Easy installation via pip/uv
211
+ - Automated testing and quality checks
212
+ - Continuous integration
213
+ - Automated publishing
214
+ - Community contributions
215
+
216
+ **Happy coding and sharing! 🚀**
217
+
218
+ ---
219
+
220
+ *Generated on: 2026-03-11*