hexconv 0.2.5__tar.gz → 0.2.6__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.4
2
2
  Name: hexconv
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: Pythonic conversion toolkit for bytes, hex, integers, arrays, binary strings, base64, and text.
5
5
  Author: hexconv contributors
6
6
  License-Expression: MIT
@@ -59,6 +59,25 @@ hx.from_text("data").hex
59
59
  # '64617461'
60
60
  ```
61
61
 
62
+ The bare `.hex`, `.text`, and `.bytes` properties are shortcuts for zero-argument
63
+ `to_*` methods. Call the method form when you need options:
64
+
65
+ ```python
66
+ value = hx.from_hex("deadbeef")
67
+
68
+ value.to_hex()
69
+ # 'deadbeef' (same as value.hex)
70
+
71
+ value.to_hex(sep=" ", uppercase=True)
72
+ # 'DE AD BE EF'
73
+
74
+ value.to_bytes()
75
+ # b'\xde\xad\xbe\xef'
76
+
77
+ hx.from_hex("68656c6c6f").to_text()
78
+ # 'hello'
79
+ ```
80
+
62
81
  ## Fast compose
63
82
 
64
83
  Create your own converters by snapping together
@@ -186,12 +205,6 @@ conv("12345678")
186
205
  More conversion patterns:
187
206
 
188
207
  ```python
189
- hx.Text()("hello").bytes
190
- # b'hello'
191
-
192
- hx.Hex()("68656c6c6f").text
193
- # 'hello'
194
-
195
208
  hx.BytesArray()([0x4F, 0x4B]).to(hx.Text())
196
209
  # 'OK'
197
210
 
@@ -30,6 +30,25 @@ hx.from_text("data").hex
30
30
  # '64617461'
31
31
  ```
32
32
 
33
+ The bare `.hex`, `.text`, and `.bytes` properties are shortcuts for zero-argument
34
+ `to_*` methods. Call the method form when you need options:
35
+
36
+ ```python
37
+ value = hx.from_hex("deadbeef")
38
+
39
+ value.to_hex()
40
+ # 'deadbeef' (same as value.hex)
41
+
42
+ value.to_hex(sep=" ", uppercase=True)
43
+ # 'DE AD BE EF'
44
+
45
+ value.to_bytes()
46
+ # b'\xde\xad\xbe\xef'
47
+
48
+ hx.from_hex("68656c6c6f").to_text()
49
+ # 'hello'
50
+ ```
51
+
33
52
  ## Fast compose
34
53
 
35
54
  Create your own converters by snapping together
@@ -157,12 +176,6 @@ conv("12345678")
157
176
  More conversion patterns:
158
177
 
159
178
  ```python
160
- hx.Text()("hello").bytes
161
- # b'hello'
162
-
163
- hx.Hex()("68656c6c6f").text
164
- # 'hello'
165
-
166
179
  hx.BytesArray()([0x4F, 0x4B]).to(hx.Text())
167
180
  # 'OK'
168
181
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hexconv"
7
- version = "0.2.5"
7
+ version = "0.2.6"
8
8
  description = "Pythonic conversion toolkit for bytes, hex, integers, arrays, binary strings, base64, and text."
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hexconv
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: Pythonic conversion toolkit for bytes, hex, integers, arrays, binary strings, base64, and text.
5
5
  Author: hexconv contributors
6
6
  License-Expression: MIT
@@ -59,6 +59,25 @@ hx.from_text("data").hex
59
59
  # '64617461'
60
60
  ```
61
61
 
62
+ The bare `.hex`, `.text`, and `.bytes` properties are shortcuts for zero-argument
63
+ `to_*` methods. Call the method form when you need options:
64
+
65
+ ```python
66
+ value = hx.from_hex("deadbeef")
67
+
68
+ value.to_hex()
69
+ # 'deadbeef' (same as value.hex)
70
+
71
+ value.to_hex(sep=" ", uppercase=True)
72
+ # 'DE AD BE EF'
73
+
74
+ value.to_bytes()
75
+ # b'\xde\xad\xbe\xef'
76
+
77
+ hx.from_hex("68656c6c6f").to_text()
78
+ # 'hello'
79
+ ```
80
+
62
81
  ## Fast compose
63
82
 
64
83
  Create your own converters by snapping together
@@ -186,12 +205,6 @@ conv("12345678")
186
205
  More conversion patterns:
187
206
 
188
207
  ```python
189
- hx.Text()("hello").bytes
190
- # b'hello'
191
-
192
- hx.Hex()("68656c6c6f").text
193
- # 'hello'
194
-
195
208
  hx.BytesArray()([0x4F, 0x4B]).to(hx.Text())
196
209
  # 'OK'
197
210
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes