laketower 0.5.1__py3-none-any.whl → 0.6.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.

Potentially problematic release.


This version of laketower might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: laketower
3
- Version: 0.5.1
3
+ Version: 0.6.0
4
4
  Summary: Oversee your lakehouse
5
5
  Project-URL: Repository, https://github.com/datalpia/laketower
6
6
  Project-URL: Issues, https://github.com/datalpia/laketower/issues
@@ -30,6 +30,7 @@ Requires-Dist: pandas
30
30
  Requires-Dist: pyarrow!=19.0.0
31
31
  Requires-Dist: pydantic-settings>=2
32
32
  Requires-Dist: pydantic>=2
33
+ Requires-Dist: python-multipart
33
34
  Requires-Dist: pyyaml
34
35
  Requires-Dist: rich
35
36
  Requires-Dist: sqlglot
@@ -50,13 +51,16 @@ Utility application to explore and manage tables in your data lakehouse, especia
50
51
  ## Features
51
52
 
52
53
  - Delta Lake table format support
54
+ - Remote tables support (S3, ADLS)
53
55
  - Inspect table metadata
54
56
  - Inspect table schema
55
57
  - Inspect table history
56
58
  - Get table statistics
59
+ - Import data into a table from CSV files
57
60
  - View table content with a simple query builder
58
61
  - Query all registered tables with DuckDB SQL dialect
59
62
  - Execute saved queries
63
+ - Export query results to CSV files
60
64
  - Static and versionable YAML configuration
61
65
  - Web application
62
66
  - CLI application
@@ -99,7 +103,9 @@ queries:
99
103
 
100
104
  Current limitations:
101
105
 
102
- - `tables.uri`: only local paths are allowed
106
+ - `tables.uri`:
107
+ - Local paths are supported (`./path/to/table`, `/abs/path/to/table`, `file:///abs/path/to/table`)
108
+ - Remote paths to S3 (`s3://<bucket>/<path>`) and ADLS (`abfss://<container>/<path>`)
103
109
  - `tables.format`: only `delta` is allowed
104
110
 
105
111
  Example from the provided demo:
@@ -138,6 +144,103 @@ queries:
138
144
  day asc
139
145
  ```
140
146
 
147
+ Support for environment variables substitution is also supported within the YAML
148
+ configuration using a object containing a single key `env` with the name of the
149
+ environment variable to be injected. The value of the variable can contain JSON
150
+ and will be decoded in a best effort manner (default to string value). For instance:
151
+
152
+ ```yaml
153
+ # export TABLE_URI=path/to/table
154
+
155
+ tables:
156
+ - name: sample_table
157
+ uri:
158
+ env: TABLE_URI
159
+ format: delta
160
+ ```
161
+
162
+ #### Remote S3 Tables
163
+
164
+ Configuring S3 tables (AWS, MinIO, Cloudflare R2):
165
+
166
+ ```yaml
167
+ tables:
168
+ - name: delta_table_s3
169
+ uri: s3://<bucket>/path/to/table
170
+ format: delta
171
+ connection:
172
+ s3:
173
+ s3_access_key_id: access-key-id
174
+ s3_secret_access_key: secret-access-key
175
+ s3_region: s3-region
176
+ s3_endpoint_url: http://s3.domain.com
177
+ s3_allow_http: false
178
+ ```
179
+
180
+ Depending on your object storage location and configuration, one might have to
181
+ set part or all the available `connection.s3` parameters. The only required ones
182
+ are `s3_access_key_id` and `s3_secret_access_key`.
183
+
184
+ Also as a security best practice, it is best not to write secrets directly in
185
+ static configuration files, so one can use environment variables to all dynamic substitution,
186
+ e.g.
187
+
188
+ ```yaml
189
+ tables:
190
+ - name: delta_table_s3
191
+ uri: s3://<bucket>/path/to/table
192
+ format: delta
193
+ connection:
194
+ s3:
195
+ s3_access_key_id: access-key-id
196
+ s3_secret_access_key:
197
+ env: S3_SECRET_ACCESS_KEY
198
+ s3_region: s3-region
199
+ s3_endpoint_url: http://s3.domain.com
200
+ s3_allow_http: false
201
+ ```
202
+
203
+ #### Remote ADLS Tables
204
+
205
+ Configuring Azure ADLS tables:
206
+
207
+ ```yaml
208
+ tables:
209
+ - name: delta_table_adls
210
+ uri: abfss://<container>/path/to/table
211
+ format: delta
212
+ connection:
213
+ adls:
214
+ adls_account_name: adls-account-name
215
+ adls_access_key: adls-access-key
216
+ adls_sas_key: adls-sas-key
217
+ adls_tenant_id: adls-tenant-id
218
+ adls_client_id: adls-client-id
219
+ adls_client_secret: adls-client-secret
220
+ azure_msi_endpoint: https://msi.azure.com
221
+ use_azure_cli: false
222
+ ```
223
+
224
+ Depending on your object storage location and configuration, one might have to
225
+ set part or all the available `connection.adls` parameters. The only required one
226
+ is `adls_account_name`.
227
+
228
+ Also as a security best practice, it is best not to write secrets directly in
229
+ static configuration files, so one can use environment variables to all dynamic substitution,
230
+ e.g.
231
+
232
+ ```yaml
233
+ tables:
234
+ - name: delta_table_adls
235
+ uri: abfss://<container>/path/to/table
236
+ format: delta
237
+ connection:
238
+ adls:
239
+ adls_account_name: adls-account-name
240
+ adls_access_key:
241
+ env: ADLS_ACCESS_KEY
242
+ ```
243
+
141
244
  ### Web Application
142
245
 
143
246
  The easiest way to get started is to launch the Laketower web application:
@@ -152,6 +255,7 @@ $ laketower -c demo/laketower.yml web
152
255
  ![Laketower UI - Tables View](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_view.png)
153
256
  ![Laketower UI - Tables Statistics](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_statistics.png)
154
257
  ![Laketower UI - Tables History](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_history.png)
258
+ ![Laketower UI - Tables Import](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_import.png)
155
259
  ![Laketower UI - Tables Query](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_query.png)
156
260
  ![Laketower UI - Queries View](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/queries_view.png)
157
261
 
@@ -321,6 +425,29 @@ $ laketower -c demo/laketower.yml tables statistics --version 0 weather
321
425
  └──────────────────────┴───────┴──────┴──────┴──────┴──────┘
322
426
  ```
323
427
 
428
+ #### Import data into a given table
429
+
430
+ Import a CSV dataset into a table in append mode:
431
+
432
+ ```bash
433
+ $ laketower -c demo/laketower.yml tables import weather --file data.csv --mode append --format csv --delimiter ',' --encoding 'utf-8'
434
+ ```
435
+
436
+ `--mode` argument can be one of:
437
+ - `append`: append rows to the table (default)
438
+ - `overwrite`: replace all rows with the ones from the input file
439
+
440
+ `--format` argument can be one of:
441
+ - `csv`: CSV file format (default)
442
+
443
+ `--delimiter` argument can be:
444
+ - Any single character (only valid for CSV file format)
445
+ - Default is _comma_ (`','`)
446
+
447
+ `--encoding` argument can be:
448
+ - Any [standard Python encoding](https://docs.python.org/3/library/codecs.html#standard-encodings),
449
+ - Default is `'utf-8'`
450
+
324
451
  #### View a given table
325
452
 
326
453
  Using a simple query builder, the content of a table can be displayed.
@@ -400,6 +527,14 @@ $ laketower -c demo/laketower.yml tables query "select date_trunc('day', time) a
400
527
  └───────────────────────────┴────────────────────┘
401
528
  ```
402
529
 
530
+ Export query results to CSV:
531
+
532
+ ```bash
533
+ $ laketower -c demo/laketower.yml tables query --output results.csv "select date_trunc('day', time) as day, avg(temperature_2m) as mean_temperature from weather group by day order by day desc limit 3"
534
+
535
+ Query results written to: results.csv
536
+ ```
537
+
403
538
  #### List saved queries
404
539
 
405
540
  ```bash
@@ -0,0 +1,23 @@
1
+ laketower/__about__.py,sha256=cID1jLnC_vj48GgMN6Yb1FA3JsQ95zNmCHmRYE8TFhY,22
2
+ laketower/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ laketower/__main__.py,sha256=czKxJKG8OfncnxWmpaOWx7b1JBwFnZNQi7wKSTncB4M,108
4
+ laketower/cli.py,sha256=tvCr90q4jRVAoP2qzwhTLG7PUsae0QOGQwJRid3GVLc,15324
5
+ laketower/config.py,sha256=uIQSE1MjEuA-kp0TwA0QREwPbaNGL9hLGmKWqNaA8VY,3298
6
+ laketower/tables.py,sha256=gs4klWJkyyS7_oIDz1HKFicXAF6jbGfvzJWrDw8r-rQ,10235
7
+ laketower/web.py,sha256=-cXg_8pUCdhU5QF6WH_3luXi545F0Et9rpSC05J63Ng,10736
8
+ laketower/static/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ laketower/templates/_base.html,sha256=S-8kjAfYBx3Btb4FwzM2qyfkGYrOBHhpvCWR32mCvOw,3729
10
+ laketower/templates/index.html,sha256=dLF2Og0qgzBkvGyVRidRNzTv0u4o97ifOx1jVeig8Kg,59
11
+ laketower/templates/queries/view.html,sha256=naqU3XGyVVW6Er8wQ95-DYlp38Czolvh-h5noIAWs84,1978
12
+ laketower/templates/tables/_macros.html,sha256=sCI1TOFW0QA74oSXW87H6dNTudOs7n-FretnTPFcRh4,1174
13
+ laketower/templates/tables/history.html,sha256=a5GBLXCiLlbWno5eR0XT5i_oMAghylUBBFOpr27NB3Q,1853
14
+ laketower/templates/tables/import.html,sha256=bQZwRrv84tDBuf0AHJyc7L-PjW-XSoZhMHNDIo6TP4c,2604
15
+ laketower/templates/tables/index.html,sha256=saNdQbJAjMJAzayTk4rA5Mmw_bCXvor2WpghVmoWSAI,2507
16
+ laketower/templates/tables/query.html,sha256=ymWcqZj4TtJgUeCIMseJD0PIOqy0gf1SVzrQzN9UD5Q,1652
17
+ laketower/templates/tables/statistics.html,sha256=h6TiQtFwiRWvPqDphcRRF1rZ886FP00UbJuMHuW5l6U,1827
18
+ laketower/templates/tables/view.html,sha256=ruiAX_S--wpodmgEbcQ-GT7BQzz-vzSCk4NpzlO3I80,3985
19
+ laketower-0.6.0.dist-info/METADATA,sha256=HMP4sBtBKVgvO0Ay_KIJd6que4EKaICfXLXYA9TQ12o,25496
20
+ laketower-0.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
21
+ laketower-0.6.0.dist-info/entry_points.txt,sha256=sJpQgRwdeZhRBudNqBTqtHPCE-uLC9YgFXJY2CTEyCk,53
22
+ laketower-0.6.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
23
+ laketower-0.6.0.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ laketower = laketower.__main__:cli
@@ -1,22 +0,0 @@
1
- laketower/__about__.py,sha256=eZ1bOun1DDVV0YLOBW4wj2FP1ajReLjbIrGmzN7ASBw,22
2
- laketower/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- laketower/__main__.py,sha256=czKxJKG8OfncnxWmpaOWx7b1JBwFnZNQi7wKSTncB4M,108
4
- laketower/cli.py,sha256=U4gI12egcOs51wxjmQlU70XhA2QGcowc0AmTYpUKEFE,11962
5
- laketower/config.py,sha256=NdUDF7lr2hEW9Gujp0OpkOKcDP46ju1y_r0IM4Hrx2M,1100
6
- laketower/tables.py,sha256=Y-9kf6rwNbAVFgxzm6hAFlEMxGMqHyv7RiveDgMBNf4,4437
7
- laketower/web.py,sha256=5NMKj26aVz3cKnUAe-3sLDJ_4Ue3u0VXhATrDQ8GVF8,7205
8
- laketower/static/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- laketower/templates/_base.html,sha256=S-8kjAfYBx3Btb4FwzM2qyfkGYrOBHhpvCWR32mCvOw,3729
10
- laketower/templates/index.html,sha256=dLF2Og0qgzBkvGyVRidRNzTv0u4o97ifOx1jVeig8Kg,59
11
- laketower/templates/queries/view.html,sha256=2jW08X-PflXmsfy7u9ibX1BF8G5dx9X_n_Eoq3jzizA,1686
12
- laketower/templates/tables/_macros.html,sha256=fnj_8nBco0iS6mlBmGmfT2PZhI2Y82yP0cm8tRxchpU,965
13
- laketower/templates/tables/history.html,sha256=yAW0xw9_Uxp0QZYKje6qhcbpeznxI3fb740hfNyILZ8,1740
14
- laketower/templates/tables/index.html,sha256=oY13l_p8qozlLONanLpga1WhEo4oTP92pRf9sBSuFZI,2394
15
- laketower/templates/tables/query.html,sha256=YAFnW8Q5abDsbeglFHHZmJfGJXPjI2s4Nxf6gF_-Eg0,1360
16
- laketower/templates/tables/statistics.html,sha256=rgIOuF2PlHo2jvcYDAnxa5ObNortwyALlrURpM7qxMw,1714
17
- laketower/templates/tables/view.html,sha256=psfeRKkN19Q3Ko5Sm2570qRhehvuoEBPG89zFU5KQlc,3872
18
- laketower-0.5.1.dist-info/METADATA,sha256=OrkW0OD9bJ6JnIaPlyEmGJAU8pEWuJrCg9kJRVjwnCY,21353
19
- laketower-0.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
20
- laketower-0.5.1.dist-info/entry_points.txt,sha256=OL_4klopvyEzasJOFJ-sKu54lv24Jvomni32h1WVUjk,48
21
- laketower-0.5.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
- laketower-0.5.1.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- laketower = laketower:cli.cli