datamasque-python 1.0.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.
- datamasque_python-1.0.0/.editorconfig +21 -0
- datamasque_python-1.0.0/.github/workflows/ci.yml +124 -0
- datamasque_python-1.0.0/.github/workflows/release-testpypi.yml +60 -0
- datamasque_python-1.0.0/.github/workflows/release.yml +62 -0
- datamasque_python-1.0.0/.gitignore +55 -0
- datamasque_python-1.0.0/.readthedocs.yaml +18 -0
- datamasque_python-1.0.0/CONTRIBUTING.rst +166 -0
- datamasque_python-1.0.0/HISTORY.rst +194 -0
- datamasque_python-1.0.0/LICENSE +201 -0
- datamasque_python-1.0.0/MANIFEST.in +11 -0
- datamasque_python-1.0.0/Makefile +82 -0
- datamasque_python-1.0.0/NOTICE +4 -0
- datamasque_python-1.0.0/PKG-INFO +113 -0
- datamasque_python-1.0.0/README.rst +81 -0
- datamasque_python-1.0.0/datamasque/client/__init__.py +204 -0
- datamasque_python-1.0.0/datamasque/client/base.py +304 -0
- datamasque_python-1.0.0/datamasque/client/connections.py +64 -0
- datamasque_python-1.0.0/datamasque/client/discovery.py +286 -0
- datamasque_python-1.0.0/datamasque/client/dmclient.py +49 -0
- datamasque_python-1.0.0/datamasque/client/exceptions.py +75 -0
- datamasque_python-1.0.0/datamasque/client/files.py +92 -0
- datamasque_python-1.0.0/datamasque/client/ifm.py +301 -0
- datamasque_python-1.0.0/datamasque/client/license.py +41 -0
- datamasque_python-1.0.0/datamasque/client/models/__init__.py +0 -0
- datamasque_python-1.0.0/datamasque/client/models/connection.py +429 -0
- datamasque_python-1.0.0/datamasque/client/models/data_selection.py +62 -0
- datamasque_python-1.0.0/datamasque/client/models/discovery.py +229 -0
- datamasque_python-1.0.0/datamasque/client/models/dm_instance.py +39 -0
- datamasque_python-1.0.0/datamasque/client/models/files.py +89 -0
- datamasque_python-1.0.0/datamasque/client/models/ifm.py +177 -0
- datamasque_python-1.0.0/datamasque/client/models/license.py +60 -0
- datamasque_python-1.0.0/datamasque/client/models/pagination.py +29 -0
- datamasque_python-1.0.0/datamasque/client/models/ruleset.py +45 -0
- datamasque_python-1.0.0/datamasque/client/models/ruleset_library.py +22 -0
- datamasque_python-1.0.0/datamasque/client/models/runs.py +165 -0
- datamasque_python-1.0.0/datamasque/client/models/status.py +68 -0
- datamasque_python-1.0.0/datamasque/client/models/user.py +69 -0
- datamasque_python-1.0.0/datamasque/client/py.typed +0 -0
- datamasque_python-1.0.0/datamasque/client/ruleset_libraries.py +164 -0
- datamasque_python-1.0.0/datamasque/client/rulesets.py +57 -0
- datamasque_python-1.0.0/datamasque/client/runs.py +189 -0
- datamasque_python-1.0.0/datamasque/client/settings.py +76 -0
- datamasque_python-1.0.0/datamasque/client/users.py +96 -0
- datamasque_python-1.0.0/docs/Makefile +20 -0
- datamasque_python-1.0.0/docs/client.models.rst +101 -0
- datamasque_python-1.0.0/docs/client.rst +117 -0
- datamasque_python-1.0.0/docs/conf.py +172 -0
- datamasque_python-1.0.0/docs/contributing.rst +1 -0
- datamasque_python-1.0.0/docs/history.rst +1 -0
- datamasque_python-1.0.0/docs/index.rst +19 -0
- datamasque_python-1.0.0/docs/installation.rst +38 -0
- datamasque_python-1.0.0/docs/make.bat +36 -0
- datamasque_python-1.0.0/docs/modules.rst +7 -0
- datamasque_python-1.0.0/docs/readme.rst +1 -0
- datamasque_python-1.0.0/docs/usage.rst +21 -0
- datamasque_python-1.0.0/pyproject.toml +123 -0
- datamasque_python-1.0.0/setup.cfg +8 -0
- datamasque_python-1.0.0/tests/__init__.py +1 -0
- datamasque_python-1.0.0/tests/conftest.py +74 -0
- datamasque_python-1.0.0/tests/helpers.py +160 -0
- datamasque_python-1.0.0/tests/test_base.py +321 -0
- datamasque_python-1.0.0/tests/test_connections.py +1158 -0
- datamasque_python-1.0.0/tests/test_discovery.py +729 -0
- datamasque_python-1.0.0/tests/test_files.py +273 -0
- datamasque_python-1.0.0/tests/test_ifm.py +404 -0
- datamasque_python-1.0.0/tests/test_license.py +47 -0
- datamasque_python-1.0.0/tests/test_pagination.py +153 -0
- datamasque_python-1.0.0/tests/test_ruleset_library.py +673 -0
- datamasque_python-1.0.0/tests/test_rulesets.py +119 -0
- datamasque_python-1.0.0/tests/test_runs.py +468 -0
- datamasque_python-1.0.0/tests/test_settings.py +107 -0
- datamasque_python-1.0.0/tests/test_users.py +399 -0
- datamasque_python-1.0.0/uv.lock +1486 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# http://editorconfig.org
|
|
2
|
+
|
|
3
|
+
root = true
|
|
4
|
+
|
|
5
|
+
[*]
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 4
|
|
8
|
+
trim_trailing_whitespace = true
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
charset = utf-8
|
|
11
|
+
end_of_line = lf
|
|
12
|
+
|
|
13
|
+
[*.bat]
|
|
14
|
+
indent_style = tab
|
|
15
|
+
end_of_line = crlf
|
|
16
|
+
|
|
17
|
+
[LICENSE]
|
|
18
|
+
insert_final_newline = false
|
|
19
|
+
|
|
20
|
+
[Makefile]
|
|
21
|
+
indent_style = tab
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
lint:
|
|
15
|
+
name: Lint (ruff)
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up uv
|
|
21
|
+
uses: astral-sh/setup-uv@v5
|
|
22
|
+
with:
|
|
23
|
+
enable-cache: true
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
run: uv python install 3.12
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: uv sync --frozen
|
|
30
|
+
|
|
31
|
+
- name: ruff check
|
|
32
|
+
run: uv run ruff check datamasque tests
|
|
33
|
+
|
|
34
|
+
- name: ruff format --check
|
|
35
|
+
run: uv run ruff format --check datamasque tests
|
|
36
|
+
|
|
37
|
+
typecheck:
|
|
38
|
+
name: Typecheck (mypy)
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
|
|
43
|
+
- name: Set up uv
|
|
44
|
+
uses: astral-sh/setup-uv@v5
|
|
45
|
+
with:
|
|
46
|
+
enable-cache: true
|
|
47
|
+
|
|
48
|
+
- name: Set up Python
|
|
49
|
+
run: uv python install 3.12
|
|
50
|
+
|
|
51
|
+
- name: Install dependencies
|
|
52
|
+
run: uv sync --frozen
|
|
53
|
+
|
|
54
|
+
- name: mypy
|
|
55
|
+
run: uv run mypy datamasque
|
|
56
|
+
|
|
57
|
+
test:
|
|
58
|
+
name: Tests (py${{ matrix.python-version }})
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
strategy:
|
|
61
|
+
fail-fast: false
|
|
62
|
+
matrix:
|
|
63
|
+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/checkout@v4
|
|
66
|
+
|
|
67
|
+
- name: Set up uv
|
|
68
|
+
uses: astral-sh/setup-uv@v5
|
|
69
|
+
with:
|
|
70
|
+
enable-cache: true
|
|
71
|
+
|
|
72
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
73
|
+
run: uv python install ${{ matrix.python-version }}
|
|
74
|
+
|
|
75
|
+
- name: Install dependencies
|
|
76
|
+
run: uv sync --frozen --python ${{ matrix.python-version }}
|
|
77
|
+
|
|
78
|
+
- name: pytest
|
|
79
|
+
run: >-
|
|
80
|
+
uv run --python ${{ matrix.python-version }}
|
|
81
|
+
pytest tests/
|
|
82
|
+
--junitxml=report.xml
|
|
83
|
+
--cov=datamasque
|
|
84
|
+
--cov-report=term
|
|
85
|
+
--cov-report=xml:coverage.xml
|
|
86
|
+
--import-mode=importlib
|
|
87
|
+
|
|
88
|
+
- name: Upload test results
|
|
89
|
+
if: always()
|
|
90
|
+
uses: actions/upload-artifact@v4
|
|
91
|
+
with:
|
|
92
|
+
name: test-results-py${{ matrix.python-version }}
|
|
93
|
+
path: |
|
|
94
|
+
report.xml
|
|
95
|
+
coverage.xml
|
|
96
|
+
retention-days: 7
|
|
97
|
+
|
|
98
|
+
docs:
|
|
99
|
+
name: Docs (sphinx)
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@v4
|
|
103
|
+
|
|
104
|
+
- name: Set up uv
|
|
105
|
+
uses: astral-sh/setup-uv@v5
|
|
106
|
+
with:
|
|
107
|
+
enable-cache: true
|
|
108
|
+
|
|
109
|
+
- name: Set up Python
|
|
110
|
+
run: uv python install 3.12
|
|
111
|
+
|
|
112
|
+
- name: Install dependencies
|
|
113
|
+
run: uv sync --frozen
|
|
114
|
+
|
|
115
|
+
- name: sphinx-build
|
|
116
|
+
run: uv run sphinx-build -b html -W --keep-going docs docs/_build/html
|
|
117
|
+
|
|
118
|
+
- name: Upload built docs
|
|
119
|
+
if: always()
|
|
120
|
+
uses: actions/upload-artifact@v4
|
|
121
|
+
with:
|
|
122
|
+
name: docs-html
|
|
123
|
+
path: docs/_build/html
|
|
124
|
+
retention-days: 7
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Release (TestPyPI)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
name: Build sdist and wheel
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
|
|
13
|
+
- name: Set up uv
|
|
14
|
+
uses: astral-sh/setup-uv@v5
|
|
15
|
+
with:
|
|
16
|
+
enable-cache: true
|
|
17
|
+
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
run: uv python install 3.12
|
|
20
|
+
|
|
21
|
+
- name: Show package version
|
|
22
|
+
run: |
|
|
23
|
+
VERSION="$(uv run python -c 'import tomllib; print(tomllib.loads(open("pyproject.toml","rb").read().decode())["project"]["version"])')"
|
|
24
|
+
echo "Publishing version: ${VERSION}"
|
|
25
|
+
echo "::notice title=TestPyPI version::${VERSION}"
|
|
26
|
+
|
|
27
|
+
- name: Build
|
|
28
|
+
run: uv build
|
|
29
|
+
|
|
30
|
+
- name: Validate distributions
|
|
31
|
+
run: uvx twine check dist/*
|
|
32
|
+
|
|
33
|
+
- name: Upload distributions
|
|
34
|
+
uses: actions/upload-artifact@v4
|
|
35
|
+
with:
|
|
36
|
+
name: dist-testpypi
|
|
37
|
+
path: dist/
|
|
38
|
+
retention-days: 7
|
|
39
|
+
|
|
40
|
+
publish:
|
|
41
|
+
name: Publish to TestPyPI
|
|
42
|
+
needs: build
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
environment:
|
|
45
|
+
name: testpypi
|
|
46
|
+
url: https://test.pypi.org/p/datamasque-python
|
|
47
|
+
permissions:
|
|
48
|
+
id-token: write
|
|
49
|
+
contents: read
|
|
50
|
+
steps:
|
|
51
|
+
- name: Download distributions
|
|
52
|
+
uses: actions/download-artifact@v4
|
|
53
|
+
with:
|
|
54
|
+
name: dist-testpypi
|
|
55
|
+
path: dist/
|
|
56
|
+
|
|
57
|
+
- name: Publish to TestPyPI
|
|
58
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
59
|
+
with:
|
|
60
|
+
repository-url: https://test.pypi.org/legacy/
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
name: Build sdist and wheel
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Set up uv
|
|
16
|
+
uses: astral-sh/setup-uv@v5
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
run: uv python install 3.12
|
|
22
|
+
|
|
23
|
+
- name: Verify tag matches package version
|
|
24
|
+
run: |
|
|
25
|
+
TAG_VERSION="${GITHUB_REF_NAME#v}"
|
|
26
|
+
PKG_VERSION="$(uv run python -c 'import tomllib,sys; print(tomllib.loads(open("pyproject.toml","rb").read().decode())["project"]["version"])')"
|
|
27
|
+
echo "Tag version: ${TAG_VERSION}"
|
|
28
|
+
echo "Package version: ${PKG_VERSION}"
|
|
29
|
+
if [ "${TAG_VERSION}" != "${PKG_VERSION}" ]; then
|
|
30
|
+
echo "::error::Tag ${GITHUB_REF_NAME} does not match pyproject.toml version ${PKG_VERSION}"
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
- name: Build
|
|
35
|
+
run: uv build
|
|
36
|
+
|
|
37
|
+
- name: Upload distributions
|
|
38
|
+
uses: actions/upload-artifact@v4
|
|
39
|
+
with:
|
|
40
|
+
name: dist
|
|
41
|
+
path: dist/
|
|
42
|
+
retention-days: 7
|
|
43
|
+
|
|
44
|
+
publish:
|
|
45
|
+
name: Publish to PyPI
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
environment:
|
|
49
|
+
name: pypi
|
|
50
|
+
url: https://pypi.org/p/datamasque-python
|
|
51
|
+
permissions:
|
|
52
|
+
id-token: write
|
|
53
|
+
contents: read
|
|
54
|
+
steps:
|
|
55
|
+
- name: Download distributions
|
|
56
|
+
uses: actions/download-artifact@v4
|
|
57
|
+
with:
|
|
58
|
+
name: dist
|
|
59
|
+
path: dist/
|
|
60
|
+
|
|
61
|
+
- name: Publish to PyPI
|
|
62
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
.Python
|
|
8
|
+
build/
|
|
9
|
+
develop-eggs/
|
|
10
|
+
dist/
|
|
11
|
+
downloads/
|
|
12
|
+
eggs/
|
|
13
|
+
.eggs/
|
|
14
|
+
lib/
|
|
15
|
+
lib64/
|
|
16
|
+
parts/
|
|
17
|
+
sdist/
|
|
18
|
+
var/
|
|
19
|
+
wheels/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
.installed.cfg
|
|
22
|
+
*.egg
|
|
23
|
+
|
|
24
|
+
# Unit test / coverage reports
|
|
25
|
+
htmlcov/
|
|
26
|
+
.tox/
|
|
27
|
+
.coverage
|
|
28
|
+
.coverage.*
|
|
29
|
+
.cache
|
|
30
|
+
coverage.xml
|
|
31
|
+
report.xml
|
|
32
|
+
*.cover
|
|
33
|
+
.hypothesis/
|
|
34
|
+
.pytest_cache/
|
|
35
|
+
|
|
36
|
+
# Sphinx documentation
|
|
37
|
+
docs/_build/
|
|
38
|
+
|
|
39
|
+
# pyenv
|
|
40
|
+
.python-version
|
|
41
|
+
|
|
42
|
+
# dotenv
|
|
43
|
+
.env
|
|
44
|
+
|
|
45
|
+
# virtualenv
|
|
46
|
+
.venv
|
|
47
|
+
venv/
|
|
48
|
+
ENV/
|
|
49
|
+
|
|
50
|
+
# mypy
|
|
51
|
+
.mypy_cache/
|
|
52
|
+
|
|
53
|
+
# IDE settings
|
|
54
|
+
.vscode/
|
|
55
|
+
.idea/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Read the Docs configuration file
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
|
|
6
|
+
build:
|
|
7
|
+
os: ubuntu-24.04
|
|
8
|
+
tools:
|
|
9
|
+
python: "3.13"
|
|
10
|
+
jobs:
|
|
11
|
+
post_create_environment:
|
|
12
|
+
- pip install uv
|
|
13
|
+
post_install:
|
|
14
|
+
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --frozen --all-groups
|
|
15
|
+
|
|
16
|
+
sphinx:
|
|
17
|
+
configuration: docs/conf.py
|
|
18
|
+
fail_on_warning: true
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
============
|
|
2
|
+
Contributing
|
|
3
|
+
============
|
|
4
|
+
|
|
5
|
+
Thanks for your interest in contributing to ``datamasque-python``!
|
|
6
|
+
Contributions, bug reports, and feature requests are all welcome.
|
|
7
|
+
|
|
8
|
+
Reporting bugs
|
|
9
|
+
==============
|
|
10
|
+
|
|
11
|
+
File an issue on the `GitHub issue tracker <https://github.com/datamasque/datamasque-python/issues>`_.
|
|
12
|
+
Please include:
|
|
13
|
+
|
|
14
|
+
- the version of ``datamasque-python`` you're using (``pip show datamasque-python``);
|
|
15
|
+
- the Python version and operating system;
|
|
16
|
+
- a minimal reproducer if possible;
|
|
17
|
+
- the full traceback if the bug manifests as an exception.
|
|
18
|
+
|
|
19
|
+
If the bug concerns a specific DataMasque server API response,
|
|
20
|
+
include the status code and (with any sensitive fields redacted) the response body.
|
|
21
|
+
|
|
22
|
+
Feature requests
|
|
23
|
+
================
|
|
24
|
+
|
|
25
|
+
Open an issue describing what you'd like to do and why.
|
|
26
|
+
We're particularly interested in feedback on:
|
|
27
|
+
|
|
28
|
+
- public API shape (method names, argument names, return types);
|
|
29
|
+
- endpoints not yet wrapped by the client;
|
|
30
|
+
- improvements to the typed return models.
|
|
31
|
+
|
|
32
|
+
Development setup
|
|
33
|
+
=================
|
|
34
|
+
|
|
35
|
+
The project uses `uv <https://docs.astral.sh/uv/>`_ for dependency management.
|
|
36
|
+
Install dependencies and set up a virtual environment:
|
|
37
|
+
|
|
38
|
+
.. code-block:: console
|
|
39
|
+
|
|
40
|
+
git clone https://github.com/datamasque/datamasque-python.git
|
|
41
|
+
cd datamasque-python
|
|
42
|
+
uv sync
|
|
43
|
+
|
|
44
|
+
Running the tests
|
|
45
|
+
=================
|
|
46
|
+
|
|
47
|
+
.. code-block:: console
|
|
48
|
+
|
|
49
|
+
uv run pytest
|
|
50
|
+
|
|
51
|
+
The test suite runs entirely against mocked HTTP responses (``requests_mock``),
|
|
52
|
+
so no DataMasque server is required.
|
|
53
|
+
|
|
54
|
+
Linting and type-checking
|
|
55
|
+
=========================
|
|
56
|
+
|
|
57
|
+
.. code-block:: console
|
|
58
|
+
|
|
59
|
+
uv run ruff check datamasque tests
|
|
60
|
+
uv run ruff format --check datamasque tests
|
|
61
|
+
uv run mypy datamasque
|
|
62
|
+
|
|
63
|
+
``ruff check`` enforces import order,
|
|
64
|
+
Python style,
|
|
65
|
+
and a set of pydocstyle rules (``D101``, ``D102``, ``D204``, ``D205``, ``D213``)
|
|
66
|
+
that require docstrings on all public classes and methods.
|
|
67
|
+
``ruff format`` applies the project's formatting style.
|
|
68
|
+
``mypy`` runs in strict mode with ``disallow_untyped_defs``.
|
|
69
|
+
|
|
70
|
+
Code style
|
|
71
|
+
==========
|
|
72
|
+
|
|
73
|
+
- **Line length:**
|
|
74
|
+
120 characters.
|
|
75
|
+
Enforced by ``ruff format``.
|
|
76
|
+
- **Docstrings and comments:**
|
|
77
|
+
use `semantic line breaks <https://sembr.org/>`_ —
|
|
78
|
+
break at clause boundaries, not column widths.
|
|
79
|
+
This applies to text files (such as this file) as well as Python source.
|
|
80
|
+
- **Docstring content:**
|
|
81
|
+
|
|
82
|
+
- Write for library consumers, not maintainers.
|
|
83
|
+
- Keep docstrings concise; no internal implementation notes.
|
|
84
|
+
- Multi-line docstrings start on the next line after the opening triple quotes.
|
|
85
|
+
- In Python docstrings,
|
|
86
|
+
use single backticks around anything code-like —
|
|
87
|
+
``default_role = "any"`` in ``docs/conf.py`` makes Sphinx auto-link Python identifiers
|
|
88
|
+
and render everything else as monospace.
|
|
89
|
+
In top-level ``.rst`` files (``README.rst``, ``CONTRIBUTING.rst``, ``HISTORY.rst``)
|
|
90
|
+
use double backticks instead —
|
|
91
|
+
those are rendered directly by GitHub,
|
|
92
|
+
which doesn't honour the Sphinx role config.
|
|
93
|
+
|
|
94
|
+
- **Enum member casing:**
|
|
95
|
+
enum members are ``lower_snake_case``, for example, ``DatabaseType.postgres``.
|
|
96
|
+
- **Enum comparisons:**
|
|
97
|
+
use ``is`` / ``is not`` when comparing against specific enum members, not ``==`` / ``!=``.
|
|
98
|
+
- **String formatting in messages:**
|
|
99
|
+
errors, log lines, and other user-facing messages follow a consistent quoting convention —
|
|
100
|
+
backticks around enum values and code identifiers,
|
|
101
|
+
double quotes around free-form string values.
|
|
102
|
+
Avoid ``!r`` in f-strings;
|
|
103
|
+
it produces Python's default single-quoted ``repr``,
|
|
104
|
+
which conflicts with the convention.
|
|
105
|
+
Use a single-quoted outer f-string
|
|
106
|
+
so double-quoted value literals don't need escaping:
|
|
107
|
+
|
|
108
|
+
.. code-block:: python
|
|
109
|
+
|
|
110
|
+
raise DataMasqueUserError(
|
|
111
|
+
f'The ruleset "{name}" is in `{state.value}` state.'
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
``__str__`` follows this rule (it is a user-facing representation).
|
|
115
|
+
``__repr__`` does not —
|
|
116
|
+
it follows Python's native ``repr`` convention,
|
|
117
|
+
where ``!r`` and single quotes are idiomatic.
|
|
118
|
+
|
|
119
|
+
- **Identifier casing for initialisms:**
|
|
120
|
+
only the first letter of an initialism is capitalised in a camel-case identifier —
|
|
121
|
+
``DataMasqueApiError``, not ``DataMasqueAPIError``.
|
|
122
|
+
The brand ``DataMasque`` is always spelled out in full.
|
|
123
|
+
- **Serialization conventions:**
|
|
124
|
+
API models subclass pydantic ``BaseModel``.
|
|
125
|
+
|
|
126
|
+
- Serialise outgoing request bodies with ``model.model_dump(exclude_none=True, mode="json")``;
|
|
127
|
+
add ``by_alias=True`` when the model uses field aliases.
|
|
128
|
+
- Parse incoming responses with ``Model.model_validate(response.json())``.
|
|
129
|
+
- Use ``ConfigDict(extra="forbid")`` on outgoing request models
|
|
130
|
+
so a typo in a field name fails loudly.
|
|
131
|
+
- Use ``ConfigDict(extra="allow")`` on incoming response models
|
|
132
|
+
so unknown fields the server may add in future don't break deserialisation.
|
|
133
|
+
- **Imports:**
|
|
134
|
+
|
|
135
|
+
- All imports at the top of the file; no inline imports.
|
|
136
|
+
- Absolute imports only; relative imports are not used.
|
|
137
|
+
|
|
138
|
+
- **Formatting:**
|
|
139
|
+
run ``uv run ruff format`` before committing.
|
|
140
|
+
|
|
141
|
+
Pull requests
|
|
142
|
+
=============
|
|
143
|
+
|
|
144
|
+
1. Fork the repository and create a feature branch.
|
|
145
|
+
2. Add tests for any behavioural change.
|
|
146
|
+
3. Run ``uv run pytest``, ``uv run ruff check``, ``uv run ruff format --check``, and ``uv run mypy``
|
|
147
|
+
locally before opening the PR.
|
|
148
|
+
4. Keep commits focused; one logical change per commit is easier to review.
|
|
149
|
+
5. Open a PR against ``main`` and describe what the change does and why.
|
|
150
|
+
6. The maintainers will review and either merge, request changes, or close with an explanation.
|
|
151
|
+
|
|
152
|
+
Commit messages
|
|
153
|
+
===============
|
|
154
|
+
|
|
155
|
+
Use `conventional commits <https://www.conventionalcommits.org/>`_ format where practical:
|
|
156
|
+
``feat: add cancel_run method``,
|
|
157
|
+
``fix: handle 401 retry for multipart uploads``,
|
|
158
|
+
``docs: clarify make_request exception semantics``,
|
|
159
|
+
and so on.
|
|
160
|
+
|
|
161
|
+
License
|
|
162
|
+
=======
|
|
163
|
+
|
|
164
|
+
By contributing,
|
|
165
|
+
you agree that your contributions will be licensed under the Apache License 2.0,
|
|
166
|
+
the same license as the rest of the project.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
=======
|
|
2
|
+
History
|
|
3
|
+
=======
|
|
4
|
+
|
|
5
|
+
1.0.0 (2026-04-21)
|
|
6
|
+
------------------
|
|
7
|
+
|
|
8
|
+
* **First public open-source release.**
|
|
9
|
+
* All request and response types are now pydantic v2 models.
|
|
10
|
+
* Added support for many new APIs.
|
|
11
|
+
* Added ``DataMasqueIfmClient`` for the in-flight masking (IFM) API.
|
|
12
|
+
* Overhauled error handling and added new exception types.
|
|
13
|
+
* Certain request models now accept either a server-assigned ID or the corresponding object
|
|
14
|
+
(``ConnectionConfig``, ``Ruleset``) for entity-reference fields.
|
|
15
|
+
* Added ``token_source`` callable-based authentication
|
|
16
|
+
to both ``DataMasqueInstanceConfig`` and ``DataMasqueIfmInstanceConfig``
|
|
17
|
+
as an alternative to ``password``.
|
|
18
|
+
* Ruleset is now mandatory on masking run requests.
|
|
19
|
+
* Fixed file data discovery API to accept both JSON path and standard locators.
|
|
20
|
+
* Replaced the CSV-only ``get_rulesets_generated_from_csv`` with ``get_generated_rulesets``,
|
|
21
|
+
which handles all three async-ruleset-generation flows (CSV, column selection, file selection).
|
|
22
|
+
|
|
23
|
+
0.6.3 (2026-04-10)
|
|
24
|
+
------------------
|
|
25
|
+
|
|
26
|
+
* Added ``db2i`` to ``DatabaseType`` enum.
|
|
27
|
+
|
|
28
|
+
0.6.2 (2026-03-17)
|
|
29
|
+
------------------
|
|
30
|
+
|
|
31
|
+
* Added ``RULESET_LIBRARY_MANAGER`` user role.
|
|
32
|
+
* Fixed superuser role value (``admin`` instead of empty string).
|
|
33
|
+
* Superusers can now be created via the users API.
|
|
34
|
+
* Fixed API field for user roles (``user_roles`` instead of ``roles``/``is_superuser``).
|
|
35
|
+
|
|
36
|
+
0.6.1 (2026-03-16)
|
|
37
|
+
------------------
|
|
38
|
+
|
|
39
|
+
* Added ``InvalidLibraryError`` exception type.
|
|
40
|
+
|
|
41
|
+
0.6.0 (2026-03-11)
|
|
42
|
+
------------------
|
|
43
|
+
|
|
44
|
+
* Added support for ruleset libraries.
|
|
45
|
+
* Removed ``too_big`` from ruleset validation statuses (no longer used).
|
|
46
|
+
* Migrated toolchain to ``uv`` with ``ruff``.
|
|
47
|
+
* Added support for ``validating`` run status.
|
|
48
|
+
|
|
49
|
+
0.5.1 (2026-03-10)
|
|
50
|
+
------------------
|
|
51
|
+
|
|
52
|
+
* Added ``delete_user_by_id_if_exists`` and ``delete_user_by_username_if_exists``.
|
|
53
|
+
|
|
54
|
+
0.4.12 (2026-01-29)
|
|
55
|
+
-------------------
|
|
56
|
+
|
|
57
|
+
* Added support for downloading files.
|
|
58
|
+
* Fixed positional argument call in ``dmclient.py``.
|
|
59
|
+
|
|
60
|
+
0.4.11 (2025-12-11)
|
|
61
|
+
-------------------
|
|
62
|
+
|
|
63
|
+
* Fixed ``start_async_ruleset_generation_from_csv`` to use new file upload specification.
|
|
64
|
+
|
|
65
|
+
0.4.10 (2025-12-10)
|
|
66
|
+
-------------------
|
|
67
|
+
|
|
68
|
+
* Fixed issue with file uploads when request was retried after a 401 response.
|
|
69
|
+
|
|
70
|
+
0.4.9 (2025-11-26)
|
|
71
|
+
------------------
|
|
72
|
+
|
|
73
|
+
* Added ``get_run_report`` and ``start_schema_discovery_run`` endpoints.
|
|
74
|
+
|
|
75
|
+
0.4.8 (2025-09-19)
|
|
76
|
+
------------------
|
|
77
|
+
|
|
78
|
+
* Updated ``admin_install`` endpoint to support username parameter
|
|
79
|
+
|
|
80
|
+
0.4.7 (2025-08-29)
|
|
81
|
+
------------------
|
|
82
|
+
|
|
83
|
+
* Added support for Redshift
|
|
84
|
+
|
|
85
|
+
0.4.6 (2025-07-18)
|
|
86
|
+
------------------
|
|
87
|
+
|
|
88
|
+
* Added support for ``engine_options`` in database connection config
|
|
89
|
+
* Updated ``ruleset`` endpoint to use ``upsert`` behaviour
|
|
90
|
+
* Updated Snowflake connection handling for encrypted connection strings
|
|
91
|
+
|
|
92
|
+
0.4.5 (2025-06-30)
|
|
93
|
+
------------------
|
|
94
|
+
|
|
95
|
+
* Added support for ``hash_columns`` in ruleset generator requests.
|
|
96
|
+
|
|
97
|
+
0.4.4 (2025-06-09)
|
|
98
|
+
------------------
|
|
99
|
+
|
|
100
|
+
* Added support for Azure Blob Storage as a Snowflake staging platform.
|
|
101
|
+
|
|
102
|
+
0.4.3 (2025-05-16)
|
|
103
|
+
------------------
|
|
104
|
+
|
|
105
|
+
* Added support for specifying Snowflake staging platform.
|
|
106
|
+
|
|
107
|
+
0.4.2 (2025-04-03)
|
|
108
|
+
------------------
|
|
109
|
+
|
|
110
|
+
* Added support for Snowflake keypair authentication.
|
|
111
|
+
|
|
112
|
+
0.4.1 (2025-03-25)
|
|
113
|
+
------------------
|
|
114
|
+
|
|
115
|
+
* Made snowflake role field optional.
|
|
116
|
+
|
|
117
|
+
0.4.0 (2025-03-17)
|
|
118
|
+
------------------
|
|
119
|
+
|
|
120
|
+
* Added support for Snowflake connections.
|
|
121
|
+
|
|
122
|
+
0.3.0 (2024-10-24)
|
|
123
|
+
------------------
|
|
124
|
+
|
|
125
|
+
* Added support for asynchronous ruleset generation with ``start_async_ruleset_generation``.
|
|
126
|
+
* Added support for CSV-based ruleset generation with ``start_async_ruleset_generation_from_csv`` and ``get_rulesets_generated_from_csv``.
|
|
127
|
+
|
|
128
|
+
0.2.9 (2024-09-27)
|
|
129
|
+
------------------
|
|
130
|
+
|
|
131
|
+
* Added support for the ``dynamo_default_sse`` configuration option on DynamoDB connections.
|
|
132
|
+
|
|
133
|
+
0.2.7 (2024-08-26)
|
|
134
|
+
------------------
|
|
135
|
+
|
|
136
|
+
* Fixed the user creation API.
|
|
137
|
+
|
|
138
|
+
0.2.6 (2024-08-09)
|
|
139
|
+
------------------
|
|
140
|
+
|
|
141
|
+
* Removed the ``run_not_started`` pseudo-status from the ``MaskingRunStatus`` enum.
|
|
142
|
+
* Added support for the ``data_encoding`` connection parameter on MySQL and MariaDB.
|
|
143
|
+
|
|
144
|
+
0.2.5 (2024-08-07)
|
|
145
|
+
------------------
|
|
146
|
+
|
|
147
|
+
* Added support for the ``finished_with_warnings`` run status.
|
|
148
|
+
|
|
149
|
+
0.2.4 (2024-08-01)
|
|
150
|
+
------------------
|
|
151
|
+
|
|
152
|
+
* Added support for MSSQL Linked Server connections.
|
|
153
|
+
|
|
154
|
+
0.2.3 (2024-07-30)
|
|
155
|
+
------------------
|
|
156
|
+
|
|
157
|
+
* Fixed ``set_locality`` passing in "locality" rather than "region".
|
|
158
|
+
|
|
159
|
+
0.2.2 (2024-07-29)
|
|
160
|
+
------------------
|
|
161
|
+
|
|
162
|
+
* Add support for passing a filename or StringIO when uploading a license
|
|
163
|
+
* Add handling for HTTP 502 errors
|
|
164
|
+
|
|
165
|
+
0.2.1 (2024-07-23)
|
|
166
|
+
------------------
|
|
167
|
+
|
|
168
|
+
* Add Ruleset model
|
|
169
|
+
* Fix numerous issues with the new Connection models
|
|
170
|
+
* Introduce a separate model for Dynamo connections
|
|
171
|
+
|
|
172
|
+
0.2.0 (2024-07-22)
|
|
173
|
+
------------------
|
|
174
|
+
|
|
175
|
+
* Drastic simplification of the config models
|
|
176
|
+
* Add new features:
|
|
177
|
+
* file data discovery
|
|
178
|
+
* file ruleset generation
|
|
179
|
+
* locality
|
|
180
|
+
* seed file deletion
|
|
181
|
+
* list connections and delete connections
|
|
182
|
+
* user APIs
|
|
183
|
+
* Use v2 ruleset generation API
|
|
184
|
+
|
|
185
|
+
0.1.2 (2024-01-22)
|
|
186
|
+
------------------
|
|
187
|
+
|
|
188
|
+
* Export RunID, remove RunFailureReason
|
|
189
|
+
* Run tests using Tox against Python 3.9 and above
|
|
190
|
+
|
|
191
|
+
0.1.1 (2024-01-19)
|
|
192
|
+
------------------
|
|
193
|
+
|
|
194
|
+
* First release
|