vnbdigital-client 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,28 @@
1
+ FROM python:3.12-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ git \
6
+ curl \
7
+ build-essential \
8
+ ca-certificates \
9
+ gnupg \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Add wakemeops apt repo and install tools via wake
13
+ RUN curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository | bash
14
+
15
+ RUN apt-get update \
16
+ && apt-get install -y uv pre-commit \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ # Create non-root user 'code'
20
+ ARG USER_UID=1000
21
+ ARG USER_GID=$USER_UID
22
+ RUN groupadd --gid $USER_GID code \
23
+ && useradd --uid $USER_UID --gid $USER_GID -m -s /bin/bash code
24
+
25
+ # Set working directory
26
+ WORKDIR /workspace
27
+
28
+ USER code
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "vnbdigital-client Development",
3
+ "build": {
4
+ "dockerfile": "Dockerfile",
5
+ "context": ".."
6
+ },
7
+ "features": {
8
+ "ghcr.io/devcontainers/features/common-utils:2": {
9
+ "username": "code",
10
+ "installZsh": true,
11
+ "ohMyZsh": true,
12
+ "ohMyZshTheme": "fino",
13
+ "configureZshAsDefaultShell": true
14
+ },
15
+ "ghcr.io/devcontainers/features/github-cli:1": {}
16
+ },
17
+ "initializeCommand": "bash -c 'TOKEN=$(gh auth token 2>/dev/null) && echo GITHUB_TOKEN=$TOKEN > .devcontainer/.env || echo GITHUB_TOKEN= > .devcontainer/.env'",
18
+ "runArgs": [
19
+ "--env-file",
20
+ ".devcontainer/.env"
21
+ ],
22
+ "mounts": [
23
+ "source=${localEnv:SSH_AUTH_SOCK},target=/ssh-agent,type=bind,consistency=cached"
24
+ ],
25
+ "containerEnv": {
26
+ "SSH_AUTH_SOCK": "/ssh-agent"
27
+ },
28
+ "customizations": {
29
+ "vscode": {
30
+ "extensions": [
31
+ "ms-python.python",
32
+ "ms-python.vscode-pylance",
33
+ "ms-python.black-formatter",
34
+ "charliermarsh.ruff",
35
+ "GitHub.copilot",
36
+ "GitHub.copilot-chat"
37
+ ],
38
+ "settings": {
39
+ "python.defaultInterpreterPath": "/usr/local/bin/python",
40
+ "python.linting.enabled": true,
41
+ "python.linting.ruffEnabled": true,
42
+ "python.formatting.provider": "black",
43
+ "editor.formatOnSave": true,
44
+ "editor.codeActionsOnSave": {
45
+ "source.organizeImports": "explicit"
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "remoteUser": "code"
51
+ }
@@ -0,0 +1,40 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+ strategy:
15
+ matrix:
16
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v4
23
+ with:
24
+ enable-cache: true
25
+
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ run: uv python install ${{ matrix.python-version }}
28
+
29
+ - name: Lint with ruff
30
+ run: uv run --extra dev ruff check src/
31
+
32
+ - name: Format check with black
33
+ run: uv run --extra dev black --check src/
34
+
35
+ - name: Type check with mypy
36
+ run: uv run --extra dev mypy src/vnbdigital_client/
37
+ continue-on-error: true
38
+
39
+ - name: Run tests
40
+ run: uv run --extra dev pytest
@@ -0,0 +1,62 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+
7
+ jobs:
8
+ pypi-publish:
9
+ name: Version, build & publish to PyPI
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/vnbdigital-client
14
+ permissions:
15
+ contents: write
16
+ id-token: write
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Determine version
23
+ id: version
24
+ uses: paulhatch/semantic-version@v5.4.0
25
+ with:
26
+ tag_prefix: "v"
27
+ major_pattern: "/(feat|fix|refactor)!:/"
28
+ minor_pattern: "/^feat:/"
29
+ version_format: "${major}.${minor}.${patch}"
30
+ bump_each_commit: true
31
+ search_commit_body: true
32
+
33
+ - name: Set version in pyproject.toml
34
+ run: |
35
+ sed -i 's/^version = ".*"/version = "${{ steps.version.outputs.version }}"/' pyproject.toml
36
+
37
+ - name: Create git tag
38
+ run: |
39
+ git config user.name "github-actions[bot]"
40
+ git config user.email "github-actions[bot]@users.noreply.github.com"
41
+ git tag "v${{ steps.version.outputs.version }}"
42
+ git push origin "v${{ steps.version.outputs.version }}"
43
+
44
+ - name: Install uv
45
+ uses: astral-sh/setup-uv@v4
46
+
47
+ - name: Set up Python
48
+ run: uv python install 3.12
49
+
50
+ - name: Build package
51
+ run: uv build
52
+
53
+ - name: Create GitHub Release
54
+ uses: softprops/action-gh-release@v2
55
+ with:
56
+ tag_name: "v${{ steps.version.outputs.version }}"
57
+ name: "v${{ steps.version.outputs.version }}"
58
+ generate_release_notes: true
59
+ files: dist/*
60
+
61
+ - name: Publish package distributions to PyPI
62
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,146 @@
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
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+ cover/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Django stuff:
57
+ *.log
58
+ local_settings.py
59
+ db.sqlite3
60
+ db.sqlite3-journal
61
+
62
+ # Flask stuff:
63
+ instance/
64
+ .webassets-cache
65
+
66
+ # Scrapy stuff:
67
+ .scrapy
68
+
69
+ # Sphinx documentation
70
+ docs/_build/
71
+
72
+ # PyBuilder
73
+ .pybuilder/
74
+ target/
75
+
76
+ # Jupyter Notebook
77
+ .ipynb_checkpoints
78
+
79
+ # IPython
80
+ profile_default/
81
+ ipython_config.py
82
+
83
+ # pyenv
84
+ .python-version
85
+
86
+ # pipenv
87
+ Pipfile.lock
88
+
89
+ # poetry
90
+ poetry.lock
91
+
92
+ # pdm
93
+ .pdm.toml
94
+
95
+ # PEP 582
96
+ __pypackages__/
97
+
98
+ # Celery stuff
99
+ celerybeat-schedule
100
+ celerybeat.pid
101
+
102
+ # SageMath parsed files
103
+ *.sage.py
104
+
105
+ # Environments
106
+ .env
107
+ .venv
108
+ env/
109
+ venv/
110
+ ENV/
111
+ env.bak/
112
+ venv.bak/
113
+
114
+ # Spyder project settings
115
+ .spyderproject
116
+ .spyproject
117
+
118
+ # Rope project settings
119
+ .ropeproject
120
+
121
+ # mkdocs documentation
122
+ /site
123
+
124
+ # mypy
125
+ .mypy_cache/
126
+ .dmypy.json
127
+ dmypy.json
128
+
129
+ # Pyre type checker
130
+ .pyre/
131
+
132
+ # pytype static type analyzer
133
+ .pytype/
134
+
135
+ # Cython debug symbols
136
+ cython_debug/
137
+
138
+ # IDEs
139
+ .vscode/
140
+ .idea/
141
+ *.swp
142
+ *.swo
143
+ *~
144
+
145
+ # uv
146
+ .uv/
@@ -0,0 +1,43 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v6.0.0
6
+ hooks:
7
+ - id: trailing-whitespace
8
+ - id: end-of-file-fixer
9
+ - id: check-yaml
10
+ - id: check-toml
11
+ - id: check-json
12
+ - id: check-added-large-files
13
+ - id: check-merge-conflict
14
+ - id: debug-statements
15
+ - id: check-ast
16
+
17
+ - repo: https://github.com/astral-sh/ruff-pre-commit
18
+ rev: v0.15.0
19
+ hooks:
20
+ # Linter
21
+ - id: ruff
22
+ args: [--fix]
23
+ # Formatter
24
+ - id: ruff-format
25
+
26
+ - repo: https://github.com/psf/black
27
+ rev: 26.1.0
28
+ hooks:
29
+ - id: black
30
+ args: [--line-length=100, --target-version=py39]
31
+
32
+ - repo: https://github.com/pre-commit/mirrors-mypy
33
+ rev: v1.19.1
34
+ hooks:
35
+ - id: mypy
36
+ additional_dependencies:
37
+ - types-requests
38
+ args: [--ignore-missing-imports]
39
+
40
+ - repo: https://github.com/python-jsonschema/check-jsonschema
41
+ rev: 0.36.1
42
+ hooks:
43
+ - id: check-github-workflows
@@ -0,0 +1,47 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-02-08
9
+
10
+ ### Added
11
+ - Initial release of vnbdigital-client
12
+ - Python client library for accessing vnbdigital.de database
13
+ - GraphQL abstraction layer with simple API methods:
14
+ - `search()` - Search for items
15
+ - `get_item()` - Get specific item by ID
16
+ - `list_collections()` - List all collections
17
+ - `get_collection()` - Get items from a collection
18
+ - Command-line interface (CLI) with Click:
19
+ - `vnbdigital search` - Search for items
20
+ - `vnbdigital get` - Get specific item
21
+ - `vnbdigital collections` - List collections
22
+ - `vnbdigital collection` - Get collection items
23
+ - Support for JSON and table output formats
24
+ - Project setup with uv package manager
25
+ - pyproject.toml configuration
26
+ - Renovate configuration for automated dependency updates
27
+ - GitHub Actions workflows:
28
+ - CI workflow for testing and linting
29
+ - PyPI publish workflow for releases
30
+ - Dev container support with:
31
+ - Dockerfile with Python 3.12 and uv
32
+ - VS Code devcontainer.json configuration
33
+ - Comprehensive test suite with pytest (67% coverage)
34
+ - Documentation:
35
+ - Detailed README with usage examples
36
+ - Contributing guidelines
37
+ - Example scripts
38
+ - Code quality tools:
39
+ - Black for code formatting
40
+ - Ruff for linting
41
+ - mypy for type checking
42
+
43
+ ### Security
44
+ - Added explicit permissions to GitHub Actions workflows
45
+ - Passed CodeQL security scanning with no alerts
46
+
47
+ [0.1.0]: https://github.com/the78mole/vnbdigital-client/releases/tag/v0.1.0
@@ -0,0 +1,247 @@
1
+ # Contributing to vnbdigital-client
2
+
3
+ Thank you for your interest in contributing to vnbdigital-client! This document provides guidelines and instructions for contributing.
4
+
5
+ ## Development Setup
6
+
7
+ ### Prerequisites
8
+
9
+ - Python 3.9 or higher
10
+ - [uv](https://github.com/astral-sh/uv) package manager
11
+
12
+ ### Setting Up Your Development Environment
13
+
14
+ 1. **Clone the repository:**
15
+ ```bash
16
+ git clone https://github.com/the78mole/vnbdigital-client.git
17
+ cd vnbdigital-client
18
+ ```
19
+
20
+ 2. **Install uv:**
21
+ ```bash
22
+ curl -LsSf https://astral.sh/uv/install.sh | sh
23
+ ```
24
+
25
+ 3. **Run directly with `uv` (automatically creates `.venv` and installs dependencies):**
26
+ ```bash
27
+ uv run --extra dev pytest
28
+ ```
29
+
30
+ Alternativ kannst du die Umgebung auch manuell einrichten:
31
+ ```bash
32
+ uv venv
33
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
34
+ uv pip install -e ".[dev]"
35
+ ```
36
+
37
+ ### Using Dev Container (Optional)
38
+
39
+ If you use VS Code, you can use the provided dev container:
40
+
41
+ 1. Install the "Dev Containers" extension
42
+ 2. Open the project in VS Code
43
+ 3. Click "Reopen in Container" when prompted
44
+ 4. The workspace is mounted into the container automatically
45
+ 5. When you run the first `uv` command, it will create a `.venv` and install dependencies
46
+
47
+ ## Development Workflow
48
+
49
+ ### Running Tests
50
+
51
+ ```bash
52
+ # Run all tests
53
+ uv run --extra dev pytest
54
+
55
+ # Run with coverage
56
+ uv run --extra dev pytest --cov=vnbdigital_client --cov-report=html
57
+
58
+ # Run specific test file
59
+ uv run --extra dev pytest tests/test_client.py
60
+ ```
61
+
62
+ ### Code Formatting
63
+
64
+ We use [Black](https://github.com/psf/black) for code formatting:
65
+
66
+ ```bash
67
+ # Format code
68
+ uv run --extra dev black src/ tests/ examples/
69
+
70
+ # Check formatting without making changes
71
+ uv run --extra dev black --check src/
72
+ ```
73
+
74
+ ### Linting
75
+
76
+ We use [Ruff](https://github.com/astral-sh/ruff) for linting:
77
+
78
+ ```bash
79
+ # Run linter
80
+ uv run --extra dev ruff check src/
81
+
82
+ # Auto-fix issues
83
+ uv run --extra dev ruff check src/ --fix
84
+ ```
85
+
86
+ ### Type Checking
87
+
88
+ We use [mypy](https://mypy-lang.org/) for type checking:
89
+
90
+ ```bash
91
+ uv run --extra dev mypy src/vnbdigital_client/
92
+ ```
93
+
94
+ ### Building the Package
95
+
96
+ ```bash
97
+ uv build
98
+ ```
99
+
100
+ ## Making Changes
101
+
102
+ ### Branch Naming
103
+
104
+ - Feature branches: `feature/description-of-feature`
105
+ - Bug fix branches: `fix/description-of-bug`
106
+ - Documentation: `docs/description-of-change`
107
+
108
+ ### Commit Messages
109
+
110
+ Follow these guidelines for commit messages:
111
+
112
+ - Use present tense ("Add feature" not "Added feature")
113
+ - Use imperative mood ("Move cursor to..." not "Moves cursor to...")
114
+ - Limit the first line to 72 characters
115
+ - Reference issues and pull requests when relevant
116
+
117
+ Example:
118
+ ```
119
+ Add support for advanced search filters
120
+
121
+ - Add filter parameters to search method
122
+ - Update CLI to accept filter options
123
+ - Add tests for new functionality
124
+
125
+ Fixes #123
126
+ ```
127
+
128
+ ### Pull Request Process
129
+
130
+ 1. **Create a new branch** from `main`
131
+ 2. **Make your changes** following the coding standards
132
+ 3. **Add or update tests** for your changes
133
+ 4. **Update documentation** if needed
134
+ 5. **Ensure all tests pass** and code is formatted
135
+ 6. **Submit a pull request** with a clear description
136
+
137
+ ### Pull Request Checklist
138
+
139
+ Before submitting your PR, make sure:
140
+
141
+ - [ ] Tests pass (`uv run --extra dev pytest`)
142
+ - [ ] Code is formatted (`uv run --extra dev black src/ tests/`)
143
+ - [ ] Linting passes (`uv run --extra dev ruff check src/`)
144
+ - [ ] Type checking passes (`uv run --extra dev mypy src/vnbdigital_client/`)
145
+ - [ ] Documentation is updated (if applicable)
146
+ - [ ] CHANGELOG is updated (if applicable)
147
+ - [ ] Commit messages follow guidelines
148
+
149
+ ## Code Style
150
+
151
+ ### Python Code
152
+
153
+ - Follow [PEP 8](https://pep8.org/) style guide
154
+ - Use type hints for function signatures
155
+ - Maximum line length: 100 characters
156
+ - Use descriptive variable names
157
+ - Add docstrings for public functions and classes
158
+
159
+ ### Example:
160
+
161
+ ```python
162
+ from typing import List, Dict, Any
163
+
164
+ def search_items(query: str, limit: int = 10) -> List[Dict[str, Any]]:
165
+ """
166
+ Search for items matching the query.
167
+
168
+ Args:
169
+ query: Search query string
170
+ limit: Maximum number of results to return
171
+
172
+ Returns:
173
+ List of matching items
174
+
175
+ Raises:
176
+ ValueError: If query is empty
177
+ """
178
+ if not query:
179
+ raise ValueError("Query cannot be empty")
180
+
181
+ # Implementation here
182
+ return []
183
+ ```
184
+
185
+ ## Testing Guidelines
186
+
187
+ ### Writing Tests
188
+
189
+ - Place tests in the `tests/` directory
190
+ - Test files should start with `test_`
191
+ - Test functions should start with `test_`
192
+ - Use descriptive test names that explain what is being tested
193
+ - Mock external API calls
194
+ - Aim for high code coverage
195
+
196
+ ### Example Test:
197
+
198
+ ```python
199
+ from unittest.mock import Mock, patch
200
+ from vnbdigital_client import VNBDigitalClient
201
+
202
+ @patch('vnbdigital_client.client.Client')
203
+ def test_search_returns_results(mock_client_class):
204
+ """Test that search returns expected results."""
205
+ mock_client = Mock()
206
+ mock_client.execute.return_value = {
207
+ "search": [{"id": "1", "title": "Test"}]
208
+ }
209
+ mock_client_class.return_value = mock_client
210
+
211
+ client = VNBDigitalClient()
212
+ results = client.search("test")
213
+
214
+ assert len(results) == 1
215
+ assert results[0]["id"] == "1"
216
+ ```
217
+
218
+ ## Documentation
219
+
220
+ ### Updating README
221
+
222
+ When adding new features:
223
+ - Update the usage examples
224
+ - Add new CLI commands to the command reference
225
+ - Update the feature list if applicable
226
+
227
+ ### Code Documentation
228
+
229
+ - Add docstrings to all public functions and classes
230
+ - Use Google-style docstrings
231
+ - Include examples in docstrings for complex functions
232
+
233
+ ## Getting Help
234
+
235
+ If you have questions or need help:
236
+
237
+ 1. Check existing issues and discussions
238
+ 2. Read the README and documentation
239
+ 3. Open a new issue with the "question" label
240
+
241
+ ## Code of Conduct
242
+
243
+ Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
244
+
245
+ ## License
246
+
247
+ By contributing to vnbdigital-client, you agree that your contributions will be licensed under the MIT License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel Glaser
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.