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.
|
|
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
|
[](https://pypi.python.org/pypi/tracktolib)
|
|
37
41
|
[](https://app.circleci.com/pipelines/github/Tracktor/tracktolib?branch=master)
|
|
38
42
|
|
|
39
|
-
Utility library for
|
|
43
|
+
Utility library for Python 3.12+
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
## Installation
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
```bash
|
|
48
|
+
uv add tracktolib
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
With specific extras:
|
|
44
52
|
|
|
45
53
|
```bash
|
|
46
|
-
uv add tracktolib
|
|
54
|
+
uv add tracktolib[pg,api]
|
|
47
55
|
```
|
|
48
56
|
|
|
49
|
-
|
|
57
|
+
## Modules
|
|
50
58
|
|
|
51
|
-
|
|
59
|
+
### logs
|
|
52
60
|
|
|
53
|
-
Utility functions
|
|
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
|
-
|
|
71
|
+
### pg
|
|
64
72
|
|
|
65
|
-
|
|
73
|
+
Async PostgreSQL helpers using [asyncpg](https://github.com/MagicStack/asyncpg).
|
|
66
74
|
|
|
67
|
-
|
|
75
|
+
```bash
|
|
76
|
+
uv add tracktolib[pg]
|
|
77
|
+
```
|
|
68
78
|
|
|
69
|
-
|
|
79
|
+
### pg-sync
|
|
70
80
|
|
|
71
|
-
|
|
81
|
+
Sync PostgreSQL helpers using [psycopg](https://www.psycopg.org/psycopg3/) (v3).
|
|
72
82
|
|
|
73
|
-
|
|
83
|
+
```bash
|
|
84
|
+
uv add tracktolib[pg-sync]
|
|
85
|
+
```
|
|
74
86
|
|
|
75
87
|
```python
|
|
76
|
-
from
|
|
77
|
-
|
|
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)
|
|
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) #
|
|
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
|
-
-
|
|
116
|
+
### s3-minio
|
|
94
117
|
|
|
95
|
-
|
|
118
|
+
S3 helpers using [minio](https://min.io/docs/minio/linux/developers/python/API.html).
|
|
96
119
|
|
|
97
|
-
|
|
120
|
+
```bash
|
|
121
|
+
uv add tracktolib[s3-minio]
|
|
122
|
+
```
|
|
98
123
|
|
|
99
|
-
|
|
124
|
+
### http
|
|
100
125
|
|
|
101
|
-
-
|
|
126
|
+
HTTP client helpers using [httpx](https://www.python-httpx.org/).
|
|
102
127
|
|
|
103
|
-
|
|
128
|
+
```bash
|
|
129
|
+
uv add tracktolib[http]
|
|
130
|
+
```
|
|
104
131
|
|
|
105
|
-
|
|
132
|
+
### api
|
|
106
133
|
|
|
107
|
-
|
|
134
|
+
FastAPI utilities using [fastapi](https://fastapi.tiangolo.com/) and [pydantic](https://docs.pydantic.dev/).
|
|
108
135
|
|
|
109
|
-
|
|
136
|
+
```bash
|
|
137
|
+
uv add tracktolib[api]
|
|
138
|
+
```
|
|
110
139
|
|
|
111
|
-
|
|
140
|
+
### notion
|
|
112
141
|
|
|
113
|
-
|
|
142
|
+
Notion API helpers using [niquests](https://github.com/jawah/niquests).
|
|
114
143
|
|
|
115
|
-
|
|
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.
|
|
19
|
-
tracktolib-0.
|
|
20
|
-
tracktolib-0.
|
|
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,,
|
|
File without changes
|