tracktolib 0.64.0__py3-none-any.whl → 0.65.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,11 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tracktolib
3
- Version: 0.64.0
3
+ Version: 0.65.0
4
4
  Summary: Utility library for python
5
5
  Keywords: utility
6
6
  Author-email: julien.brayere@tracktor.fr
7
7
  License-Expression: MIT
8
8
  Classifier: Operating System :: OS Independent
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
9
13
  Requires-Dist: fastapi>=0.103.2 ; extra == 'api'
10
14
  Requires-Dist: pydantic>=2 ; extra == 'api'
11
15
  Requires-Dist: httpx>=0.25.0 ; extra == 'http'
@@ -36,21 +40,25 @@ Description-Content-Type: text/markdown
36
40
  [![Latest PyPI version](https://img.shields.io/pypi/v/tracktolib?logo=pypi)](https://pypi.python.org/pypi/tracktolib)
37
41
  [![CircleCI](https://circleci.com/gh/Tracktor/tracktolib/tree/master.svg?style=shield)](https://app.circleci.com/pipelines/github/Tracktor/tracktolib?branch=master)
38
42
 
39
- Utility library for python
43
+ Utility library for Python 3.12+
40
44
 
41
- # Installation
45
+ ## Installation
42
46
 
43
- Just run:
47
+ ```bash
48
+ uv add tracktolib
49
+ ```
50
+
51
+ With specific extras:
44
52
 
45
53
  ```bash
46
- uv add tracktolib@latest
54
+ uv add tracktolib[pg,api]
47
55
  ```
48
56
 
49
- # Utilities
57
+ ## Modules
50
58
 
51
- - **log**
59
+ ### logs
52
60
 
53
- Utility functions for logging.
61
+ Utility functions to initialize logging formatting and streams.
54
62
 
55
63
  ```python
56
64
  import logging
@@ -60,56 +68,87 @@ logger = logging.getLogger()
60
68
  formatter, stream_handler = init_logging(logger, 'json', version='0.0.1')
61
69
  ```
62
70
 
63
- - **pg**
71
+ ### pg
64
72
 
65
- Utility functions for [asyncpg](https://github.com/MagicStack/asyncpg)
73
+ Async PostgreSQL helpers using [asyncpg](https://github.com/MagicStack/asyncpg).
66
74
 
67
- - **pg-sync**
75
+ ```bash
76
+ uv add tracktolib[pg]
77
+ ```
68
78
 
69
- Utility functions based on psycopg such as `fetch_one`, `insert_many`, `fetch_count` ...
79
+ ### pg-sync
70
80
 
71
- To use the functions, create a `Connection` using psycopg: `conn = psycopg2.connect()`
81
+ Sync PostgreSQL helpers using [psycopg](https://www.psycopg.org/psycopg3/) (v3).
72
82
 
73
- *fetch_one*
83
+ ```bash
84
+ uv add tracktolib[pg-sync]
85
+ ```
74
86
 
75
87
  ```python
76
- from tracktolib.pg.pg_sync import (
77
- insert_many, fetch_one, fetch_count, fetch_all
78
- )
88
+ from psycopg import connect
89
+ from tracktolib.pg_sync import insert_many, fetch_one, fetch_count, fetch_all
90
+
91
+ conn = connect('postgresql://user:pass@localhost/db')
79
92
 
80
93
  data = [
81
94
  {'foo': 'bar', 'value': 1},
82
95
  {'foo': 'baz', 'value': 2}
83
96
  ]
84
- insert_many(conn, 'public.test', data) # Will insert the 2 dict
97
+ insert_many(conn, 'public.test', data)
98
+
85
99
  query = 'SELECT foo from public.test order by value asc'
86
- value = fetch_one(conn, query, required=True) # Will return {'foo': 'bar'}, raise an error is not found
100
+ value = fetch_one(conn, query, required=True) # {'foo': 'bar'}, raises if not found
101
+
87
102
  assert fetch_count(conn, 'public.test') == 2
103
+
88
104
  query = 'SELECT * from public.test order by value asc'
89
105
  assert fetch_all(conn, query) == data
106
+ ```
107
+
108
+ ### s3
109
+
110
+ Async S3 helpers using [aiobotocore](https://github.com/aio-libs/aiobotocore).
90
111
 
112
+ ```bash
113
+ uv add tracktolib[s3]
91
114
  ```
92
115
 
93
- - **tests**
116
+ ### s3-minio
94
117
 
95
- Utility functions for testing
118
+ S3 helpers using [minio](https://min.io/docs/minio/linux/developers/python/API.html).
96
119
 
97
- - **s3-minio**
120
+ ```bash
121
+ uv add tracktolib[s3-minio]
122
+ ```
98
123
 
99
- Utility functions for [minio](https://min.io/docs/minio/linux/developers/python/API.html)
124
+ ### http
100
125
 
101
- - **s3**
126
+ HTTP client helpers using [httpx](https://www.python-httpx.org/).
102
127
 
103
- Utility functions for [aiobotocore](https://github.com/aio-libs/aiobotocore)
128
+ ```bash
129
+ uv add tracktolib[http]
130
+ ```
104
131
 
105
- - **logs**
132
+ ### api
106
133
 
107
- Utility functions to initialize the logging formatting and streams
134
+ FastAPI utilities using [fastapi](https://fastapi.tiangolo.com/) and [pydantic](https://docs.pydantic.dev/).
108
135
 
109
- - **http**
136
+ ```bash
137
+ uv add tracktolib[api]
138
+ ```
110
139
 
111
- Utility functions using [httpx](https://www.python-httpx.org/)
140
+ ### notion
112
141
 
113
- - **api**
142
+ Notion API helpers using [niquests](https://github.com/jawah/niquests).
114
143
 
115
- Utility functions using [fastapi](https://fastapi.tiangolo.com/)
144
+ ```bash
145
+ uv add tracktolib[notion]
146
+ ```
147
+
148
+ ### tests
149
+
150
+ Testing utilities using [deepdiff](https://github.com/seperman/deepdiff).
151
+
152
+ ```bash
153
+ uv add tracktolib[tests]
154
+ ```
@@ -15,6 +15,6 @@ tracktolib/s3/minio.py,sha256=wMEjkSes9Fp39fD17IctALpD6zB2xwDRQEmO7Vzan3g,1387
15
15
  tracktolib/s3/s3.py,sha256=0HbSAPoaup5-W4LK54zRCjrQ5mr8OWR-N9WjW99Q4aw,5937
16
16
  tracktolib/tests.py,sha256=gKE--epQjgMZGXc5ydbl4zjOdmwztJS42UMV0p4hXEA,399
17
17
  tracktolib/utils.py,sha256=ysTBF9V35fVXQVBPk0kfE_84SGRxzrayqmg9RbtoJq4,5761
18
- tracktolib-0.64.0.dist-info/WHEEL,sha256=z-mOpxbJHqy3cq6SvUThBZdaLGFZzdZPtgWLcP2NKjQ,79
19
- tracktolib-0.64.0.dist-info/METADATA,sha256=ypN7PUQQ45bxXO0jJDuvQjZE0_T2aHiLfFV_ekUY_4U,3128
20
- tracktolib-0.64.0.dist-info/RECORD,,
18
+ tracktolib-0.65.0.dist-info/WHEEL,sha256=z-mOpxbJHqy3cq6SvUThBZdaLGFZzdZPtgWLcP2NKjQ,79
19
+ tracktolib-0.65.0.dist-info/METADATA,sha256=4Pqiq-4w38C6n7eYaAikT-qo4D_3iie3ueSQsjXGI54,3719
20
+ tracktolib-0.65.0.dist-info/RECORD,,