tracktolib 0.68.0__py3-none-any.whl → 0.69.0__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.4
2
2
  Name: tracktolib
3
- Version: 0.68.0
3
+ Version: 0.69.0
4
4
  Summary: Utility library for python
5
5
  Keywords: utility
6
6
  Author-email: julien.brayere@tracktor.fr
@@ -12,6 +12,8 @@ Classifier: Programming Language :: Python :: 3.13
12
12
  Classifier: Programming Language :: Python :: 3.14
13
13
  Requires-Dist: fastapi>=0.103.2 ; extra == 'api'
14
14
  Requires-Dist: pydantic>=2 ; extra == 'api'
15
+ Requires-Dist: niquests>=3.17.0 ; extra == 'cf'
16
+ Requires-Dist: niquests>=3.17.0 ; extra == 'gh'
15
17
  Requires-Dist: httpx>=0.25.0 ; extra == 'http'
16
18
  Requires-Dist: python-json-logger>=3.2.1 ; extra == 'logs'
17
19
  Requires-Dist: niquests>=3.17.0 ; extra == 'notion'
@@ -26,6 +28,8 @@ Requires-Dist: niquests>=3.17.0 ; extra == 's3-niquests'
26
28
  Requires-Dist: deepdiff>=8.1.0 ; extra == 'tests'
27
29
  Requires-Python: >=3.12, <4.0
28
30
  Provides-Extra: api
31
+ Provides-Extra: cf
32
+ Provides-Extra: gh
29
33
  Provides-Extra: http
30
34
  Provides-Extra: logs
31
35
  Provides-Extra: notion
@@ -126,12 +130,42 @@ uv add tracktolib[s3-minio]
126
130
 
127
131
  ### s3-niquests
128
132
 
129
- Async S3 helpers using [niquests](https://github.com/jawah/niquests) and [botocore](https://github.com/boto/botocore).
133
+ Async S3 helpers using [niquests](https://github.com/jawah/niquests) and [botocore](https://github.com/boto/botocore) presigned URLs.
130
134
 
131
135
  ```bash
132
136
  uv add tracktolib[s3-niquests]
133
137
  ```
134
138
 
139
+ ```python
140
+ from tracktolib.s3.niquests import S3Session
141
+
142
+ async with S3Session(
143
+ endpoint_url='http://localhost:9000',
144
+ access_key='...',
145
+ secret_key='...',
146
+ region='us-east-1',
147
+ ) as s3:
148
+ # Object operations
149
+ await s3.put_object('bucket', 'path/file.txt', b'content')
150
+ content = await s3.get_object('bucket', 'path/file.txt')
151
+ await s3.delete_object('bucket', 'path/file.txt')
152
+
153
+ # Streaming upload (multipart for large files)
154
+ async def data_stream():
155
+ yield b'chunk1'
156
+ yield b'chunk2'
157
+ await s3.file_upload('bucket', 'large-file.bin', data_stream())
158
+
159
+ # Bucket policy management
160
+ policy = {'Version': '2012-10-17', 'Statement': [...]}
161
+ await s3.put_bucket_policy('bucket', policy)
162
+ await s3.get_bucket_policy('bucket')
163
+ await s3.delete_bucket_policy('bucket')
164
+
165
+ # Empty a bucket (delete all objects)
166
+ deleted_count = await s3.empty_bucket('bucket')
167
+ ```
168
+
135
169
  ### http (deprecated)
136
170
 
137
171
  HTTP client helpers using [httpx](https://www.python-httpx.org/).
@@ -176,6 +210,65 @@ async with niquests.AsyncSession() as session:
176
210
  cache.get_database("db-id") # Specific database (id, title, properties, cached_at)
177
211
  ```
178
212
 
213
+ ### gh
214
+
215
+ GitHub API helpers using [niquests](https://github.com/jawah/niquests).
216
+
217
+ ```bash
218
+ uv add tracktolib[gh]
219
+ ```
220
+
221
+ ```python
222
+ from tracktolib.gh import GitHubClient
223
+
224
+ async with GitHubClient() as gh: # Uses GITHUB_TOKEN env var
225
+ # Issue comments
226
+ comments = await gh.get_issue_comments("owner/repo", 123)
227
+ await gh.create_issue_comment("owner/repo", 123, "Hello!")
228
+ await gh.delete_comments_with_marker("owner/repo", 123, "<!-- bot -->")
229
+
230
+ # Labels
231
+ labels = await gh.get_issue_labels("owner/repo", 123)
232
+ await gh.add_labels("owner/repo", 123, ["bug", "priority"])
233
+ await gh.remove_label("owner/repo", 123, "wontfix")
234
+
235
+ # Deployments
236
+ deploys = await gh.get_deployments("owner/repo", environment="production")
237
+ await gh.mark_deployment_inactive("owner/repo", "preview-123")
238
+ ```
239
+
240
+ ### cf
241
+
242
+ Cloudflare DNS API helpers using [niquests](https://github.com/jawah/niquests).
243
+
244
+ ```bash
245
+ uv add tracktolib[cf]
246
+ ```
247
+
248
+ ```python
249
+ from tracktolib.cf import CloudflareDNSClient
250
+
251
+ async with CloudflareDNSClient() as cf: # Uses CLOUDFLARE_API_TOKEN and CLOUDFLARE_ZONE_ID env vars
252
+ # Get a DNS record
253
+ record = await cf.get_dns_record("app.example.com", "CNAME")
254
+
255
+ # Create a DNS record
256
+ record = await cf.create_dns_record(
257
+ "app.example.com",
258
+ "target.example.com",
259
+ record_type="CNAME",
260
+ ttl=60,
261
+ proxied=True,
262
+ )
263
+
264
+ # Delete by ID or name
265
+ await cf.delete_dns_record(record["id"])
266
+ await cf.delete_dns_record_by_name("app.example.com", "CNAME")
267
+
268
+ # Check existence
269
+ exists = await cf.dns_record_exists("app.example.com")
270
+ ```
271
+
179
272
  ### tests
180
273
 
181
274
  Testing utilities using [deepdiff](https://github.com/seperman/deepdiff).
@@ -0,0 +1,31 @@
1
+ tracktolib/__init__.py,sha256=Q9d6h2lNjcYzxvfJ3zlNcpiP_Ak0T3TBPWINzZNrhu0,173
2
+ tracktolib/api.py,sha256=B212xUA8mcx6qWSAipZjKZq-i6wrU_1ZlqwQ9wrKTSs,10356
3
+ tracktolib/cf/__init__.py,sha256=_lT0T0uP9RRfTHBRLH43o5wxpuq9gxtKxSyyCYQuDmQ,168
4
+ tracktolib/cf/client.py,sha256=dUGCnpaKmb9qLOkyAlvCVY74bExqp2BAPmZvRK7JGuw,4951
5
+ tracktolib/cf/types.py,sha256=axRTBT_YvAYWYUACFKkcjcKIx61bRvGKkOhkVbG-dJI,366
6
+ tracktolib/gh/__init__.py,sha256=Yi2hecsG3ldbmQlMMsPizrZnIpDVpWA7DbzpcU6iBrI,254
7
+ tracktolib/gh/client.py,sha256=KL6Ndg9HiSa30naXq_bBh65soNhLKKfOfFpb4zjGMO4,8185
8
+ tracktolib/gh/types.py,sha256=sDdHTbbml7rdFFrb0SmOIB2ldTqQT-l53949EP9MANc,4491
9
+ tracktolib/http_utils.py,sha256=wek9FrZ_2yJbp0cWui3URqa8Iw2QRmugWanQWjx3RqQ,2785
10
+ tracktolib/logs.py,sha256=W9v4fcVuct2Ky2j1qM7IuYmyhOMNE6M4uGTGxt6fJCA,2191
11
+ tracktolib/notion/__init__.py,sha256=I-RAhMOCLvSDHyuKPVvbWSMX01qGcP7abun0NlgQZhM,1006
12
+ tracktolib/notion/blocks.py,sha256=IL-C8_eaRcMW0TQ736VgRKD84WQqNepi3UJq2s1lmzQ,12210
13
+ tracktolib/notion/cache.py,sha256=szOLoXlrw0t_6Oaz0k9HWxN7GtvJKfFiJpyZatq-hnc,6432
14
+ tracktolib/notion/fetch.py,sha256=Jw1KNNXbYeXCf03PGt9v5HeC_l55Fzf-q9cVr7_zhbg,16765
15
+ tracktolib/notion/markdown.py,sha256=vju-8TTrI8Fc0WzffudO-4R4ziknlEBMMo5v2dK0_IY,14835
16
+ tracktolib/notion/models.py,sha256=qYvgYzQz5nKsTf3kcbGjJRleiops11Na9Ay3OKxhQ5c,6107
17
+ tracktolib/notion/utils.py,sha256=7WltrDOa5ZLo2UCM4zeXyGd4SMt3NGmq-aBY4-PWgug,18910
18
+ tracktolib/pg/__init__.py,sha256=fPb25hSnUpG-7yNHgOjFpLTjbeOLkmU2tjczR371cc0,366
19
+ tracktolib/pg/query.py,sha256=4uG9BiJf91OxQI1kfizdN4JV1Vm81tOaKlJ-yUjXs2g,19346
20
+ tracktolib/pg/utils.py,sha256=ijI_gFzFSohy-BSBIuAxpBTeoK5L5lu2_f19H3E2p40,6296
21
+ tracktolib/pg_sync.py,sha256=b3QkhukkB8Yq6rmvH3xhUepRs9Tf0cvXXLyOJGDz4mg,6760
22
+ tracktolib/pg_utils.py,sha256=DRe5M0l7axTOPxHjDvVDBE0UnRlmESr7gTq-IaLOETc,2534
23
+ tracktolib/s3/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
24
+ tracktolib/s3/minio.py,sha256=KJTNJbdmlZwhnMm40-Imc5M1MDY_A3_p-l6ltc_lHGc,1387
25
+ tracktolib/s3/niquests.py,sha256=Z7FRo_eOAKeKNg9UrnsMYXAiYcCKS-_rvkgyZnPS1x8,31995
26
+ tracktolib/s3/s3.py,sha256=zC72K209z0CIijTCtKtapQbOZqja-U1FCeuY8ipDRHQ,4922
27
+ tracktolib/tests.py,sha256=gKE--epQjgMZGXc5ydbl4zjOdmwztJS42UMV0p4hXEA,399
28
+ tracktolib/utils.py,sha256=k62RR8Qukse9Ci9ZYejLsmpFBbClTl4116-TH_EP2Gs,7520
29
+ tracktolib-0.69.0.dist-info/WHEEL,sha256=5DEXXimM34_d4Gx1AuF9ysMr1_maoEtGKjaILM3s4w4,80
30
+ tracktolib-0.69.0.dist-info/METADATA,sha256=nD-YW_COpZkQ6Nb04W8NXU9uzXLHQg0flvPU6DUOQdM,7396
31
+ tracktolib-0.69.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.26
2
+ Generator: uv 0.9.29
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,25 +0,0 @@
1
- tracktolib/__init__.py,sha256=Q9d6h2lNjcYzxvfJ3zlNcpiP_Ak0T3TBPWINzZNrhu0,173
2
- tracktolib/api.py,sha256=JVxrPcJFYbX_-dBKx_KQvZDdgos1LEtQoKks8lHqpe0,10366
3
- tracktolib/http_utils.py,sha256=_PJlvmKBwaJAGOWYnwU4LP_yV3oaMCk9nrI1u2iFBuk,2785
4
- tracktolib/logs.py,sha256=D2hx6urXl5l4PBGP8mCpcT4GX7tJeFfNY-7oBfHczBU,2191
5
- tracktolib/notion/__init__.py,sha256=I-RAhMOCLvSDHyuKPVvbWSMX01qGcP7abun0NlgQZhM,1006
6
- tracktolib/notion/blocks.py,sha256=IL-C8_eaRcMW0TQ736VgRKD84WQqNepi3UJq2s1lmzQ,12210
7
- tracktolib/notion/cache.py,sha256=szOLoXlrw0t_6Oaz0k9HWxN7GtvJKfFiJpyZatq-hnc,6432
8
- tracktolib/notion/fetch.py,sha256=Jw1KNNXbYeXCf03PGt9v5HeC_l55Fzf-q9cVr7_zhbg,16765
9
- tracktolib/notion/markdown.py,sha256=I8bOLFPLGkk5dzJb8BirpB4gaGhLkXiK5cZFmjsm5Fg,14835
10
- tracktolib/notion/models.py,sha256=J7my6pGYKQ-2vhvIxxlb5L9BSW4gkmSj_i7tljshfb4,6108
11
- tracktolib/notion/utils.py,sha256=sd0nVKAGLLp2cN38KfxsEMOaESfCl-iUYIFNTlStOjs,18910
12
- tracktolib/pg/__init__.py,sha256=Ul_hgwvTXZvQBt7sHKi4ZI-0DDpnXmoFtmVkGRy-1J0,366
13
- tracktolib/pg/query.py,sha256=Sarwvs8cSqiOQLUnpTOx2XsDClr0dKACPvQfTl_v8_Y,19346
14
- tracktolib/pg/utils.py,sha256=ygQn63EBDaEGB0p7P2ibellO2mv-StafanpXKcCUiZU,6324
15
- tracktolib/pg_sync.py,sha256=87nkaso0vRedHydhnBdC2LmFuxMe08oac0PuOyeatLo,6790
16
- tracktolib/pg_utils.py,sha256=ArYNdf9qsdYdzGEWmev8tZpyx8_1jaGGdkfYkauM7UM,2582
17
- tracktolib/s3/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
18
- tracktolib/s3/minio.py,sha256=wMEjkSes9Fp39fD17IctALpD6zB2xwDRQEmO7Vzan3g,1387
19
- tracktolib/s3/niquests.py,sha256=9j3RxM3EfIYV1wEH0OpvT_uhJ68sXN4PwxlDAH3eBEE,23453
20
- tracktolib/s3/s3.py,sha256=Vi3Q6DLBm44gz6fXx6uzdbGEtJly6KzdgLYHJwU6r-U,4922
21
- tracktolib/tests.py,sha256=gKE--epQjgMZGXc5ydbl4zjOdmwztJS42UMV0p4hXEA,399
22
- tracktolib/utils.py,sha256=Im-7vaCkDpq1vo5QpvG1zn8OoHfqDUFyq8UB_J-ZfB8,7480
23
- tracktolib-0.68.0.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
24
- tracktolib-0.68.0.dist-info/METADATA,sha256=R9IMfJZjBpCbZEOrRUucmxE4uezTLHE0OKHSo31ao2o,4719
25
- tracktolib-0.68.0.dist-info/RECORD,,