quickspirit 2.0.0__tar.gz → 2.0.2__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,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: quickspirit
3
- Version: 2.0.0
3
+ Version: 2.0.2
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
@@ -24,7 +24,7 @@ Requires-Dist: httpx (>=0.27.0)
24
24
  Project-URL: Repository, https://github.com/DroidZed/QuickSpirit-Async
25
25
  Description-Content-Type: text/markdown
26
26
 
27
- # Quick Spirit
27
+ # Quick Spirit 🐬
28
28
 
29
29
  An easy to use HTTP client with a fast downloader.
30
30
 
@@ -50,6 +50,37 @@ poetry add quickspirit
50
50
  uv add quickspirit
51
51
  ```
52
52
 
53
+ ## Usage:
54
+
55
+ The library's internal mechanism 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`](https://github.com/DroidZed/QuickSpirit-Async/tree/main/example) directory.
83
+
53
84
  ## Testing:
54
85
 
55
86
  Clone with git:
@@ -58,13 +89,17 @@ Clone with git:
58
89
  git clone https://github.com/DroidZed/QuickSpirit-Async && cd QuickSpirit-Async
59
90
  ```
60
91
 
61
- Create a virtual env:
92
+ Create a virtual env and install the dependencies in it:
62
93
 
63
94
  ```sh
64
95
  python3 -m venv .venv && .venv/Scripts/activate
96
+
97
+ # I built the project using poetry, so you may want to have that inside of your venv ! No need to install it in your global python install.
98
+ poetry install --no-root
99
+
65
100
  ```
66
101
 
67
- Run the tests with pytest (install it first using your package manager of choice):
102
+ Run the tests with pytest:
68
103
 
69
104
  ```sh
70
105
  # Here I'm using uv to run the tests, but the command should be the same for other package manager:
@@ -72,4 +107,7 @@ Run the tests with pytest (install it first using your package manager of choice
72
107
  pytest -vs .
73
108
  ```
74
109
 
110
+ ## Licensing
111
+
112
+ The project is under the GPT-3.0 License, see the [`License`](https://github.com/DroidZed/QuickSpirit-Async/blob/main/LICENSE) file for details.
75
113
 
@@ -0,0 +1,86 @@
1
+ # Quick Spirit 🐬
2
+
3
+ An easy to use HTTP client with a fast downloader.
4
+
5
+ This library was made with the famous [HTTPX](https://www.python-httpx.org/) library!
6
+
7
+ I originally intended to make a small module to refactor my networking layer in my apps using httpx, and ended up creating a library !
8
+
9
+ ----
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ # PIP:
15
+
16
+ pip install quickspirit
17
+
18
+ # Poetry:
19
+
20
+ poetry add quickspirit
21
+
22
+ # UV:
23
+
24
+ uv add quickspirit
25
+ ```
26
+
27
+ ## Usage:
28
+
29
+ The library's internal mechanism 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.
30
+
31
+ A sample code would look like this:
32
+
33
+ ```py
34
+ from quickspirit import HttpAsyncClient
35
+ from asyncio import run
36
+ from json import joads
37
+ from typing import Any
38
+
39
+ async def main():
40
+ result = await HttpAsyncClient().get("https://some distant url returning json hopefully")
41
+
42
+ if result.Error:
43
+ raise result.Error
44
+
45
+
46
+ data: dict[str, Any] = loads(result.Data)
47
+
48
+ # do whatever you need now that you have the data...
49
+
50
+
51
+ if __name__ == "__main__":
52
+ run(main())
53
+
54
+ ```
55
+
56
+ A complete example can be found in the [`example`](https://github.com/DroidZed/QuickSpirit-Async/tree/main/example) directory.
57
+
58
+ ## Testing:
59
+
60
+ Clone with git:
61
+
62
+ ```bash
63
+ git clone https://github.com/DroidZed/QuickSpirit-Async && cd QuickSpirit-Async
64
+ ```
65
+
66
+ Create a virtual env and install the dependencies in it:
67
+
68
+ ```sh
69
+ python3 -m venv .venv && .venv/Scripts/activate
70
+
71
+ # I built the project using poetry, so you may want to have that inside of your venv ! No need to install it in your global python install.
72
+ poetry install --no-root
73
+
74
+ ```
75
+
76
+ Run the tests with pytest:
77
+
78
+ ```sh
79
+ # Here I'm using uv to run the tests, but the command should be the same for other package manager:
80
+
81
+ pytest -vs .
82
+ ```
83
+
84
+ ## Licensing
85
+
86
+ The project is under the GPT-3.0 License, see the [`License`](https://github.com/DroidZed/QuickSpirit-Async/blob/main/LICENSE) file for details.
@@ -11,7 +11,7 @@ classifiers = [
11
11
  [project]
12
12
  name = "quickspirit"
13
13
  description = "Fast, Async Network & File Downloader Client In Python"
14
- version = "2.0.0"
14
+ version = "2.0.2"
15
15
  dynamic = [ "classifiers" ]
16
16
  license = { text = "GPL-3.0-or-later" }
17
17
  readme = "README.md"
@@ -1,48 +0,0 @@
1
- # Quick Spirit
2
-
3
- An easy to use HTTP client with a fast downloader.
4
-
5
- This library was made with the famous [HTTPX](https://www.python-httpx.org/) library!
6
-
7
- I originally intended to make a small module to refactor my networking layer in my apps using httpx, and ended up creating a library !
8
-
9
- ----
10
-
11
- ## Install
12
-
13
- ```sh
14
- # PIP:
15
-
16
- pip install quickspirit
17
-
18
- # Poetry:
19
-
20
- poetry add quickspirit
21
-
22
- # UV:
23
-
24
- uv add quickspirit
25
- ```
26
-
27
- ## Testing:
28
-
29
- Clone with git:
30
-
31
- ```bash
32
- git clone https://github.com/DroidZed/QuickSpirit-Async && cd QuickSpirit-Async
33
- ```
34
-
35
- Create a virtual env:
36
-
37
- ```sh
38
- python3 -m venv .venv && .venv/Scripts/activate
39
- ```
40
-
41
- Run the tests with pytest (install it first using your package manager of choice):
42
-
43
- ```sh
44
- # Here I'm using uv to run the tests, but the command should be the same for other package manager:
45
-
46
- pytest -vs .
47
- ```
48
-
File without changes