mirth-client 3.2.0__tar.gz → 4.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.
@@ -1,22 +1,26 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: mirth-client
3
- Version: 3.2.0
3
+ Version: 4.2.0
4
4
  Summary: Basic Python interface for Mirth Connect
5
+ License-File: LICENSE
5
6
  Author: Joel Collins
6
7
  Author-email: joel.collins@renalregistry.nhs.uk
7
- Requires-Python: >=3.7,<4.0
8
+ Requires-Python: >=3.9,<4.0
8
9
  Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.7
10
- Classifier: Programming Language :: Python :: 3.8
11
10
  Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
12
16
  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"
17
+ Requires-Dist: Sphinx (>=3.5.3,<8.0.0) ; extra == "docs"
18
+ Requires-Dist: httpx (>=0.23,<0.28.2)
19
+ Requires-Dist: pydantic (>=1.8.2,<3.0.0)
20
+ Requires-Dist: semver (>=2.13,<4.0)
21
+ Requires-Dist: sphinx-rtd-theme (>=0.5.1,<2.1.0) ; extra == "docs"
18
22
  Requires-Dist: typing-extensions (>=3.10,<5.0)
19
- Requires-Dist: xmltodict (>=0.12,<0.14)
23
+ Requires-Dist: xmltodict (>=0.12,<1.1)
20
24
  Description-Content-Type: text/markdown
21
25
 
22
26
  # python-mirth-client
@@ -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:
@@ -3,7 +3,6 @@ Pydantic models for parsing Mirth XML responses
3
3
  and converting returned data into Python objects
4
4
  """
5
5
 
6
- import xml
7
6
  from collections import OrderedDict
8
7
  from datetime import datetime
9
8
  from typing import (
@@ -21,15 +20,33 @@ from typing import (
21
20
  from uuid import UUID
22
21
 
23
22
  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
23
+ import typing
24
+ import pydantic
25
+ from packaging import version
26
+ from xml.parsers.expat import ExpatError
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.
@@ -209,22 +226,22 @@ class XMLBaseModel(MirthBaseModel):
209
226
  ValueError,
210
227
  TypeError,
211
228
  UnicodeDecodeError,
212
- xml.parsers.expat.ExpatError, # pylint: disable=no-member
229
+ ExpatError, # pylint: disable=no-member
213
230
  ) as e:
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.2.0"
10
10
 
11
11
  [tool.poetry.dependencies]
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}
12
+ Sphinx = {version = ">=3.5.3,<8.0.0", optional = true}
13
+ httpx = ">=0.23,<0.28.2"
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
- xmltodict = ">=0.12,<0.14"
19
+ xmltodict = ">=0.12,<1.1"
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
28
- isort = "^5.7.0"
29
- lxml = "^4.7.1"
30
- mypy = "^0.981"
31
- pylint = "^2.8.2"
32
- pytest = "^7.0.0"
33
- pytest-cov = "^3.0.0"
34
- tox = "^3.23.0"
24
+ [tool.poetry.group.dev.dependencies]
25
+ bandit = "^1.7.0"
26
+ importlib-metadata = "<9" # Workaround for https://github.com/PyCQA/bandit/issues/951
27
+ isort = ">=5.7,<7.0"
28
+ lxml = ">=5.2.2,<7.0.0"
29
+ mypy = "^1.1"
30
+ pytest = ">=7,<9"
31
+ pytest-cov = ">=4,<8"
32
+ tox = ">=3.23,<5.0"
33
+ ruff = ">=0.12,<0.16"
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