mirth-client 3.2.0__tar.gz → 4.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.
@@ -1,20 +1,22 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: mirth-client
3
- Version: 3.2.0
3
+ Version: 4.1.0
4
4
  Summary: Basic Python interface for Mirth Connect
5
5
  Author: Joel Collins
6
6
  Author-email: joel.collins@renalregistry.nhs.uk
7
- Requires-Python: >=3.7,<4.0
7
+ Requires-Python: >=3.9,<4.0
8
8
  Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.7
10
- Classifier: Programming Language :: Python :: 3.8
11
9
  Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
12
14
  Provides-Extra: docs
13
- Requires-Dist: Sphinx (>=3.5.3,<6.0.0); extra == "docs"
14
- Requires-Dist: httpx (>=0.23.0,<0.24.0)
15
- Requires-Dist: pydantic (>=1.8.2,<2.0.0)
16
- Requires-Dist: semver (>=2.13.0,<3.0.0)
17
- Requires-Dist: sphinx-rtd-theme (>=0.5.1,<1.1.0); extra == "docs"
15
+ Requires-Dist: Sphinx (>=3.5.3,<6.0.0) ; extra == "docs"
16
+ Requires-Dist: httpx (>=0.23,<0.28.1)
17
+ Requires-Dist: pydantic (>=1.8.2,<3.0.0)
18
+ Requires-Dist: semver (>=2.13,<4.0)
19
+ Requires-Dist: sphinx-rtd-theme (>=0.5.1,<2.1.0) ; extra == "docs"
18
20
  Requires-Dist: typing-extensions (>=3.10,<5.0)
19
21
  Requires-Dist: xmltodict (>=0.12,<0.14)
20
22
  Description-Content-Type: text/markdown
@@ -89,7 +89,7 @@ class MirthAPI:
89
89
 
90
90
  return await self.session.get(path, **kwargs)
91
91
 
92
- async def login(self, user: str, password: str):
92
+ async def login(self, user: str, password: str) -> LoginResponse:
93
93
  """Log in to the Mirth instance
94
94
 
95
95
  Args:
@@ -21,15 +21,32 @@ from typing import (
21
21
  from uuid import UUID
22
22
 
23
23
  import xmltodict
24
- from pydantic import (
25
- BaseModel,
26
- Protocol,
27
- StrBytes,
28
- ValidationError,
29
- root_validator,
30
- validator,
31
- )
32
- from pydantic.error_wrappers import ErrorWrapper
24
+ import typing
25
+ import pydantic
26
+ from packaging import version
27
+
28
+ if typing.TYPE_CHECKING or version.parse(pydantic.__version__) >= version.parse("2.0"):
29
+ from pydantic.v1 import (
30
+ BaseModel,
31
+ ValidationError,
32
+ root_validator,
33
+ validator,
34
+ StrBytes,
35
+ Protocol,
36
+ )
37
+ from pydantic.v1.error_wrappers import ErrorWrapper
38
+ else:
39
+ from pydantic import (
40
+ BaseModel,
41
+ Protocol,
42
+ StrBytes,
43
+ ValidationError,
44
+ root_validator,
45
+ validator,
46
+ )
47
+ from pydantic.error_wrappers import ErrorWrapper
48
+
49
+
33
50
  from typing_extensions import TypedDict
34
51
 
35
52
  if TYPE_CHECKING:
@@ -181,7 +198,7 @@ class XMLBaseModel(MirthBaseModel):
181
198
  *,
182
199
  content_type: Optional[str] = "xml",
183
200
  encoding: str = "utf8",
184
- proto: Protocol = None,
201
+ proto: Optional[Protocol] = None,
185
202
  allow_pickle: bool = False,
186
203
  ) -> "Model":
187
204
  """Parse raw data into a Pydantic object.
@@ -214,17 +231,17 @@ class XMLBaseModel(MirthBaseModel):
214
231
  raise ValidationError([ErrorWrapper(e, loc="__obj__")], cls) from e
215
232
  return super().parse_raw( # type: ignore
216
233
  b,
217
- content_type=content_type,
234
+ content_type=content_type, # type: ignore
218
235
  encoding=encoding,
219
- proto=proto,
236
+ proto=proto, # type: ignore
220
237
  allow_pickle=allow_pickle,
221
238
  )
222
239
 
223
240
  def xml(
224
241
  self,
225
242
  *,
226
- include: Union["SetIntStr", "DictIntStrAny"] = None,
227
- exclude: Union["SetIntStr", "DictIntStrAny"] = None,
243
+ include: Union["SetIntStr", "DictIntStrAny", None] = None,
244
+ exclude: Union["SetIntStr", "DictIntStrAny", None] = None,
228
245
  by_alias: bool = True,
229
246
  exclude_unset: bool = False,
230
247
  ) -> str:
@@ -6,32 +6,31 @@ packages = [
6
6
  {include = "mirth_client"},
7
7
  ]
8
8
  readme = "README.md"
9
- version = "3.2.0"
9
+ version = "4.1.0"
10
10
 
11
11
  [tool.poetry.dependencies]
12
12
  Sphinx = {version = ">=3.5.3,<6.0.0", optional = true}
13
- httpx = "^0.23.0"
14
- pydantic = "^1.8.2"
15
- python = "^3.7"
16
- semver = "^2.13.0"
17
- sphinx-rtd-theme = {version = ">=0.5.1,<1.1.0", optional = true}
13
+ httpx = ">=0.23,<0.28.1"
14
+ pydantic = ">=1.8.2,<3.0.0"
15
+ python = "^3.9"
16
+ semver = ">=2.13,<4.0"
17
+ sphinx-rtd-theme = {version = ">=0.5.1,<2.1.0", optional = true}
18
18
  typing-extensions = ">=3.10,<5.0"
19
19
  xmltodict = ">=0.12,<0.14"
20
20
 
21
21
  [tool.poetry.extras]
22
22
  docs = ["Sphinx", "sphinx-rtd-theme"]
23
23
 
24
- [tool.poetry.dev-dependencies]
25
- bandit = "^1.7.0"
26
- black = "^22.1"
27
- importlib-metadata = "<5" # Workaround for https://github.com/PyCQA/bandit/issues/951
24
+ [tool.poetry.group.dev.dependencies]
25
+ bandit = "^1.7.0"
26
+ importlib-metadata = "<7" # Workaround for https://github.com/PyCQA/bandit/issues/951
28
27
  isort = "^5.7.0"
29
- lxml = "^4.7.1"
30
- mypy = "^0.981"
31
- pylint = "^2.8.2"
28
+ lxml = "^5.2.2"
29
+ mypy = "^1.1"
32
30
  pytest = "^7.0.0"
33
- pytest-cov = "^3.0.0"
34
- tox = "^3.23.0"
31
+ pytest-cov = "^4.0.0"
32
+ tox = "^3.23.0"
33
+ ruff = "^0.12.0"
35
34
 
36
35
  [build-system]
37
36
  build-backend = "poetry.core.masonry.api"
@@ -1,38 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- from setuptools import setup
3
-
4
- packages = \
5
- ['mirth_client']
6
-
7
- package_data = \
8
- {'': ['*']}
9
-
10
- install_requires = \
11
- ['httpx>=0.23.0,<0.24.0',
12
- 'pydantic>=1.8.2,<2.0.0',
13
- 'semver>=2.13.0,<3.0.0',
14
- 'typing-extensions>=3.10,<5.0',
15
- 'xmltodict>=0.12,<0.14']
16
-
17
- extras_require = \
18
- {'docs': ['Sphinx>=3.5.3,<6.0.0', 'sphinx-rtd-theme>=0.5.1,<1.1.0']}
19
-
20
- setup_kwargs = {
21
- 'name': 'mirth-client',
22
- 'version': '3.2.0',
23
- 'description': 'Basic Python interface for Mirth Connect',
24
- 'long_description': '# python-mirth-client\n\n[![PyPI Release](https://img.shields.io/pypi/v/mirth-client)](https://pypi.org/project/mirth-client/)\n[![Documentation Status](https://readthedocs.org/projects/python-mirth-client/badge/?version=latest)](https://python-mirth-client.readthedocs.io/en/latest/?badge=latest)\n\nA basic async Python interface for Mirth Connect\n\n## Installation\n\n`pip install mirth-client`\n\n## Usage example\n\nAssuming running within IPython or as part of an async application with an event-loop set up.\n\n```python\nfrom mirth_client import MirthAPI\nfrom pprint import pprint\n\nasync with MirthAPI("https://mirth.domain.com/api") as api:\n await api.login("****", "****")\n\n # Check out list of channels\n for channel in await api.channels():\n metadata = await channel.get_info()\n print(f"ID: {metadata.id}")\n print(f"Name: {metadata.name}")\n print("")\n\n # Get stats for a channel\n s = await api.channel("3cdefad2-bf10-49ee-81c9-8ac6fd2fed67").get_statistics()\n pprint(s)\n\n # Check channel for failed messages\n e = await api.channel("3cdefad2-bf10-49ee-81c9-8ac6fd2fed67").get_messages(status="error")\n pprint(e)\n\n # Get 10 most recent events\n e = await api.events(10)\n pprint(e)\n```\n',
25
- 'author': 'Joel Collins',
26
- 'author_email': 'joel.collins@renalregistry.nhs.uk',
27
- 'maintainer': None,
28
- 'maintainer_email': None,
29
- 'url': None,
30
- 'packages': packages,
31
- 'package_data': package_data,
32
- 'install_requires': install_requires,
33
- 'extras_require': extras_require,
34
- 'python_requires': '>=3.7,<4.0',
35
- }
36
-
37
-
38
- setup(**setup_kwargs)
File without changes
File without changes