pygraphile 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.
@@ -0,0 +1,35 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
3
+
4
+ # Python files
5
+ *.py text eol=lf
6
+ *.pyx text eol=lf
7
+ *.pyi text eol=lf
8
+
9
+ # Configuration files
10
+ *.toml text eol=lf
11
+ *.yaml text eol=lf
12
+ *.yml text eol=lf
13
+ *.json text eol=lf
14
+ *.md text eol=lf
15
+ *.txt text eol=lf
16
+
17
+ # Shell scripts
18
+ *.sh text eol=lf
19
+ *.bash text eol=lf
20
+
21
+ # Windows scripts
22
+ *.bat text eol=crlf
23
+ *.cmd text eol=crlf
24
+ *.ps1 text eol=crlf
25
+
26
+ # Binary files
27
+ *.db binary
28
+ *.sqlite binary
29
+ *.sqlite3 binary
30
+ *.pyc binary
31
+ *.pyo binary
32
+ *.pyd binary
33
+ *.so binary
34
+ *.dll binary
35
+ *.dylib binary
@@ -0,0 +1,70 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Pygraphile
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.x"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install build
33
+ python -m build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ runs-on: ubuntu-latest
43
+ needs:
44
+ - release-build
45
+ permissions:
46
+ # IMPORTANT: this permission is mandatory for trusted publishing
47
+ id-token: write
48
+
49
+ # Dedicated environments with protections for publishing are strongly recommended.
50
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+ environment:
52
+ name: pypi
53
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+ # url: https://pypi.org/p/YOURPROJECT
55
+ #
56
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+ # ALTERNATIVE: exactly, uncomment the following line instead:
58
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish release distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+ with:
70
+ packages-dir: dist/
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
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
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1 @@
1
+ 3.9
@@ -0,0 +1,70 @@
1
+ # AI Usage Records
2
+
3
+ This file documents all AI-assisted contributions to the PyGraphile project, promoting transparency and accountability.
4
+
5
+ ## Purpose
6
+
7
+ We believe in transparency when it comes to AI-assisted development. This file tracks:
8
+ - Which changes were made with AI assistance
9
+ - What those changes accomplish
10
+ - Who was responsible for the contribution
11
+
12
+ ## Format
13
+
14
+ Each entry should include:
15
+ - **Date**: When the contribution was made
16
+ - **Contributor**: GitHub username
17
+ - **AI Tool**: Which AI tool was used (e.g., GitHub Copilot, ChatGPT, etc.)
18
+ - **Changes Made**: Description of what was changed
19
+ - **Explanation**: What the changes do (in contributor's own words)
20
+ - **Commit(s)**: Related commit hash(es)
21
+
22
+ ---
23
+
24
+ ## Contribution Records
25
+
26
+ ### 2025-11-09 - Initial Package Structure
27
+
28
+ **Contributor**: @copilot (GitHub Copilot Workspace Agent)
29
+ **AI Tool**: GitHub Copilot Workspace
30
+ **Commit**: 27bbaa4
31
+
32
+ **Changes Made**:
33
+ - Project initialization using `uv init --lib`
34
+ - Complete package structure setup with src-layout
35
+ - Configuration files (pyproject.toml, .python-version, .gitattributes)
36
+ - Documentation files (README.md, LICENSE, CONTRIBUTING.md)
37
+ - Test infrastructure (tests/ directory with basic tests)
38
+ - Directory structure (src/pygraphile/, examples/, docs/, .github/workflows/)
39
+
40
+ **What These Changes Do**:
41
+ This AI-generated contribution established the foundational structure for the PyGraphile package. It created a modern Python package using the src-layout pattern, which separates source code from tests and configuration. The package is configured to work with both `uv` (a fast Python package manager) and traditional `pip`, ensuring broad compatibility.
42
+
43
+ Key components include:
44
+ - **src/pygraphile/**: Main package directory containing `__init__.py` with package metadata
45
+ - **pyproject.toml**: Project configuration defining dependencies, build system (hatchling for pip compatibility), development tools (pytest, ruff), and project metadata
46
+ - **LICENSE**: MIT license for open-source distribution
47
+ - **README.md**: User-facing documentation with installation instructions, features, and roadmap
48
+ - **CONTRIBUTING.md**: Guidelines for contributors on how to set up development environment and contribute code
49
+ - **tests/**: Test infrastructure using pytest with basic validation tests
50
+ - **py.typed**: Marker file indicating the package supports type hints (PEP 561)
51
+
52
+ The structure follows Python packaging best practices and provides a solid foundation for building the GraphQL API generation features.
53
+
54
+ ---
55
+
56
+ ## Guidelines for Future Entries
57
+
58
+ When adding entries to this file:
59
+
60
+ 1. **Be Specific**: Clearly state what files or features were modified/created
61
+ 2. **Own Your Work**: Even if AI generated code, you must understand and explain it
62
+ 3. **No AI Explanations**: The "Explanation" section must be written by you, not AI
63
+ 4. **Be Honest**: Disclose the full extent of AI involvement
64
+ 5. **Update Promptly**: Add entries when you submit your PR, not after merge
65
+
66
+ ---
67
+
68
+ ## Questions?
69
+
70
+ If you're unsure whether to disclose AI usage or how to format your entry, feel free to ask in your pull request or open an issue.
@@ -0,0 +1,108 @@
1
+ # Contributing to PyGraphile
2
+
3
+ Thank you for your interest in contributing to PyGraphile! This document provides guidelines and instructions for contributing.
4
+
5
+ ## Code of Conduct
6
+
7
+ Be respectful and inclusive. We want this to be a welcoming community for everyone.
8
+
9
+ ## How to Contribute
10
+
11
+ ### Reporting Bugs
12
+
13
+ - Use the GitHub Issues tracker
14
+ - Describe the bug in detail
15
+ - Include steps to reproduce
16
+ - Mention your Python version and OS
17
+
18
+ ### Suggesting Features
19
+
20
+ - Open an issue with the "enhancement" label
21
+ - Clearly describe the feature and its use case
22
+ - Explain why it would be useful to most users
23
+
24
+ ### Pull Requests
25
+
26
+ 1. Fork the repository
27
+ 2. Create a new branch for your feature or fix
28
+ 3. Write clear, commented code
29
+ 4. Add tests if applicable
30
+ 5. Ensure all tests pass
31
+ 6. Update documentation as needed
32
+ 7. Submit a pull request
33
+
34
+ ### AI Usage Disclosure
35
+
36
+ Contributors are welcome to use AI tools to assist with their contributions. However, **you must disclose any AI-generated changes** in your pull request:
37
+
38
+ - **List which changes were made with AI assistance** in the PR description
39
+ - **Explain what those changes do in your own words** - do not use AI to write the explanation
40
+ - Be transparent about the extent of AI involvement (e.g., "AI generated the initial structure", "AI helped refactor function X")
41
+ - Take full responsibility for reviewing and understanding all AI-generated code before submitting
42
+
43
+ This policy ensures transparency and helps maintain code quality and understanding across the project.
44
+
45
+ ## Development Setup
46
+
47
+ ### Using uv (recommended)
48
+
49
+ ```bash
50
+ # Clone the repository
51
+ git clone https://github.com/dshaw0004/pygraphile.git
52
+ cd pygraphile
53
+
54
+ # Install dependencies
55
+ uv sync
56
+
57
+ # Run tests
58
+ uv run pytest
59
+
60
+ # Run linter
61
+ uv run ruff check .
62
+ ```
63
+
64
+ ### Using pip
65
+
66
+ ```bash
67
+ # Clone the repository
68
+ git clone https://github.com/dshaw0004/pygraphile.git
69
+ cd pygraphile
70
+
71
+ # Create virtual environment
72
+ python -m venv venv
73
+ source venv/bin/activate # On Windows: venv\Scripts\activate
74
+
75
+ # Install in development mode
76
+ pip install -e ".[dev]"
77
+
78
+ # Run tests
79
+ pytest
80
+
81
+ # Run linter
82
+ ruff check .
83
+ ```
84
+
85
+ ## Code Style
86
+
87
+ - Follow PEP 8 guidelines
88
+ - Use type hints where appropriate
89
+ - Write docstrings for public functions and classes
90
+ - Keep functions focused and concise
91
+ - Use meaningful variable names
92
+
93
+ ## Testing
94
+
95
+ - Write tests for new features
96
+ - Ensure existing tests pass
97
+ - Aim for good test coverage
98
+ - Use pytest for testing
99
+
100
+ ## Documentation
101
+
102
+ - Update README.md for user-facing changes
103
+ - Add docstrings to new functions/classes
104
+ - Update examples if needed
105
+
106
+ ## Questions?
107
+
108
+ Feel free to open an issue for any questions or clarifications!
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 dshaw0004
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,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: pygraphile
3
+ Version: 0.1.0
4
+ Summary: A Python library inspired by PostGraphile - automatically generates GraphQL APIs from databases. Currently supports SQLite with plans for additional database support.
5
+ Project-URL: Homepage, https://github.com/dshaw0004/pygraphile
6
+ Project-URL: Repository, https://github.com/dshaw0004/pygraphile
7
+ Project-URL: Issues, https://github.com/dshaw0004/pygraphile/issues
8
+ Author: dshaw0004
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: api,database,graphql,postgraphile,sqlite
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Database
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.9
24
+ Description-Content-Type: text/markdown
25
+
26
+ # PyGraphile
27
+
28
+ [![Python Version](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
29
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
30
+
31
+ A Python library inspired by [PostGraphile](https://www.graphile.org/postgraphile/) - automatically generates GraphQL APIs from your database schema.
32
+
33
+ ## 🚧 Project Status
34
+
35
+ This project is in early development. Currently supporting SQLite with plans to add support for PostgreSQL, MySQL, and other databases in the future.
36
+
37
+ ## ✨ Features
38
+
39
+ - πŸ—„οΈ **Database Introspection**: Automatically analyzes your database schema
40
+ - πŸ”„ **GraphQL API Generation**: Creates a GraphQL API based on your database structure
41
+ - 🎯 **SQLite Support**: Initial support for SQLite databases (more databases coming soon)
42
+ - 🐍 **Python Native**: Built for Python with modern best practices
43
+ - πŸ“¦ **Easy to Use**: Simple setup and configuration
44
+
45
+ ## πŸš€ Installation
46
+
47
+ ### Using pip
48
+
49
+ ```bash
50
+ pip install pygraphile
51
+ ```
52
+
53
+ ### Using uv
54
+
55
+ ```bash
56
+ uv pip install pygraphile
57
+ ```
58
+
59
+ ### From source
60
+
61
+ ```bash
62
+ git clone https://github.com/dshaw0004/pygraphile.git
63
+ cd pygraphile
64
+ uv pip install -e .
65
+ ```
66
+
67
+ ## πŸ“– Quick Start
68
+
69
+ ```python
70
+ from pygraphile import Pygraphile
71
+
72
+ # Coming soon! Basic usage example will be:
73
+ # api = Pygraphile('path/to/database.db')
74
+ # api.serve()
75
+ ```
76
+
77
+ ## πŸ—ΊοΈ Roadmap
78
+
79
+ - [x] Project setup and structure
80
+ - [ ] SQLite schema introspection
81
+ - [ ] GraphQL schema generation
82
+ - [ ] Query resolver implementation
83
+ - [ ] Mutation support
84
+ - [ ] PostgreSQL support
85
+ - [ ] MySQL support
86
+ - [ ] Advanced filtering and pagination
87
+ - [ ] Authentication and authorization
88
+ - [ ] Plugin system
89
+
90
+ ## 🀝 Contributing
91
+
92
+ Contributions are welcome! This project is in early stages, so there's plenty of opportunity to shape its direction.
93
+
94
+ 1. Fork the repository
95
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
96
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
97
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
98
+ 5. Open a Pull Request
99
+
100
+ ## πŸ“„ License
101
+
102
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
103
+
104
+ ## πŸ™ Acknowledgments
105
+
106
+ - Inspired by [PostGraphile](https://www.graphile.org/postgraphile/) - An amazing tool for PostgreSQL
107
+ - Built with modern Python tooling including [uv](https://github.com/astral-sh/uv)
108
+
109
+ ## πŸ“¬ Contact
110
+
111
+ - GitHub: [@dshaw0004](https://github.com/dshaw0004)
112
+ - Project Link: [https://github.com/dshaw0004/pygraphile](https://github.com/dshaw0004/pygraphile)
113
+
114
+ ---
115
+
116
+ **Note**: This project is under active development. APIs and features are subject to change.