aioipp 0.18.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.
aioipp-0.18.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Chris Talkington
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
aioipp-0.18.0/PKG-INFO ADDED
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: aioipp
3
+ Version: 0.18.0
4
+ Summary: Asynchronous Python client for Internet Printing Protocol (IPP), a maintained fork of pyipp
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Keywords: ipp,api,async,client,printer
8
+ Author: Chris Talkington
9
+ Author-email: chris@talkingtontech.com
10
+ Maintainer: Brian Egge
11
+ Maintainer-email: brianegge@gmail.com
12
+ Requires-Python: >=3.9,<4.0
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Framework :: AsyncIO
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Natural Language :: English
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Requires-Dist: aiohttp (>=3.0.0)
27
+ Requires-Dist: async-timeout (==5.0.1) ; python_version < "3.11"
28
+ Requires-Dist: awesomeversion (>=21.10.1)
29
+ Requires-Dist: backoff (>=2.2.0)
30
+ Requires-Dist: deepmerge (>=1.1.0)
31
+ Requires-Dist: yarl (>=1.6.0)
32
+ Project-URL: Bug Tracker, https://github.com/brianegge/aioipp/issues
33
+ Project-URL: Changelog, https://github.com/brianegge/aioipp/releases
34
+ Project-URL: Documentation, https://github.com/brianegge/aioipp
35
+ Project-URL: Homepage, https://github.com/brianegge/aioipp
36
+ Project-URL: Repository, https://github.com/brianegge/aioipp
37
+ Description-Content-Type: text/markdown
38
+
39
+ # Python: Internet Printing Protocol (IPP) Client
40
+
41
+ Asynchronous Python client for Internet Printing Protocol (IPP).
42
+
43
+ > **Note:** `aioipp` is a maintained fork of [pyipp](https://github.com/ctalkington/python-ipp)
44
+ > by Chris Talkington. It keeps the `pyipp` import name and adds page counter support.
45
+ > It is published on PyPI as `aioipp`; do not install it alongside `pyipp`.
46
+
47
+ ## About
48
+
49
+ This package allows you to monitor printers that support the Internet Printing Protocol (IPP) programmatically.
50
+
51
+ ## Installation
52
+
53
+ ```bash
54
+ pip install aioipp
55
+ ```
56
+
57
+ ## Usage
58
+
59
+ ```python
60
+ import asyncio
61
+
62
+ from pyipp import IPP, Printer
63
+
64
+
65
+ async def main():
66
+ """Show example of connecting to your IPP print server."""
67
+ async with IPP("ipps://EPSON123456.local:631/ipp/print") as ipp:
68
+ printer: Printer = await ipp.printer()
69
+ print(printer)
70
+
71
+
72
+ if __name__ == "__main__":
73
+ loop = asyncio.get_event_loop()
74
+ loop.run_until_complete(main())
75
+ ```
76
+
77
+ ## Setting up development environment
78
+
79
+ This Python project is fully managed using the [Poetry](https://python-poetry.org) dependency
80
+ manager. But also relies on the use of NodeJS for certain checks during
81
+ development.
82
+
83
+ You need at least:
84
+
85
+ - Python 3.9+
86
+ - [Poetry](https://python-poetry.org/docs/#installation)
87
+ - NodeJS 20+ (including NPM)
88
+
89
+ To install all packages, including all development requirements:
90
+
91
+ ```bash
92
+ npm install
93
+ poetry install
94
+ ```
95
+
96
+ As this repository uses the [pre-commit](https://pre-commit.com/) framework, all changes
97
+ are linted and tested with each commit. You can run all checks and tests
98
+ manually, using the following command:
99
+
100
+ ```bash
101
+ poetry run pre-commit run --all-files
102
+ ```
103
+
104
+ To run just the Python tests:
105
+
106
+ ```bash
107
+ poetry run pytest
108
+ ```
109
+
@@ -0,0 +1,70 @@
1
+ # Python: Internet Printing Protocol (IPP) Client
2
+
3
+ Asynchronous Python client for Internet Printing Protocol (IPP).
4
+
5
+ > **Note:** `aioipp` is a maintained fork of [pyipp](https://github.com/ctalkington/python-ipp)
6
+ > by Chris Talkington. It keeps the `pyipp` import name and adds page counter support.
7
+ > It is published on PyPI as `aioipp`; do not install it alongside `pyipp`.
8
+
9
+ ## About
10
+
11
+ This package allows you to monitor printers that support the Internet Printing Protocol (IPP) programmatically.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install aioipp
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```python
22
+ import asyncio
23
+
24
+ from pyipp import IPP, Printer
25
+
26
+
27
+ async def main():
28
+ """Show example of connecting to your IPP print server."""
29
+ async with IPP("ipps://EPSON123456.local:631/ipp/print") as ipp:
30
+ printer: Printer = await ipp.printer()
31
+ print(printer)
32
+
33
+
34
+ if __name__ == "__main__":
35
+ loop = asyncio.get_event_loop()
36
+ loop.run_until_complete(main())
37
+ ```
38
+
39
+ ## Setting up development environment
40
+
41
+ This Python project is fully managed using the [Poetry](https://python-poetry.org) dependency
42
+ manager. But also relies on the use of NodeJS for certain checks during
43
+ development.
44
+
45
+ You need at least:
46
+
47
+ - Python 3.9+
48
+ - [Poetry](https://python-poetry.org/docs/#installation)
49
+ - NodeJS 20+ (including NPM)
50
+
51
+ To install all packages, including all development requirements:
52
+
53
+ ```bash
54
+ npm install
55
+ poetry install
56
+ ```
57
+
58
+ As this repository uses the [pre-commit](https://pre-commit.com/) framework, all changes
59
+ are linted and tested with each commit. You can run all checks and tests
60
+ manually, using the following command:
61
+
62
+ ```bash
63
+ poetry run pre-commit run --all-files
64
+ ```
65
+
66
+ To run just the Python tests:
67
+
68
+ ```bash
69
+ poetry run pytest
70
+ ```
@@ -0,0 +1,178 @@
1
+ [tool.poetry]
2
+ name = "aioipp"
3
+ description = "Asynchronous Python client for Internet Printing Protocol (IPP), a maintained fork of pyipp"
4
+ authors = ["Chris Talkington <chris@talkingtontech.com>"]
5
+ classifiers = [
6
+ "Development Status :: 4 - Beta",
7
+ "Framework :: AsyncIO",
8
+ "Intended Audience :: Developers",
9
+ "Natural Language :: English",
10
+ "Programming Language :: Python :: 3.9",
11
+ "Programming Language :: Python :: 3.10",
12
+ "Programming Language :: Python :: 3",
13
+ "Topic :: Software Development :: Libraries :: Python Modules",
14
+ ]
15
+ keywords = ["ipp", "api", "async", "client", "printer"]
16
+ documentation = "https://github.com/brianegge/aioipp"
17
+ homepage = "https://github.com/brianegge/aioipp"
18
+ license = "MIT"
19
+ maintainers = ["Brian Egge <brianegge@gmail.com>"]
20
+ packages = [
21
+ {include = "pyipp", from = "src"},
22
+ ]
23
+ readme = "README.md"
24
+ repository = "https://github.com/brianegge/aioipp"
25
+ version = "0.18.0"
26
+
27
+ [tool.poetry.dependencies]
28
+ aiohttp = ">=3.0.0"
29
+ async-timeout = { version = "5.0.1", python = "<3.11" }
30
+ awesomeversion = ">=21.10.1"
31
+ backoff = ">=2.2.0"
32
+ deepmerge = ">=1.1.0"
33
+ python = "^3.9"
34
+ yarl = ">=1.6.0"
35
+
36
+ [tool.poetry.dev-dependencies]
37
+ aresponses = "3.0.0"
38
+ black = "25.1.0"
39
+ blacken-docs = "1.19.1"
40
+ codespell = "2.4.1"
41
+ covdefaults = "2.3.0"
42
+ coverage = {version = "7.9.1", extras = ["toml"]}
43
+ mypy = "1.16.0"
44
+ pre-commit = "4.2.0"
45
+ pre-commit-hooks = "5.0.0"
46
+ pylint = "3.3.7"
47
+ pytest = "8.4.0"
48
+ pytest-asyncio = "1.0.0"
49
+ pytest-cov = "6.2.1"
50
+ ruff = "0.6.9"
51
+ safety = "3.5.2"
52
+ syrupy = "4.9.1"
53
+ types-cachetools = "^5.3.0"
54
+ yamllint = "1.37.1"
55
+
56
+ [tool.poetry.urls]
57
+ "Bug Tracker" = "https://github.com/brianegge/aioipp/issues"
58
+ Changelog = "https://github.com/brianegge/aioipp/releases"
59
+
60
+ [tool.coverage.report]
61
+ show_missing = true
62
+ fail_under = 53
63
+
64
+ [tool.coverage.run]
65
+ plugins = ["covdefaults"]
66
+ source = ["pyipp"]
67
+
68
+ [tool.mypy]
69
+ # Specify the target platform details in config, so your developers are
70
+ # free to run mypy on Windows, Linux, or macOS and get consistent
71
+ # results.
72
+ platform = "linux"
73
+ python_version = 3.9
74
+
75
+ # show error messages from unrelated files
76
+ follow_imports = "normal"
77
+
78
+ # suppress errors about unsatisfied imports
79
+ ignore_missing_imports = true
80
+
81
+ # be strict
82
+ check_untyped_defs = true
83
+ disallow_any_generics = true
84
+ disallow_incomplete_defs = true
85
+ disallow_subclassing_any = true
86
+ disallow_untyped_calls = true
87
+ disallow_untyped_decorators = true
88
+ disallow_untyped_defs = true
89
+ no_implicit_optional = true
90
+ no_implicit_reexport = true
91
+ strict_optional = true
92
+ warn_incomplete_stub = true
93
+ warn_no_return = true
94
+ warn_redundant_casts = true
95
+ warn_return_any = true
96
+ warn_unused_configs = true
97
+ warn_unused_ignores = true
98
+
99
+ [[tool.mypy.overrides]]
100
+ follow_imports = "skip"
101
+ module = "mypy-aiohttp.*"
102
+
103
+ [tool.pylint.MASTER]
104
+ extension-pkg-whitelist = [
105
+ "pydantic",
106
+ ]
107
+ ignore = [
108
+ "examples",
109
+ "tests",
110
+ ]
111
+
112
+ [tool.pylint.BASIC]
113
+ good-names = [
114
+ "_",
115
+ "ex",
116
+ "fp",
117
+ "i",
118
+ "id",
119
+ "j",
120
+ "k",
121
+ "on",
122
+ "Run",
123
+ "T",
124
+ "wv",
125
+ ]
126
+
127
+ [tool.pylint."MESSAGES CONTROL"]
128
+ disable = [
129
+ "too-few-public-methods",
130
+ "too-many-arguments",
131
+ "duplicate-code",
132
+ "format",
133
+ "unsubscriptable-object",
134
+ ]
135
+
136
+ [tool.pylint.SIMILARITIES]
137
+ ignore-imports = true
138
+
139
+ [tool.pylint.FORMAT]
140
+ max-line-length = 88
141
+
142
+ [tool.pylint.DESIGN]
143
+ max-attributes = 20
144
+
145
+ [tool.pyright]
146
+ include = ["src"]
147
+
148
+ [tool.pytest.ini_options]
149
+ addopts = "--cov"
150
+ asyncio_mode = "auto"
151
+
152
+ [tool.ruff.lint]
153
+ select = ["ALL"]
154
+ ignore = [
155
+ "ANN101", # Self... explanatory
156
+ "ANN401", # Opinionated warning on disallowing dynamically typed expressions
157
+ "D203", # Conflicts with other rules
158
+ "D213", # Conflicts with other rules
159
+ "D417", # False positives in some occasions
160
+ "PLR2004", # Just annoying, not really useful
161
+ "TRY003",
162
+ "EM101",
163
+ "EXE002",
164
+ ]
165
+
166
+ [tool.ruff.lint.flake8-pytest-style]
167
+ mark-parentheses = false
168
+ fixture-parentheses = false
169
+
170
+ [tool.ruff.lint.isort]
171
+ known-first-party = ["pyipp"]
172
+
173
+ [tool.ruff.lint.mccabe]
174
+ max-complexity = 25
175
+
176
+ [build-system]
177
+ build-backend = "poetry.core.masonry.api"
178
+ requires = ["poetry-core>=1.0.0"]
@@ -0,0 +1,34 @@
1
+ """Asynchronous Python client for IPP."""
2
+ from .exceptions import (
3
+ IPPConnectionError,
4
+ IPPConnectionUpgradeRequired,
5
+ IPPError,
6
+ IPPParseError,
7
+ IPPResponseError,
8
+ IPPVersionNotSupportedError,
9
+ )
10
+ from .ipp import IPP
11
+ from .models import (
12
+ Counters,
13
+ Info,
14
+ Marker,
15
+ Printer,
16
+ State,
17
+ Uri,
18
+ )
19
+
20
+ __all__ = [
21
+ "Counters",
22
+ "Info",
23
+ "Marker",
24
+ "Printer",
25
+ "State",
26
+ "Uri",
27
+ "IPP",
28
+ "IPPConnectionError",
29
+ "IPPConnectionUpgradeRequired",
30
+ "IPPError",
31
+ "IPPParseError",
32
+ "IPPResponseError",
33
+ "IPPVersionNotSupportedError",
34
+ ]
@@ -0,0 +1,52 @@
1
+ """Constants for IPP."""
2
+
3
+ DEFAULT_CHARSET = "utf-8"
4
+ DEFAULT_CHARSET_LANGUAGE = "en-US"
5
+
6
+ DEFAULT_CLASS_ATTRIBUTES = ["printer-name", "member-names"]
7
+
8
+ DEFAULT_JOB_ATTRIBUTES = [
9
+ "job-id",
10
+ "job-name",
11
+ "printer-uri",
12
+ "job-state",
13
+ "job-state-reasons",
14
+ "job-hold-until",
15
+ "job-media-progress",
16
+ "job-k-octets",
17
+ "number-of-documents",
18
+ "copies",
19
+ "job-originating-user-name",
20
+ ]
21
+
22
+ DEFAULT_PRINTER_ATTRIBUTES = [
23
+ "printer-device-id",
24
+ "printer-name",
25
+ "printer-type",
26
+ "printer-location",
27
+ "printer-info",
28
+ "printer-make-and-model",
29
+ "printer-state",
30
+ "printer-state-message",
31
+ "printer-state-reasons",
32
+ "printer-supply",
33
+ "printer-up-time",
34
+ "printer-uri-supported",
35
+ "device-uri",
36
+ "printer-is-shared",
37
+ "printer-more-info",
38
+ "printer-firmware-string-version",
39
+ "marker-colors",
40
+ "marker-high-levels",
41
+ "marker-levels",
42
+ "marker-low-levels",
43
+ "marker-names",
44
+ "marker-types",
45
+ "printer-impressions-completed",
46
+ "printer-impressions-completed-col",
47
+ "printer-pages-completed",
48
+ "printer-media-sheets-completed",
49
+ ]
50
+
51
+ DEFAULT_PORT = 631
52
+ DEFAULT_PROTO_VERSION = (2, 0)