saxonche-stubs 0.2.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,33 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: saxonche-stubs
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Type stubs for saxonche
|
|
5
|
+
License: GPL-3.0-or-later
|
|
6
|
+
Author: Bpolitycki
|
|
7
|
+
Author-email: bastian.politycki@unisg.ch
|
|
8
|
+
Requires-Python: >=3.8,<4.0
|
|
9
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Requires-Dist: saxonche (>=12.1.0,<13.0.0)
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# saxonche-stubs
|
|
19
|
+
|
|
20
|
+
Type stubs for the [saxonche](https://pypi.org/project/saxonche/) python package. This package has no functionality itself, but is merely an addition to the completion within IDEs. The basis for type annotations and comments is the documentation of [the Saxon Python API](https://www.saxonica.com/saxon-c/doc11/html/saxonc.html).
|
|
21
|
+
|
|
22
|
+
At the moment not all APIs are fully typed. To install the stubs just install the git repo via poetry or any other package manager.
|
|
23
|
+
|
|
24
|
+
You can use `stubtest` to get an impression of untyped components:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
poetry run stubtest saxonche
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Author / Contact
|
|
31
|
+
|
|
32
|
+
- [Bastian Politycki](https://github.com/Bpolitycki) – Swiss Law Sources
|
|
33
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# saxonche-stubs
|
|
2
|
+
|
|
3
|
+
Type stubs for the [saxonche](https://pypi.org/project/saxonche/) python package. This package has no functionality itself, but is merely an addition to the completion within IDEs. The basis for type annotations and comments is the documentation of [the Saxon Python API](https://www.saxonica.com/saxon-c/doc11/html/saxonc.html).
|
|
4
|
+
|
|
5
|
+
At the moment not all APIs are fully typed. To install the stubs just install the git repo via poetry or any other package manager.
|
|
6
|
+
|
|
7
|
+
You can use `stubtest` to get an impression of untyped components:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
poetry run stubtest saxonche
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Author / Contact
|
|
14
|
+
|
|
15
|
+
- [Bastian Politycki](https://github.com/Bpolitycki) – Swiss Law Sources
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "saxonche-stubs"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "Type stubs for saxonche"
|
|
5
|
+
authors = ["Bpolitycki <bastian.politycki@unisg.ch>"]
|
|
6
|
+
license = "GPL-3.0-or-later"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
packages = [{include = "saxonche-stubs"}]
|
|
9
|
+
|
|
10
|
+
[tool.poetry.dependencies]
|
|
11
|
+
python = "^3.8"
|
|
12
|
+
saxonche = "^12.1.0"
|
|
13
|
+
|
|
14
|
+
[tool.poetry.group.dev.dependencies]
|
|
15
|
+
black = "^23.3.0"
|
|
16
|
+
ruff = "^0.0.262"
|
|
17
|
+
mypy = "^1.2.0"
|
|
18
|
+
|
|
19
|
+
[tool.mypy]
|
|
20
|
+
mypy_path = "saxonche-stubs"
|
|
21
|
+
check_untyped_defs = true
|
|
22
|
+
ignore_errors = false
|
|
23
|
+
ignore_missing_imports = true
|
|
24
|
+
strict_optional = true
|
|
25
|
+
|
|
26
|
+
[tool.ruff]
|
|
27
|
+
select = ["E", "F", "I001"]
|
|
28
|
+
ignore = ["E501"]
|
|
29
|
+
|
|
30
|
+
[build-system]
|
|
31
|
+
requires = ["poetry-core"]
|
|
32
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
from typing import Any, Self, overload
|
|
2
|
+
|
|
3
|
+
def __getattr__(name: str) -> Any: ...
|
|
4
|
+
|
|
5
|
+
class PySaxonProcessor:
|
|
6
|
+
def __init__(self, license: bool = False) -> None:
|
|
7
|
+
"""An SaxonProcessor acts as a factory for generating XQuery, XPath, Schema
|
|
8
|
+
and XSLT compilers. This class is itself the context that needs to be managed
|
|
9
|
+
(i.e. allocation & release)"""
|
|
10
|
+
...
|
|
11
|
+
def __enter__(self) -> Self: ...
|
|
12
|
+
def __exit__(
|
|
13
|
+
self,
|
|
14
|
+
exc_type: Any,
|
|
15
|
+
exc_val: Any,
|
|
16
|
+
exc_tb: Any,
|
|
17
|
+
) -> None: ...
|
|
18
|
+
def clear_configuration_properties(self) -> None:
|
|
19
|
+
"""Clear all configuration properties that have been set"""
|
|
20
|
+
...
|
|
21
|
+
def new_xpath_processor(self) -> PyXPathProcessor:
|
|
22
|
+
"""Creates a new XPath processor, which used to evaluate XPath expressions."""
|
|
23
|
+
...
|
|
24
|
+
@overload
|
|
25
|
+
def parse_xml(self, xml_file_name: str) -> PyXdmNode:
|
|
26
|
+
"""Parse a lexical representation, source file or uri of the source document
|
|
27
|
+
and return it as an Xdm Node
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
xml_file_name (str): The file name of the source document
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
PyXdmNode: The Xdm Node representing the source document
|
|
34
|
+
"""
|
|
35
|
+
...
|
|
36
|
+
@overload
|
|
37
|
+
def parse_xml(self, xml_text: str) -> PyXdmNode:
|
|
38
|
+
"""Parse a lexical representation, source file or uri of the source document
|
|
39
|
+
and return it as an Xdm Node
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
xml_text (str): The lexical representation of the source document
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
PyXdmNode: The Xdm Node representing the source document
|
|
46
|
+
"""
|
|
47
|
+
...
|
|
48
|
+
@overload
|
|
49
|
+
def parse_xml(self, xml_uri: str) -> PyXdmNode:
|
|
50
|
+
"""Parse a lexical representation, source file or uri of the source document
|
|
51
|
+
and return it as an Xdm Node
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
xml_uri (str): The uri of the source document
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
PyXdmNode: The Xdm Node representing the source document
|
|
58
|
+
"""
|
|
59
|
+
...
|
|
60
|
+
|
|
61
|
+
class PyXPathProcessor:
|
|
62
|
+
def __init__(self) -> None: ...
|
|
63
|
+
|
|
64
|
+
class PyXdmItem:
|
|
65
|
+
def __init__(self) -> None: ...
|
|
66
|
+
def get_atomic_value(self) -> PyXdmAtomicValue:
|
|
67
|
+
"""Get the atomic value of this item.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
PyXdmAtomicValue: The atomic value of this item
|
|
71
|
+
|
|
72
|
+
Raises:
|
|
73
|
+
Exception: If the item is not an atomic value
|
|
74
|
+
"""
|
|
75
|
+
...
|
|
76
|
+
def get_map_value(self) -> PyXdmMap:
|
|
77
|
+
"""Get the map value of this item.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
PyXdmMap: The map value of this item
|
|
81
|
+
|
|
82
|
+
Raises:
|
|
83
|
+
Exception: If the item is not a map
|
|
84
|
+
"""
|
|
85
|
+
...
|
|
86
|
+
def get_node_value(self) -> PyXdmNode:
|
|
87
|
+
"""Get the node value of this item.
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
PyXdmNode: The node value of this item
|
|
91
|
+
|
|
92
|
+
Raises:
|
|
93
|
+
Exception: If the item is not a node
|
|
94
|
+
"""
|
|
95
|
+
...
|
|
96
|
+
@property
|
|
97
|
+
def head(self) -> PyXdmItem | None:
|
|
98
|
+
"""Property which returns the first item in the sequence.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
PyXdmItem | None: The first item in the sequence or None if the sequence is empty
|
|
102
|
+
"""
|
|
103
|
+
...
|
|
104
|
+
@property
|
|
105
|
+
def is_array(self) -> bool:
|
|
106
|
+
"""Property which returns whether the item is an array.
|
|
107
|
+
|
|
108
|
+
Returns:
|
|
109
|
+
bool: True if the item is an array, False otherwise
|
|
110
|
+
"""
|
|
111
|
+
...
|
|
112
|
+
@property
|
|
113
|
+
def is_atomic(self) -> bool:
|
|
114
|
+
"""Property which returns whether the item is an atomic value.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
bool: True if the item is an atomic value, False otherwise
|
|
118
|
+
"""
|
|
119
|
+
...
|
|
120
|
+
@property
|
|
121
|
+
def is_function(self) -> bool:
|
|
122
|
+
"""Property which returns whether the item is a function.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
bool: True if the item is a function, False otherwise
|
|
126
|
+
"""
|
|
127
|
+
...
|
|
128
|
+
@property
|
|
129
|
+
def is_map(self) -> bool:
|
|
130
|
+
"""Property which returns whether the item is a map.
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
bool: True if the item is a map, False otherwise
|
|
134
|
+
"""
|
|
135
|
+
...
|
|
136
|
+
@property
|
|
137
|
+
def is_node(self) -> bool:
|
|
138
|
+
"""Property which returns whether the item is a node.
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
bool: True if the item is a node, False otherwise
|
|
142
|
+
"""
|
|
143
|
+
...
|
|
144
|
+
@property
|
|
145
|
+
def string_value(self) -> str:
|
|
146
|
+
"""Property which returns the string value.
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
str: The string value of the atomic value
|
|
150
|
+
"""
|
|
151
|
+
...
|
|
152
|
+
|
|
153
|
+
class PyXdmAtomicValue(PyXdmItem):
|
|
154
|
+
def __init__(self) -> None:
|
|
155
|
+
"""Reprensts an atomic value in the XDM data model. Atomic values are either
|
|
156
|
+
built-in atomic values (such as xs:integer or xs:date) or user-defined atomic
|
|
157
|
+
values."""
|
|
158
|
+
...
|
|
159
|
+
@property
|
|
160
|
+
def boolean_value(self) -> bool:
|
|
161
|
+
"""Property which returns the boolean value.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
bool: The boolean value of the atomic value
|
|
165
|
+
"""
|
|
166
|
+
...
|
|
167
|
+
@property
|
|
168
|
+
def integer_value(self) -> int:
|
|
169
|
+
"""Property which returns the integer value.
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
int: The integer value of the atomic value
|
|
173
|
+
"""
|
|
174
|
+
...
|
|
175
|
+
|
|
176
|
+
class PyXdmMap(PyXdmItem):
|
|
177
|
+
def __init__(self) -> None: ...
|
|
178
|
+
|
|
179
|
+
class PyXdmNode(PyXdmItem):
|
|
180
|
+
def __init__(self) -> None: ...
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from setuptools import setup
|
|
3
|
+
|
|
4
|
+
packages = \
|
|
5
|
+
['saxonche-stubs']
|
|
6
|
+
|
|
7
|
+
package_data = \
|
|
8
|
+
{'': ['*']}
|
|
9
|
+
|
|
10
|
+
install_requires = \
|
|
11
|
+
['saxonche>=12.1.0,<13.0.0']
|
|
12
|
+
|
|
13
|
+
setup_kwargs = {
|
|
14
|
+
'name': 'saxonche-stubs',
|
|
15
|
+
'version': '0.2.0',
|
|
16
|
+
'description': 'Type stubs for saxonche',
|
|
17
|
+
'long_description': '# saxonche-stubs\n\nType stubs for the [saxonche](https://pypi.org/project/saxonche/) python package. This package has no functionality itself, but is merely an addition to the completion within IDEs. The basis for type annotations and comments is the documentation of [the Saxon Python API](https://www.saxonica.com/saxon-c/doc11/html/saxonc.html).\n\nAt the moment not all APIs are fully typed. To install the stubs just install the git repo via poetry or any other package manager.\n\nYou can use `stubtest` to get an impression of untyped components:\n\n```sh\npoetry run stubtest saxonche\n```\n\n## Author / Contact\n\n- [Bastian Politycki](https://github.com/Bpolitycki) – Swiss Law Sources\n',
|
|
18
|
+
'author': 'Bpolitycki',
|
|
19
|
+
'author_email': 'bastian.politycki@unisg.ch',
|
|
20
|
+
'maintainer': 'None',
|
|
21
|
+
'maintainer_email': 'None',
|
|
22
|
+
'url': 'None',
|
|
23
|
+
'packages': packages,
|
|
24
|
+
'package_data': package_data,
|
|
25
|
+
'install_requires': install_requires,
|
|
26
|
+
'python_requires': '>=3.8,<4.0',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
setup(**setup_kwargs)
|