quickspirit 2.0.0__py3-none-any.whl → 2.0.1__py3-none-any.whl
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,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: quickspirit
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: Fast, Async Network & File Downloader Client In Python
|
|
5
5
|
Home-page: https://github.com/DroidZed/QuickSpirit-Async
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -50,6 +50,37 @@ poetry add quickspirit
|
|
|
50
50
|
uv add quickspirit
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
## Usage:
|
|
54
|
+
|
|
55
|
+
The library's getter function returns a bytes data repersenting the bytes coming in from the network. Since we don't know the shape of the data, I delegated the responsibility to you to figure out how to parse it to your liking.
|
|
56
|
+
|
|
57
|
+
A sample code would look like this:
|
|
58
|
+
|
|
59
|
+
```py
|
|
60
|
+
from quickspirit import HttpAsyncClient
|
|
61
|
+
from asyncio import run
|
|
62
|
+
from json import joads
|
|
63
|
+
from typing import Any
|
|
64
|
+
|
|
65
|
+
async def main():
|
|
66
|
+
result = await HttpAsyncClient().get("https://some distant url returning json hopefully")
|
|
67
|
+
|
|
68
|
+
if result.Error:
|
|
69
|
+
raise result.Error
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
data: dict[str, Any] = loads(result.Data)
|
|
73
|
+
|
|
74
|
+
# do whatever you need now that you have the data...
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
if __name__ == "__main__":
|
|
78
|
+
run(main())
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
A complete example can be found in the `example` directory.
|
|
83
|
+
|
|
53
84
|
## Testing:
|
|
54
85
|
|
|
55
86
|
Clone with git:
|
|
@@ -3,7 +3,7 @@ quickspirit/http_async_client.py,sha256=KFllZ4eYUgw9R_V9qajzHmwcCkui1BJEbix33fFH
|
|
|
3
3
|
quickspirit/http_async_downloader.py,sha256=poOvyS8YjMo_E17LiI-klYStrLgRezSq7P0Y5MoQ7Tg,1073
|
|
4
4
|
quickspirit/http_errors.py,sha256=_Hsj_OAfllFjZkW5NjN9c4Qw8zsSg5M4eOnNyepOKCU,272
|
|
5
5
|
quickspirit/models.py,sha256=nQGsnaerR1DIUoIdjNFSoLQUc16QMJVXnBa9qTDEKIo,188
|
|
6
|
-
quickspirit-2.0.
|
|
7
|
-
quickspirit-2.0.
|
|
8
|
-
quickspirit-2.0.
|
|
9
|
-
quickspirit-2.0.
|
|
6
|
+
quickspirit-2.0.1.dist-info/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
|
7
|
+
quickspirit-2.0.1.dist-info/METADATA,sha256=gyrEZZ72QzGX6797QxqOny-TCN36k5lJoCz51Kux9PI,2725
|
|
8
|
+
quickspirit-2.0.1.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
|
9
|
+
quickspirit-2.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|