RESTFly 2.0.3__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.
- restfly-2.0.3/LICENSE +19 -0
- restfly-2.0.3/PKG-INFO +48 -0
- restfly-2.0.3/README.md +36 -0
- restfly-2.0.3/RESTFly.egg-info/PKG-INFO +48 -0
- restfly-2.0.3/RESTFly.egg-info/SOURCES.txt +29 -0
- restfly-2.0.3/RESTFly.egg-info/dependency_links.txt +1 -0
- restfly-2.0.3/RESTFly.egg-info/requires.txt +3 -0
- restfly-2.0.3/RESTFly.egg-info/top_level.txt +1 -0
- restfly-2.0.3/pyproject.toml +54 -0
- restfly-2.0.3/restfly/__init__.py +25 -0
- restfly-2.0.3/restfly/_async.py +1570 -0
- restfly-2.0.3/restfly/_base.py +340 -0
- restfly-2.0.3/restfly/_errors.py +213 -0
- restfly-2.0.3/restfly/_iterator.py +302 -0
- restfly-2.0.3/restfly/_models.py +98 -0
- restfly-2.0.3/restfly/_sync.py +1565 -0
- restfly-2.0.3/restfly/_utils.py +105 -0
- restfly-2.0.3/restfly/_version.py +1 -0
- restfly-2.0.3/restfly/types.py +77 -0
- restfly-2.0.3/setup.cfg +4 -0
- restfly-2.0.3/tests/test_apimodel.py +75 -0
- restfly-2.0.3/tests/test_client_async.py +278 -0
- restfly-2.0.3/tests/test_client_base.py +139 -0
- restfly-2.0.3/tests/test_client_sync.py +310 -0
- restfly-2.0.3/tests/test_endpoint_async.py +234 -0
- restfly-2.0.3/tests/test_endpoint_sync.py +232 -0
- restfly-2.0.3/tests/test_errors.py +29 -0
- restfly-2.0.3/tests/test_examples_httpbin_client.py +120 -0
- restfly-2.0.3/tests/test_iterators.py +207 -0
- restfly-2.0.3/tests/test_utils_assignment.py +23 -0
- restfly-2.0.3/tests/test_utils_unmarshal.py +74 -0
restfly-2.0.3/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2024 Steven McGrath
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
restfly-2.0.3/PKG-INFO
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: RESTFly
|
|
3
|
+
Version: 2.0.3
|
|
4
|
+
Summary: Write your own API Client libraries quickly.
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: httpx>=0.28.1
|
|
9
|
+
Requires-Dist: pydantic>=2.12.5
|
|
10
|
+
Requires-Dist: pydantic-xml>=2.19.0
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
# What is RESTFly?
|
|
16
|
+
|
|
17
|
+
Building API SDKs can be often be difficult. There is often a lot of boilerplate code
|
|
18
|
+
that is reused over and over again between classes, packages, and even libraries.
|
|
19
|
+
RESTFly is designed to try to remove as much of that boilerplate code as possible. The
|
|
20
|
+
library leverages HTTPX and Pydantic in the backend to support making interacting with
|
|
21
|
+
the API endpoints themselves simple, as well as supporting the ability to marshal and
|
|
22
|
+
unmarshal the data between python objects and XML or JSON.
|
|
23
|
+
|
|
24
|
+
Version 2 of RESTFly is a ground-up rewrite in order to support a more modern developer
|
|
25
|
+
experience when working with the library.
|
|
26
|
+
|
|
27
|
+
- Completely rewritten to use HTTPX instead of Requests
|
|
28
|
+
- Support for both synchronous and asynchronous clients.
|
|
29
|
+
- Significantly better typing support, which should make both AI Agents and devs happy.
|
|
30
|
+
- Support for coercion of data to/from Pydantic and Pydantic-XML models.
|
|
31
|
+
- Improved endpoint grafting (no more `@property` methods for each endpoint).
|
|
32
|
+
- Batteries-included error handling and retry logic.
|
|
33
|
+
- Designed to be heavily modified based on your particular needs.
|
|
34
|
+
|
|
35
|
+
# Why RESTFly?
|
|
36
|
+
|
|
37
|
+
After building several SDKs over the years, I wanted something that could abstract away
|
|
38
|
+
a lot of the boilerplate code that I kept having to write over and over. RESTFly
|
|
39
|
+
version 1 ended up being nearly a direct port of what I had built with pyTenable back
|
|
40
|
+
in 2017 and expanded since then. Over time, pyTenable was refactored to itself leverage
|
|
41
|
+
RESTFly, and several other SDKs started taking advantage of RESTFly as well. For
|
|
42
|
+
version 2, I wanted to incorporate a lot more of the modern Python approaches and also
|
|
43
|
+
incorporate a lot of the idioms that I've grown used to with libraries like
|
|
44
|
+
FastAPI, Pydantic, AsyncIO, etc. I also didn't want to have to keep diving into the
|
|
45
|
+
documentation every time I needed something when more and more libraries were supporting
|
|
46
|
+
type hints to aide developers within their SDKs.
|
|
47
|
+
|
|
48
|
+
To learn more, visit the documentation at [restfly.rtfd.io](https://restfly.rtfd.io).
|
restfly-2.0.3/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# What is RESTFly?
|
|
4
|
+
|
|
5
|
+
Building API SDKs can be often be difficult. There is often a lot of boilerplate code
|
|
6
|
+
that is reused over and over again between classes, packages, and even libraries.
|
|
7
|
+
RESTFly is designed to try to remove as much of that boilerplate code as possible. The
|
|
8
|
+
library leverages HTTPX and Pydantic in the backend to support making interacting with
|
|
9
|
+
the API endpoints themselves simple, as well as supporting the ability to marshal and
|
|
10
|
+
unmarshal the data between python objects and XML or JSON.
|
|
11
|
+
|
|
12
|
+
Version 2 of RESTFly is a ground-up rewrite in order to support a more modern developer
|
|
13
|
+
experience when working with the library.
|
|
14
|
+
|
|
15
|
+
- Completely rewritten to use HTTPX instead of Requests
|
|
16
|
+
- Support for both synchronous and asynchronous clients.
|
|
17
|
+
- Significantly better typing support, which should make both AI Agents and devs happy.
|
|
18
|
+
- Support for coercion of data to/from Pydantic and Pydantic-XML models.
|
|
19
|
+
- Improved endpoint grafting (no more `@property` methods for each endpoint).
|
|
20
|
+
- Batteries-included error handling and retry logic.
|
|
21
|
+
- Designed to be heavily modified based on your particular needs.
|
|
22
|
+
|
|
23
|
+
# Why RESTFly?
|
|
24
|
+
|
|
25
|
+
After building several SDKs over the years, I wanted something that could abstract away
|
|
26
|
+
a lot of the boilerplate code that I kept having to write over and over. RESTFly
|
|
27
|
+
version 1 ended up being nearly a direct port of what I had built with pyTenable back
|
|
28
|
+
in 2017 and expanded since then. Over time, pyTenable was refactored to itself leverage
|
|
29
|
+
RESTFly, and several other SDKs started taking advantage of RESTFly as well. For
|
|
30
|
+
version 2, I wanted to incorporate a lot more of the modern Python approaches and also
|
|
31
|
+
incorporate a lot of the idioms that I've grown used to with libraries like
|
|
32
|
+
FastAPI, Pydantic, AsyncIO, etc. I also didn't want to have to keep diving into the
|
|
33
|
+
documentation every time I needed something when more and more libraries were supporting
|
|
34
|
+
type hints to aide developers within their SDKs.
|
|
35
|
+
|
|
36
|
+
To learn more, visit the documentation at [restfly.rtfd.io](https://restfly.rtfd.io).
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: RESTFly
|
|
3
|
+
Version: 2.0.3
|
|
4
|
+
Summary: Write your own API Client libraries quickly.
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: httpx>=0.28.1
|
|
9
|
+
Requires-Dist: pydantic>=2.12.5
|
|
10
|
+
Requires-Dist: pydantic-xml>=2.19.0
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
# What is RESTFly?
|
|
16
|
+
|
|
17
|
+
Building API SDKs can be often be difficult. There is often a lot of boilerplate code
|
|
18
|
+
that is reused over and over again between classes, packages, and even libraries.
|
|
19
|
+
RESTFly is designed to try to remove as much of that boilerplate code as possible. The
|
|
20
|
+
library leverages HTTPX and Pydantic in the backend to support making interacting with
|
|
21
|
+
the API endpoints themselves simple, as well as supporting the ability to marshal and
|
|
22
|
+
unmarshal the data between python objects and XML or JSON.
|
|
23
|
+
|
|
24
|
+
Version 2 of RESTFly is a ground-up rewrite in order to support a more modern developer
|
|
25
|
+
experience when working with the library.
|
|
26
|
+
|
|
27
|
+
- Completely rewritten to use HTTPX instead of Requests
|
|
28
|
+
- Support for both synchronous and asynchronous clients.
|
|
29
|
+
- Significantly better typing support, which should make both AI Agents and devs happy.
|
|
30
|
+
- Support for coercion of data to/from Pydantic and Pydantic-XML models.
|
|
31
|
+
- Improved endpoint grafting (no more `@property` methods for each endpoint).
|
|
32
|
+
- Batteries-included error handling and retry logic.
|
|
33
|
+
- Designed to be heavily modified based on your particular needs.
|
|
34
|
+
|
|
35
|
+
# Why RESTFly?
|
|
36
|
+
|
|
37
|
+
After building several SDKs over the years, I wanted something that could abstract away
|
|
38
|
+
a lot of the boilerplate code that I kept having to write over and over. RESTFly
|
|
39
|
+
version 1 ended up being nearly a direct port of what I had built with pyTenable back
|
|
40
|
+
in 2017 and expanded since then. Over time, pyTenable was refactored to itself leverage
|
|
41
|
+
RESTFly, and several other SDKs started taking advantage of RESTFly as well. For
|
|
42
|
+
version 2, I wanted to incorporate a lot more of the modern Python approaches and also
|
|
43
|
+
incorporate a lot of the idioms that I've grown used to with libraries like
|
|
44
|
+
FastAPI, Pydantic, AsyncIO, etc. I also didn't want to have to keep diving into the
|
|
45
|
+
documentation every time I needed something when more and more libraries were supporting
|
|
46
|
+
type hints to aide developers within their SDKs.
|
|
47
|
+
|
|
48
|
+
To learn more, visit the documentation at [restfly.rtfd.io](https://restfly.rtfd.io).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
RESTFly.egg-info/PKG-INFO
|
|
5
|
+
RESTFly.egg-info/SOURCES.txt
|
|
6
|
+
RESTFly.egg-info/dependency_links.txt
|
|
7
|
+
RESTFly.egg-info/requires.txt
|
|
8
|
+
RESTFly.egg-info/top_level.txt
|
|
9
|
+
restfly/__init__.py
|
|
10
|
+
restfly/_async.py
|
|
11
|
+
restfly/_base.py
|
|
12
|
+
restfly/_errors.py
|
|
13
|
+
restfly/_iterator.py
|
|
14
|
+
restfly/_models.py
|
|
15
|
+
restfly/_sync.py
|
|
16
|
+
restfly/_utils.py
|
|
17
|
+
restfly/_version.py
|
|
18
|
+
restfly/types.py
|
|
19
|
+
tests/test_apimodel.py
|
|
20
|
+
tests/test_client_async.py
|
|
21
|
+
tests/test_client_base.py
|
|
22
|
+
tests/test_client_sync.py
|
|
23
|
+
tests/test_endpoint_async.py
|
|
24
|
+
tests/test_endpoint_sync.py
|
|
25
|
+
tests/test_errors.py
|
|
26
|
+
tests/test_examples_httpbin_client.py
|
|
27
|
+
tests/test_iterators.py
|
|
28
|
+
tests/test_utils_assignment.py
|
|
29
|
+
tests/test_utils_unmarshal.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
restfly
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "RESTFly"
|
|
3
|
+
version = "2.0.3"
|
|
4
|
+
description = "Write your own API Client libraries quickly."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"httpx>=0.28.1",
|
|
9
|
+
"pydantic>=2.12.5",
|
|
10
|
+
"pydantic-xml>=2.19.0",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[dependency-groups]
|
|
14
|
+
dev = [
|
|
15
|
+
"build>=1.4.3",
|
|
16
|
+
"hatch>=1.16.5",
|
|
17
|
+
"mypy>=1.20.0",
|
|
18
|
+
"pre-commit>=4.5.1",
|
|
19
|
+
"ptpython>=3.0.32",
|
|
20
|
+
"pylsp-mypy>=0.7.1",
|
|
21
|
+
"rust-just>=1.50.0",
|
|
22
|
+
]
|
|
23
|
+
docs = [
|
|
24
|
+
"furo>=2025.12.19",
|
|
25
|
+
"sphinx>=9.1.0",
|
|
26
|
+
"sphinxcontrib-mermaid>=2.0.1",
|
|
27
|
+
]
|
|
28
|
+
test = [
|
|
29
|
+
"mypy>=1.20.0",
|
|
30
|
+
"pytest>=9.0.2",
|
|
31
|
+
"pytest-asyncio>=1.3.0",
|
|
32
|
+
"pytest-cov>=7.1.0",
|
|
33
|
+
"pytest-httpx>=0.36.0",
|
|
34
|
+
"ruff>=0.15.11",
|
|
35
|
+
"rust-just>=1.50.0",
|
|
36
|
+
"ty>=0.0.32",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[tool.pytest.ini_options]
|
|
40
|
+
pythonpath = [".", "examples"]
|
|
41
|
+
addopts = "--cov-report term-missing:skip-covered --cov=restfly"
|
|
42
|
+
testpaths = ["tests"]
|
|
43
|
+
asyncio_mode = "auto"
|
|
44
|
+
|
|
45
|
+
[tool.ty.src]
|
|
46
|
+
respect-ignore-files = true
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
[tool.ty.environment]
|
|
50
|
+
extra-paths = ["./examples"]
|
|
51
|
+
|
|
52
|
+
[tool.esbonio.sphinx]
|
|
53
|
+
buildArguments = ["sphinx-build", "-M", "html", "docs", "docs/_build"]
|
|
54
|
+
pythonCommand = ["uv", "run", "python"]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""
|
|
2
|
+
RESTFly Library Package
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from ._async import AsyncAPIClient, AsyncAPIEndpoint
|
|
6
|
+
from ._errors import APIError, ErrorStatus, RetryError
|
|
7
|
+
from ._iterator import APIIterator, AsyncAPIIterator
|
|
8
|
+
from ._models import APIModel
|
|
9
|
+
from ._sync import APIClient, APIEndpoint
|
|
10
|
+
from ._version import version as __version__
|
|
11
|
+
|
|
12
|
+
__author__ = "Steven McGrath <steve@mcgrath.sh>"
|
|
13
|
+
__all__ = [
|
|
14
|
+
"APIClient",
|
|
15
|
+
"APIEndpoint",
|
|
16
|
+
"APIError",
|
|
17
|
+
"APIIterator",
|
|
18
|
+
"APIModel",
|
|
19
|
+
"AsyncAPIClient",
|
|
20
|
+
"AsyncAPIEndpoint",
|
|
21
|
+
"AsyncAPIIterator",
|
|
22
|
+
"ErrorStatus",
|
|
23
|
+
"RetryError",
|
|
24
|
+
"__version__",
|
|
25
|
+
]
|