ouisparql 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 (57) hide show
  1. ouisparql-0.1.0/.dockerignore +134 -0
  2. ouisparql-0.1.0/.editorconfig +23 -0
  3. ouisparql-0.1.0/.flake8 +5 -0
  4. ouisparql-0.1.0/.github/scripts/docs.sh +6 -0
  5. ouisparql-0.1.0/.github/scripts/package-build.sh +5 -0
  6. ouisparql-0.1.0/.github/workflows/deploy-pages.yml +30 -0
  7. ouisparql-0.1.0/.github/workflows/ouisparql-package.yml +63 -0
  8. ouisparql-0.1.0/.gitignore +134 -0
  9. ouisparql-0.1.0/.gitlab-ci.yml +94 -0
  10. ouisparql-0.1.0/LICENSE +28 -0
  11. ouisparql-0.1.0/MANIFEST.in +1 -0
  12. ouisparql-0.1.0/Makefile +490 -0
  13. ouisparql-0.1.0/PKG-INFO +184 -0
  14. ouisparql-0.1.0/README.rst +144 -0
  15. ouisparql-0.1.0/docker/.gitignore +1 -0
  16. ouisparql-0.1.0/docker/Makefile +61 -0
  17. ouisparql-0.1.0/docker/README.md +75 -0
  18. ouisparql-0.1.0/docker/docker-compose.yml +80 -0
  19. ouisparql-0.1.0/docker/dockerfile.python-dbs +16 -0
  20. ouisparql-0.1.0/docker/dockerfile.python-mysql +12 -0
  21. ouisparql-0.1.0/docker/dockerfile.python-postgres +12 -0
  22. ouisparql-0.1.0/docs/source/conf.py +66 -0
  23. ouisparql-0.1.0/docs/source/contributing.rst +74 -0
  24. ouisparql-0.1.0/docs/source/defining-sparql-queries.rst +71 -0
  25. ouisparql-0.1.0/docs/source/endpoint-driver-adapters.rst +4 -0
  26. ouisparql-0.1.0/docs/source/getting-started.rst +149 -0
  27. ouisparql-0.1.0/docs/source/index.rst +17 -0
  28. ouisparql-0.1.0/docs/source/todo.rst +4 -0
  29. ouisparql-0.1.0/docs/source/versions.rst +7 -0
  30. ouisparql-0.1.0/example/example.py +30 -0
  31. ouisparql-0.1.0/example/sparql/queries.rq +6 -0
  32. ouisparql-0.1.0/example/species/sparql/queries.rq +12 -0
  33. ouisparql-0.1.0/ouisparql/__init__.py +13 -0
  34. ouisparql-0.1.0/ouisparql/adapters/__init__.py +2 -0
  35. ouisparql-0.1.0/ouisparql/adapters/generic.py +124 -0
  36. ouisparql-0.1.0/ouisparql/adapters/pyformat.py +21 -0
  37. ouisparql-0.1.0/ouisparql/adapters/sparqlwrapper.py +100 -0
  38. ouisparql-0.1.0/ouisparql/ouisparql.py +167 -0
  39. ouisparql-0.1.0/ouisparql/py.typed +0 -0
  40. ouisparql-0.1.0/ouisparql/queries.py +339 -0
  41. ouisparql-0.1.0/ouisparql/query_loader.py +286 -0
  42. ouisparql-0.1.0/ouisparql/types.py +159 -0
  43. ouisparql-0.1.0/ouisparql/utils.py +42 -0
  44. ouisparql-0.1.0/ouisparql.egg-info/PKG-INFO +184 -0
  45. ouisparql-0.1.0/ouisparql.egg-info/SOURCES.txt +55 -0
  46. ouisparql-0.1.0/ouisparql.egg-info/dependency_links.txt +1 -0
  47. ouisparql-0.1.0/ouisparql.egg-info/requires.txt +22 -0
  48. ouisparql-0.1.0/ouisparql.egg-info/top_level.txt +1 -0
  49. ouisparql-0.1.0/pyproject.toml +61 -0
  50. ouisparql-0.1.0/setup.cfg +4 -0
  51. ouisparql-0.1.0/tests/Makefile +2 -0
  52. ouisparql-0.1.0/tests/conf_sparql_wrapper.py +13 -0
  53. ouisparql-0.1.0/tests/conftest.py +5 -0
  54. ouisparql-0.1.0/tests/pytest.ini +11 -0
  55. ouisparql-0.1.0/tests/sparql/queries.rq +49 -0
  56. ouisparql-0.1.0/tests/test_sparql.py +56 -0
  57. ouisparql-0.1.0/tests/utils.py +74 -0
@@ -0,0 +1,134 @@
1
+ .gitlab-ci-local
2
+
3
+ # Swap
4
+ [._]*.s[a-v][a-z]
5
+ [._]*.sw[a-p]
6
+ [._]s[a-rt-v][a-z]
7
+ [._]ss[a-gi-z]
8
+ [._]sw[a-p]
9
+
10
+ # Session
11
+ Session.vim
12
+
13
+ # Temporary
14
+ .netrwhist
15
+ *~
16
+ # Auto-generated tag files
17
+ tags
18
+ # Persistent undo
19
+ [._]*.un~
20
+
21
+ # Byte-compiled / optimized / DLL files
22
+ __pycache__/
23
+ *.py[cod]
24
+ *$py.class
25
+
26
+ # C extensions
27
+ *.so
28
+
29
+ # Distribution / packaging
30
+ .Python
31
+ build/
32
+ develop-eggs/
33
+ dist/
34
+ downloads/
35
+ eggs/
36
+ .eggs/
37
+ lib/
38
+ lib64/
39
+ parts/
40
+ sdist/
41
+ var/
42
+ wheels/
43
+ *.egg-info/
44
+ .installed.cfg
45
+ *.egg
46
+ MANIFEST
47
+ docs/html
48
+
49
+ # PyInstaller
50
+ # Usually these files are written by a python script from a template
51
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
52
+ *.manifest
53
+ *.spec
54
+
55
+ # Installer logs
56
+ pip-log.txt
57
+ pip-delete-this-directory.txt
58
+
59
+ # Unit test / coverage reports
60
+ htmlcov/
61
+ .tox/
62
+ .coverage
63
+ .coverage.*
64
+ .cache
65
+ nosetests.xml
66
+ coverage.xml
67
+ *.cover
68
+ .hypothesis/
69
+ .pytest_cache/
70
+
71
+ # Translations
72
+ *.mo
73
+ *.pot
74
+
75
+ # Django stuff:
76
+ *.log
77
+ local_settings.py
78
+ db.sqlite3
79
+
80
+ # Flask stuff:
81
+ instance/
82
+ .webassets-cache
83
+
84
+ # Scrapy stuff:
85
+ .scrapy
86
+
87
+ # Sphinx documentation
88
+ docs/build/
89
+ docs/source/pydoc/
90
+
91
+ # PyBuilder
92
+ target/
93
+
94
+ # Jupyter Notebook
95
+ .ipynb_checkpoints
96
+
97
+ # pyenv
98
+ .python-version
99
+
100
+ # celery beat schedule file
101
+ celerybeat-schedule
102
+
103
+ # SageMath parsed files
104
+ *.sage.py
105
+
106
+ # Environments
107
+ .env
108
+ .venv
109
+ env/
110
+ venv/
111
+ ENV/
112
+ env.bak/
113
+ venv.bak/
114
+ poetry.lock
115
+
116
+ # Spyder project settings
117
+ .spyderproject
118
+ .spyproject
119
+
120
+ # Rope project settings
121
+ .ropeproject
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+
126
+ # PyCharm
127
+ .idea/
128
+
129
+ # Project files
130
+ scratch/
131
+ exampleblog.db
132
+
133
+ # misc
134
+ .docker.*
@@ -0,0 +1,23 @@
1
+ # Use as the top-most EditorConfig file
2
+ root = true
3
+
4
+ # Unix-style newlines with a newline ending every file
5
+ [*]
6
+ end_of_line = lf
7
+ insert_final_newline = true
8
+ trim_trailing_whitespace = true
9
+
10
+ [*.py]
11
+ charset = utf-8
12
+ indent_style = space
13
+ indent_size = 4
14
+
15
+ [*.{md,markdown}]
16
+ indent_style = space
17
+ indent_size = 4
18
+ trim_trailing_whitespace = false
19
+
20
+ # 2 space indentation
21
+ [*.{json,yml,sh}]
22
+ indent_style = space
23
+ indent_size = 2
@@ -0,0 +1,5 @@
1
+ [flake8]
2
+ # Derived from the one from Black itself. Ignore rules that are handled by Black.
3
+ ignore = E203, E266, E501, W503, E704
4
+ select = B,C,E,F,W,T4,B9
5
+ max-line-length = 100
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ sphinx-apidoc -f -o docs/source/pydoc ouisparql
6
+ sphinx-build -b html docs/source docs/build
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ python -m build --sdist
5
+ python -m build --wheel
@@ -0,0 +1,30 @@
1
+ name: Ouisparql docs
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout
12
+ uses: actions/checkout@v4
13
+ - name: Set up Python
14
+ uses: actions/setup-python@v5
15
+ - name: Install dependencies
16
+ run: |
17
+ python -m pip install -U pip
18
+ python -m pip install .[doc]
19
+ - name: Check RST files
20
+ run: make check.rstcheck
21
+ - name: Generate documentation
22
+ run: .github/scripts/docs.sh
23
+ - name: Deploy to GitHub Pages
24
+ if: success()
25
+ uses: crazy-max/ghaction-github-pages@v4
26
+ with:
27
+ target_branch: gh-pages
28
+ build_dir: docs/build
29
+ env:
30
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,63 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
+
4
+ name: Ouisparql Package
5
+
6
+ on:
7
+ push:
8
+ branches: [ main ]
9
+ pull_request:
10
+ branches: [ main ]
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ # https://github.com/actions/python-versions (versions-manifest.json)
19
+ # https://downloads.python.org/pypy/versions.json
20
+ # 3.14 KO on pydantic build dependences 2024-10-27
21
+ # 3.14 way too slow duckdb wheel build 2025-01-28
22
+ python:
23
+ - version: "pypy3.10"
24
+ - version: "pypy3.11"
25
+ - version: "3.9"
26
+ - version: "3.10"
27
+ - version: "3.11"
28
+ - version: "3.12"
29
+ - version: "3.13"
30
+ - version: "3.13t"
31
+ gil: 1
32
+ - version: "3.13t"
33
+ gil: 0
34
+ - version: "3.14"
35
+ # - version: "3.14t"
36
+ # gil: 1
37
+ # - version: "3.14t"
38
+ # gil: 0
39
+ env:
40
+ PYTHON_GIL: ${{ matrix.python.gil }}
41
+ steps:
42
+ - name: Checkout Project
43
+ uses: actions/checkout@v4
44
+ - name: Set up Python ${{ matrix.python.version }}
45
+ uses: actions/setup-python@v5
46
+ with:
47
+ python-version: ${{ matrix.python.version }}
48
+ allow-prereleases: true
49
+ cache: "pip"
50
+ - name: Install dependencies
51
+ run: |
52
+ python -m pip install --upgrade pip
53
+ python -m pip install .[dev]
54
+ - name: Check types with mypy
55
+ run: make VENV= INSTALL= check.mypy
56
+ - name: Check types with pyright
57
+ run: make VENV= INSTALL= check.pyright
58
+ - name: Lint with ruff
59
+ run: make VENV= INSTALL= check.ruff
60
+ - name: Test with pytest and databases
61
+ run: make VENV= INSTALL= check.pytest
62
+ - name: Coverage tests
63
+ run: make VENV= INSTALL= check.coverage
@@ -0,0 +1,134 @@
1
+ .gitlab-ci-local
2
+
3
+ # Swap
4
+ [._]*.s[a-v][a-z]
5
+ [._]*.sw[a-p]
6
+ [._]s[a-rt-v][a-z]
7
+ [._]ss[a-gi-z]
8
+ [._]sw[a-p]
9
+
10
+ # Session
11
+ Session.vim
12
+
13
+ # Temporary
14
+ .netrwhist
15
+ *~
16
+ # Auto-generated tag files
17
+ tags
18
+ # Persistent undo
19
+ [._]*.un~
20
+
21
+ # Byte-compiled / optimized / DLL files
22
+ __pycache__/
23
+ *.py[cod]
24
+ *$py.class
25
+
26
+ # C extensions
27
+ *.so
28
+
29
+ # Distribution / packaging
30
+ .Python
31
+ build/
32
+ develop-eggs/
33
+ dist/
34
+ downloads/
35
+ eggs/
36
+ .eggs/
37
+ lib/
38
+ lib64/
39
+ parts/
40
+ sdist/
41
+ var/
42
+ wheels/
43
+ *.egg-info/
44
+ .installed.cfg
45
+ *.egg
46
+ MANIFEST
47
+ docs/html
48
+
49
+ # PyInstaller
50
+ # Usually these files are written by a python script from a template
51
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
52
+ *.manifest
53
+ *.spec
54
+
55
+ # Installer logs
56
+ pip-log.txt
57
+ pip-delete-this-directory.txt
58
+
59
+ # Unit test / coverage reports
60
+ htmlcov/
61
+ .tox/
62
+ .coverage
63
+ .coverage.*
64
+ .cache
65
+ nosetests.xml
66
+ coverage.xml
67
+ *.cover
68
+ .hypothesis/
69
+ .pytest_cache/
70
+
71
+ # Translations
72
+ *.mo
73
+ *.pot
74
+
75
+ # Django stuff:
76
+ *.log
77
+ local_settings.py
78
+ db.sqlite3
79
+
80
+ # Flask stuff:
81
+ instance/
82
+ .webassets-cache
83
+
84
+ # Scrapy stuff:
85
+ .scrapy
86
+
87
+ # Sphinx documentation
88
+ docs/build/
89
+ docs/source/pydoc/
90
+
91
+ # PyBuilder
92
+ target/
93
+
94
+ # Jupyter Notebook
95
+ .ipynb_checkpoints
96
+
97
+ # pyenv
98
+ .python-version
99
+
100
+ # celery beat schedule file
101
+ celerybeat-schedule
102
+
103
+ # SageMath parsed files
104
+ *.sage.py
105
+
106
+ # Environments
107
+ .env
108
+ .venv
109
+ env/
110
+ venv/
111
+ ENV/
112
+ env.bak/
113
+ venv.bak/
114
+ poetry.lock
115
+
116
+ # Spyder project settings
117
+ .spyderproject
118
+ .spyproject
119
+
120
+ # Rope project settings
121
+ .ropeproject
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+
126
+ # PyCharm
127
+ .idea/
128
+
129
+ # Project files
130
+ scratch/
131
+ exampleblog.db
132
+
133
+ # misc
134
+ .docker.*
@@ -0,0 +1,94 @@
1
+
2
+ default:
3
+ image: python:3.9
4
+ cache: # Pip's cache doesn't store the python packages
5
+ paths: # https://pip.pypa.io/en/stable/topics/caching/
6
+ - .cache/pip
7
+ before_script:
8
+ - python --version # Print out python version for debugging
9
+ - python3 -m venv .venv
10
+ - source .venv/bin/activate
11
+
12
+ stages:
13
+ - build
14
+ - test
15
+ - publish
16
+
17
+ variables: # Change pip's cache directory to be inside the project directory because GitLab can only cache local items.
18
+ PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
19
+
20
+ build:
21
+ stage: build
22
+ script:
23
+ - pip install -U pip
24
+ - pip install '.[dist]'
25
+ - python -m build --sdist
26
+ - python -m build --wheel
27
+ artifacts:
28
+ paths:
29
+ - dist
30
+
31
+ test:
32
+ stage: test
33
+ script:
34
+ - pip install pytest
35
+ - pip install dist/*.whl
36
+ - pytest
37
+
38
+ .release-base:
39
+ stage: publish
40
+ id_tokens:
41
+ PYPI_ID_TOKEN:
42
+ aud: '$PYPI_OIDC_AUD'
43
+ script:
44
+ - >-
45
+ resp="$(curl -X POST "${PYPI_OIDC_URL}" -d "{\"token\":\"${PYPI_ID_TOKEN}\"}")"
46
+ # Parse the response and extract the token
47
+ - >-
48
+ publish_token="$(python -c "import json; print(json.loads('${resp}')['token'])")"
49
+ # Upload the files from "dist/"
50
+ - pip install twine
51
+ - >-
52
+ python3 -m twine upload --non-interactive --repository "${PYPI_OIDC_AUD}" --username "__token__" --password "${publish_token}" dist/*
53
+ # Print the link to PyPI so we can quickly go there to verify the result:
54
+ - version="$(cat VERSION)"
55
+ - echo -e "\033[34;1mPackage on PyPI:\033[0m ${CI_ENVIRONMENT_URL}${version}/"
56
+
57
+ release-test:
58
+ extends: '.release-base'
59
+ rules:
60
+ # Only run if it's a pipeline for the default branch or a tag:
61
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG'
62
+ environment:
63
+ name: 'release-test'
64
+ url: 'https://test.pypi.org/project/ouisparql/'
65
+ variables:
66
+ PYPI_OIDC_AUD: 'testpypi'
67
+ PYPI_OIDC_URL: 'https://test.pypi.org/_/oidc/mint-token'
68
+
69
+ release:
70
+ extends: '.release-base'
71
+ rules:
72
+ # Only run in tag pipelines:
73
+ - if: '$CI_COMMIT_TAG'
74
+ environment:
75
+ name: 'release'
76
+ url: 'https://pypi.org/project/ouisparql/'
77
+ variables:
78
+ PYPI_OIDC_AUD: 'pypi'
79
+ PYPI_OIDC_URL: 'https://pypi.org/_/oidc/mint-token'
80
+
81
+ docs:
82
+ stage: publish
83
+ script:
84
+ - pip install --upgrade pip
85
+ - pip install '.[doc]'
86
+ - sphinx-apidoc -f -o docs/source/pydoc ouisparql
87
+ - sphinx-build -b html docs/source docs/build
88
+ artifacts:
89
+ paths:
90
+ - ./docs/build/
91
+ rules:
92
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
93
+ pages:
94
+ publish: ./docs/build/
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2014-2017, Honza Pokorny
2
+ Copyright (c) 2018, William Vaughn
3
+ Copyright (c) 2025, Samuel Ortion
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+
26
+ The views and conclusions contained in the software and documentation are those
27
+ of the authors and should not be interpreted as representing official policies,
28
+ either expressed or implied, of the aiosql Project.
@@ -0,0 +1 @@
1
+ recursive-include docs *