laketower 0.5.1__py3-none-any.whl → 0.6.1__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.1
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
@@ -22,14 +22,17 @@ Classifier: Topic :: Database
22
22
  Classifier: Topic :: Software Development
23
23
  Classifier: Topic :: Utilities
24
24
  Requires-Python: <3.14,>=3.10
25
+ Requires-Dist: bleach
25
26
  Requires-Dist: deltalake<2,>=1
26
27
  Requires-Dist: duckdb
27
28
  Requires-Dist: fastapi
28
29
  Requires-Dist: jinja2!=3.1.5,>=3
30
+ Requires-Dist: markdown
29
31
  Requires-Dist: pandas
30
32
  Requires-Dist: pyarrow!=19.0.0
31
33
  Requires-Dist: pydantic-settings>=2
32
34
  Requires-Dist: pydantic>=2
35
+ Requires-Dist: python-multipart
33
36
  Requires-Dist: pyyaml
34
37
  Requires-Dist: rich
35
38
  Requires-Dist: sqlglot
@@ -50,13 +53,16 @@ Utility application to explore and manage tables in your data lakehouse, especia
50
53
  ## Features
51
54
 
52
55
  - Delta Lake table format support
56
+ - Remote tables support (S3, ADLS)
53
57
  - Inspect table metadata
54
58
  - Inspect table schema
55
59
  - Inspect table history
56
60
  - Get table statistics
61
+ - Import data into a table from CSV files
57
62
  - View table content with a simple query builder
58
63
  - Query all registered tables with DuckDB SQL dialect
59
64
  - Execute saved queries
65
+ - Export query results to CSV files
60
66
  - Static and versionable YAML configuration
61
67
  - Web application
62
68
  - CLI application
@@ -94,12 +100,18 @@ tables:
94
100
  queries:
95
101
  - name: <query_name>
96
102
  title: <Query name>
103
+ description: <Query description>
104
+ parameters:
105
+ <param_name_1>:
106
+ default: <default_value>
97
107
  sql: <sql expression>
98
108
  ```
99
109
 
100
110
  Current limitations:
101
111
 
102
- - `tables.uri`: only local paths are allowed
112
+ - `tables.uri`:
113
+ - Local paths are supported (`./path/to/table`, `/abs/path/to/table`, `file:///abs/path/to/table`)
114
+ - Remote paths to S3 (`s3://<bucket>/<path>`) and ADLS (`abfss://<container>/<path>`)
103
115
  - `tables.format`: only `delta` is allowed
104
116
 
105
117
  Example from the provided demo:
@@ -138,6 +150,103 @@ queries:
138
150
  day asc
139
151
  ```
140
152
 
153
+ Support for environment variables substitution is also supported within the YAML
154
+ configuration using a object containing a single key `env` with the name of the
155
+ environment variable to be injected. The value of the variable can contain JSON
156
+ and will be decoded in a best effort manner (default to string value). For instance:
157
+
158
+ ```yaml
159
+ # export TABLE_URI=path/to/table
160
+
161
+ tables:
162
+ - name: sample_table
163
+ uri:
164
+ env: TABLE_URI
165
+ format: delta
166
+ ```
167
+
168
+ #### Remote S3 Tables
169
+
170
+ Configuring S3 tables (AWS, MinIO, Cloudflare R2):
171
+
172
+ ```yaml
173
+ tables:
174
+ - name: delta_table_s3
175
+ uri: s3://<bucket>/path/to/table
176
+ format: delta
177
+ connection:
178
+ s3:
179
+ s3_access_key_id: access-key-id
180
+ s3_secret_access_key: secret-access-key
181
+ s3_region: s3-region
182
+ s3_endpoint_url: http://s3.domain.com
183
+ s3_allow_http: false
184
+ ```
185
+
186
+ Depending on your object storage location and configuration, one might have to
187
+ set part or all the available `connection.s3` parameters. The only required ones
188
+ are `s3_access_key_id` and `s3_secret_access_key`.
189
+
190
+ Also as a security best practice, it is best not to write secrets directly in
191
+ static configuration files, so one can use environment variables to all dynamic substitution,
192
+ e.g.
193
+
194
+ ```yaml
195
+ tables:
196
+ - name: delta_table_s3
197
+ uri: s3://<bucket>/path/to/table
198
+ format: delta
199
+ connection:
200
+ s3:
201
+ s3_access_key_id: access-key-id
202
+ s3_secret_access_key:
203
+ env: S3_SECRET_ACCESS_KEY
204
+ s3_region: s3-region
205
+ s3_endpoint_url: http://s3.domain.com
206
+ s3_allow_http: false
207
+ ```
208
+
209
+ #### Remote ADLS Tables
210
+
211
+ Configuring Azure ADLS tables:
212
+
213
+ ```yaml
214
+ tables:
215
+ - name: delta_table_adls
216
+ uri: abfss://<container>/path/to/table
217
+ format: delta
218
+ connection:
219
+ adls:
220
+ adls_account_name: adls-account-name
221
+ adls_access_key: adls-access-key
222
+ adls_sas_key: adls-sas-key
223
+ adls_tenant_id: adls-tenant-id
224
+ adls_client_id: adls-client-id
225
+ adls_client_secret: adls-client-secret
226
+ azure_msi_endpoint: https://msi.azure.com
227
+ use_azure_cli: false
228
+ ```
229
+
230
+ Depending on your object storage location and configuration, one might have to
231
+ set part or all the available `connection.adls` parameters. The only required one
232
+ is `adls_account_name`.
233
+
234
+ Also as a security best practice, it is best not to write secrets directly in
235
+ static configuration files, so one can use environment variables to all dynamic substitution,
236
+ e.g.
237
+
238
+ ```yaml
239
+ tables:
240
+ - name: delta_table_adls
241
+ uri: abfss://<container>/path/to/table
242
+ format: delta
243
+ connection:
244
+ adls:
245
+ adls_account_name: adls-account-name
246
+ adls_access_key:
247
+ env: ADLS_ACCESS_KEY
248
+ ```
249
+
141
250
  ### Web Application
142
251
 
143
252
  The easiest way to get started is to launch the Laketower web application:
@@ -152,6 +261,7 @@ $ laketower -c demo/laketower.yml web
152
261
  ![Laketower UI - Tables View](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_view.png)
153
262
  ![Laketower UI - Tables Statistics](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_statistics.png)
154
263
  ![Laketower UI - Tables History](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_history.png)
264
+ ![Laketower UI - Tables Import](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_import.png)
155
265
  ![Laketower UI - Tables Query](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/tables_query.png)
156
266
  ![Laketower UI - Queries View](https://raw.githubusercontent.com/datalpia/laketower/refs/heads/main/docs/static/queries_view.png)
157
267
 
@@ -321,6 +431,29 @@ $ laketower -c demo/laketower.yml tables statistics --version 0 weather
321
431
  └──────────────────────┴───────┴──────┴──────┴──────┴──────┘
322
432
  ```
323
433
 
434
+ #### Import data into a given table
435
+
436
+ Import a CSV dataset into a table in append mode:
437
+
438
+ ```bash
439
+ $ laketower -c demo/laketower.yml tables import weather --file data.csv --mode append --format csv --delimiter ',' --encoding 'utf-8'
440
+ ```
441
+
442
+ `--mode` argument can be one of:
443
+ - `append`: append rows to the table (default)
444
+ - `overwrite`: replace all rows with the ones from the input file
445
+
446
+ `--format` argument can be one of:
447
+ - `csv`: CSV file format (default)
448
+
449
+ `--delimiter` argument can be:
450
+ - Any single character (only valid for CSV file format)
451
+ - Default is _comma_ (`','`)
452
+
453
+ `--encoding` argument can be:
454
+ - Any [standard Python encoding](https://docs.python.org/3/library/codecs.html#standard-encodings),
455
+ - Default is `'utf-8'`
456
+
324
457
  #### View a given table
325
458
 
326
459
  Using a simple query builder, the content of a table can be displayed.
@@ -400,6 +533,28 @@ $ laketower -c demo/laketower.yml tables query "select date_trunc('day', time) a
400
533
  └───────────────────────────┴────────────────────┘
401
534
  ```
402
535
 
536
+ Use named parameters within a giving query (note: escape `$` prefixes properly!):
537
+
538
+ ```bash
539
+ $ laketower -c demo/laketower.yml tables query "select date_trunc('day', time) as day, avg(temperature_2m) as mean_temperature from weather where day between \$start_date and \$end_date group by day order by day desc" -p start_date 2025-01-29 -p end_date 2025-01-31
540
+
541
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓
542
+ ┃ day ┃ mean_temperature ┃
543
+ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩
544
+ │ 2025-01-31 00:00:00+01:00 │ 5.683333257834117 │
545
+ │ 2025-01-30 00:00:00+01:00 │ 8.900000015894571 │
546
+ │ 2025-01-29 00:00:00+01:00 │ 7.770833313465118 │
547
+ └───────────────────────────┴────────────────────┘
548
+ ```
549
+
550
+ Export query results to CSV:
551
+
552
+ ```bash
553
+ $ 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"
554
+
555
+ Query results written to: results.csv
556
+ ```
557
+
403
558
  #### List saved queries
404
559
 
405
560
  ```bash
@@ -439,6 +594,22 @@ $ laketower -c demo/laketower.yml queries view daily_avg_temperature
439
594
  └───────────────────────────┴─────────────────┘
440
595
  ```
441
596
 
597
+ Executing a predefined query with parameters (here `start_date` and `end_date`):
598
+
599
+ ```bash
600
+ $ laketower -c demo/laketower.yml queries view daily_avg_temperature_params -p start_date 2025-02-01 -p end_date 2025-02-05
601
+
602
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
603
+ ┃ day ┃ avg_temperature ┃
604
+ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
605
+ │ 2025-02-01 00:00:00+01:00 │ 4.0 │
606
+ │ 2025-02-02 00:00:00+01:00 │ 4.0 │
607
+ │ 2025-02-03 00:00:00+01:00 │ 4.0 │
608
+ │ 2025-02-04 00:00:00+01:00 │ 3.0 │
609
+ │ 2025-02-05 00:00:00+01:00 │ 3.0 │
610
+ └───────────────────────────┴─────────────────┘
611
+ ```
612
+
442
613
  ## License
443
614
 
444
615
  Licensed under [Apache License 2.0](LICENSE)
@@ -0,0 +1,31 @@
1
+ laketower/__about__.py,sha256=baAcEjLSYFIeNZF51tOMmA_zAMhN8HvKael-UU-Ruec,22
2
+ laketower/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ laketower/__main__.py,sha256=czKxJKG8OfncnxWmpaOWx7b1JBwFnZNQi7wKSTncB4M,108
4
+ laketower/cli.py,sha256=QmfgqpQQIL5pyrgmnCvLiNUNcAKW6a1vnS6qTUfYcBk,16554
5
+ laketower/config.py,sha256=flRp9yb4DK4xQUJu5g6Mr_gSMtTyJ4_jBAb-08ROvqQ,3453
6
+ laketower/tables.py,sha256=PbbwEmN_MHF6BCVM4t2vEpKQus58-UOaDMYIVqsKvy0,10733
7
+ laketower/web.py,sha256=B77Zu2aUO3sLlaHoSSO8x8iV-BoVh2l5_Yg9bxu5l6A,13407
8
+ laketower/static/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ laketower/static/editor.bundle.js,sha256=Wa1bS0xWwKDjHKPTdXd-PX41JAGkCjd0VLBCF-SyXWk,1159343
10
+ laketower/static/editor.js,sha256=C8saQJH68X7CtdRyBmvrQxsDJ013YWoMfWF-6hzf_5s,15870
11
+ laketower/static/vendor/bootstrap/bootstrap.bundle.min.js,sha256=5P1JGBOIxI7FBAvT_mb1fCnI5n_NhQKzNUuW7Hq0fMc,80496
12
+ laketower/static/vendor/bootstrap-icons/bootstrap-icons.min.css,sha256=pdY4ejLKO67E0CM2tbPtq1DJ3VGDVVdqAR6j3ZwdiE4,87008
13
+ laketower/static/vendor/bootstrap-icons/fonts/bootstrap-icons.woff,sha256=9VUTt7WRy4SjuH_w406iTUgx1v7cIuVLkRymS1tUShU,180288
14
+ laketower/static/vendor/bootstrap-icons/fonts/bootstrap-icons.woff2,sha256=bHVxA2ShylYEJncW9tKJl7JjGf2weM8R4LQqtm_y6mE,134044
15
+ laketower/static/vendor/halfmoon/halfmoon.min.css,sha256=RjeFzczeuZHCyS-Gvz-kleETzBF_o84ZRHukze_yv6o,369168
16
+ laketower/static/vendor/halfmoon/halfmoon.modern.css,sha256=DD6elX-jPmbFYPsGvzodUv2-9FHkxHlVtQi0_RJVULs,10576
17
+ laketower/templates/_base.html,sha256=2bVTAgdvZIop76oqzOGCkCf59KA14GBRWaIkEFcwZoI,3823
18
+ laketower/templates/index.html,sha256=dLF2Og0qgzBkvGyVRidRNzTv0u4o97ifOx1jVeig8Kg,59
19
+ laketower/templates/queries/view.html,sha256=pOx03hTR1MNycs9YfD8yFLR3VCLFStyd6CAwqdsJEEc,2551
20
+ laketower/templates/tables/_macros.html,sha256=sCI1TOFW0QA74oSXW87H6dNTudOs7n-FretnTPFcRh4,1174
21
+ laketower/templates/tables/history.html,sha256=a5GBLXCiLlbWno5eR0XT5i_oMAghylUBBFOpr27NB3Q,1853
22
+ laketower/templates/tables/import.html,sha256=bQZwRrv84tDBuf0AHJyc7L-PjW-XSoZhMHNDIo6TP4c,2604
23
+ laketower/templates/tables/index.html,sha256=saNdQbJAjMJAzayTk4rA5Mmw_bCXvor2WpghVmoWSAI,2507
24
+ laketower/templates/tables/query.html,sha256=GueaA2_JzqLWaopMGLoU8_axNZ1KtZKMt9Ku2ghHDCU,2602
25
+ laketower/templates/tables/statistics.html,sha256=h6TiQtFwiRWvPqDphcRRF1rZ886FP00UbJuMHuW5l6U,1827
26
+ laketower/templates/tables/view.html,sha256=ruiAX_S--wpodmgEbcQ-GT7BQzz-vzSCk4NpzlO3I80,3985
27
+ laketower-0.6.1.dist-info/METADATA,sha256=M4xxkXjq1zotCK6nFYcviaoAy2zefcqkPe4ZBYhYaIE,27664
28
+ laketower-0.6.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
+ laketower-0.6.1.dist-info/entry_points.txt,sha256=sJpQgRwdeZhRBudNqBTqtHPCE-uLC9YgFXJY2CTEyCk,53
30
+ laketower-0.6.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
31
+ laketower-0.6.1.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