cloudcat 0.1.3__tar.gz → 0.2.0__tar.gz

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.
Files changed (49) hide show
  1. cloudcat-0.2.0/PKG-INFO +669 -0
  2. cloudcat-0.2.0/README.md +592 -0
  3. {cloudcat-0.1.3 → cloudcat-0.2.0}/cloudcat/__init__.py +1 -1
  4. cloudcat-0.2.0/cloudcat/cli.py +770 -0
  5. cloudcat-0.2.0/cloudcat/compression.py +114 -0
  6. cloudcat-0.2.0/cloudcat/config.py +54 -0
  7. cloudcat-0.2.0/cloudcat/filtering.py +120 -0
  8. cloudcat-0.2.0/cloudcat/formatters.py +93 -0
  9. cloudcat-0.2.0/cloudcat/readers/__init__.py +20 -0
  10. cloudcat-0.2.0/cloudcat/readers/avro.py +77 -0
  11. cloudcat-0.2.0/cloudcat/readers/csv.py +53 -0
  12. cloudcat-0.2.0/cloudcat/readers/json.py +102 -0
  13. cloudcat-0.2.0/cloudcat/readers/orc.py +86 -0
  14. cloudcat-0.2.0/cloudcat/readers/parquet.py +115 -0
  15. cloudcat-0.2.0/cloudcat/readers/text.py +57 -0
  16. cloudcat-0.2.0/cloudcat/storage/__init__.py +24 -0
  17. cloudcat-0.2.0/cloudcat/storage/azure.py +109 -0
  18. cloudcat-0.2.0/cloudcat/storage/base.py +91 -0
  19. cloudcat-0.2.0/cloudcat/storage/gcs.py +92 -0
  20. cloudcat-0.2.0/cloudcat/storage/s3.py +88 -0
  21. cloudcat-0.2.0/cloudcat.egg-info/PKG-INFO +669 -0
  22. cloudcat-0.2.0/cloudcat.egg-info/SOURCES.txt +40 -0
  23. cloudcat-0.2.0/cloudcat.egg-info/requires.txt +38 -0
  24. {cloudcat-0.1.3 → cloudcat-0.2.0}/cloudcat.egg-info/top_level.txt +1 -0
  25. cloudcat-0.2.0/setup.py +95 -0
  26. cloudcat-0.2.0/tests/__init__.py +0 -0
  27. cloudcat-0.2.0/tests/conftest.py +45 -0
  28. cloudcat-0.2.0/tests/test_cli.py +255 -0
  29. cloudcat-0.2.0/tests/test_compression.py +163 -0
  30. cloudcat-0.2.0/tests/test_config.py +111 -0
  31. cloudcat-0.2.0/tests/test_data_reading.py +133 -0
  32. cloudcat-0.2.0/tests/test_file_filtering.py +145 -0
  33. cloudcat-0.2.0/tests/test_filtering.py +240 -0
  34. cloudcat-0.2.0/tests/test_format_detection.py +65 -0
  35. cloudcat-0.2.0/tests/test_integration.py +158 -0
  36. cloudcat-0.2.0/tests/test_output_formatting.py +104 -0
  37. cloudcat-0.2.0/tests/test_path_parsing.py +48 -0
  38. cloudcat-0.1.3/PKG-INFO +0 -60
  39. cloudcat-0.1.3/README.md +0 -136
  40. cloudcat-0.1.3/cloudcat/cli.py +0 -757
  41. cloudcat-0.1.3/cloudcat.egg-info/PKG-INFO +0 -60
  42. cloudcat-0.1.3/cloudcat.egg-info/SOURCES.txt +0 -12
  43. cloudcat-0.1.3/cloudcat.egg-info/requires.txt +0 -18
  44. cloudcat-0.1.3/setup.py +0 -60
  45. {cloudcat-0.1.3 → cloudcat-0.2.0}/LICENSE +0 -0
  46. {cloudcat-0.1.3 → cloudcat-0.2.0}/cloudcat.egg-info/dependency_links.txt +0 -0
  47. {cloudcat-0.1.3 → cloudcat-0.2.0}/cloudcat.egg-info/entry_points.txt +0 -0
  48. {cloudcat-0.1.3 → cloudcat-0.2.0}/pyproject.toml +0 -0
  49. {cloudcat-0.1.3 → cloudcat-0.2.0}/setup.cfg +0 -0
@@ -0,0 +1,669 @@
1
+ Metadata-Version: 2.4
2
+ Name: cloudcat
3
+ Version: 0.2.0
4
+ Summary: Preview and analyze data files in Google Cloud Storage, AWS S3, and Azure Blob Storage from your terminal
5
+ Home-page: https://github.com/jonathansudhakar1/cloudcat
6
+ Author: Jonathan Sudhakar
7
+ Author-email: jonathan@example.com
8
+ Project-URL: Bug Reports, https://github.com/jonathansudhakar1/cloudcat/issues
9
+ Project-URL: Source, https://github.com/jonathansudhakar1/cloudcat
10
+ Project-URL: Documentation, https://github.com/jonathansudhakar1/cloudcat#readme
11
+ Keywords: cloud,gcs,s3,azure,cli,storage,data,parquet,csv,json,avro,orc,google-cloud,aws,azure-blob,data-engineering,etl,spark,bigquery,databricks,kafka,hive
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: System Administrators
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Topic :: Utilities
17
+ Classifier: Topic :: Database
18
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
19
+ Classifier: Topic :: System :: Systems Administration
20
+ Classifier: Environment :: Console
21
+ Classifier: License :: OSI Approved :: MIT License
22
+ Classifier: Operating System :: OS Independent
23
+ Classifier: Programming Language :: Python :: 3
24
+ Classifier: Programming Language :: Python :: 3.7
25
+ Classifier: Programming Language :: Python :: 3.8
26
+ Classifier: Programming Language :: Python :: 3.9
27
+ Classifier: Programming Language :: Python :: 3.10
28
+ Classifier: Programming Language :: Python :: 3.11
29
+ Classifier: Programming Language :: Python :: 3.12
30
+ Classifier: Programming Language :: Python :: 3.13
31
+ Requires-Python: >=3.7
32
+ Description-Content-Type: text/markdown
33
+ License-File: LICENSE
34
+ Requires-Dist: click>=8.0.0
35
+ Requires-Dist: pandas>=1.3.0
36
+ Requires-Dist: tabulate>=0.8.9
37
+ Requires-Dist: colorama>=0.4.4
38
+ Requires-Dist: google-cloud-storage>=2.0.0
39
+ Requires-Dist: boto3>=1.18.0
40
+ Requires-Dist: azure-storage-blob>=12.0.0
41
+ Requires-Dist: azure-identity>=1.0.0
42
+ Provides-Extra: parquet
43
+ Requires-Dist: pyarrow>=5.0.0; extra == "parquet"
44
+ Provides-Extra: avro
45
+ Requires-Dist: fastavro>=1.4.0; extra == "avro"
46
+ Provides-Extra: orc
47
+ Requires-Dist: pyarrow>=5.0.0; extra == "orc"
48
+ Provides-Extra: zstd
49
+ Requires-Dist: zstandard>=0.15.0; extra == "zstd"
50
+ Provides-Extra: lz4
51
+ Requires-Dist: lz4>=3.0.0; extra == "lz4"
52
+ Provides-Extra: snappy
53
+ Requires-Dist: python-snappy>=0.6.0; extra == "snappy"
54
+ Provides-Extra: compression
55
+ Requires-Dist: zstandard>=0.15.0; extra == "compression"
56
+ Requires-Dist: lz4>=3.0.0; extra == "compression"
57
+ Requires-Dist: python-snappy>=0.6.0; extra == "compression"
58
+ Provides-Extra: all
59
+ Requires-Dist: pyarrow>=5.0.0; extra == "all"
60
+ Requires-Dist: fastavro>=1.4.0; extra == "all"
61
+ Requires-Dist: zstandard>=0.15.0; extra == "all"
62
+ Requires-Dist: lz4>=3.0.0; extra == "all"
63
+ Requires-Dist: python-snappy>=0.6.0; extra == "all"
64
+ Dynamic: author
65
+ Dynamic: author-email
66
+ Dynamic: classifier
67
+ Dynamic: description
68
+ Dynamic: description-content-type
69
+ Dynamic: home-page
70
+ Dynamic: keywords
71
+ Dynamic: license-file
72
+ Dynamic: project-url
73
+ Dynamic: provides-extra
74
+ Dynamic: requires-dist
75
+ Dynamic: requires-python
76
+ Dynamic: summary
77
+
78
+ <p align="center">
79
+ <img src="https://raw.githubusercontent.com/jonathansudhakar1/cloudcat/main/assets/logo.png" alt="CloudCat Logo" width="200">
80
+ </p>
81
+
82
+ <h1 align="center">CloudCat</h1>
83
+
84
+ <p align="center">
85
+ <strong>The Swiss Army knife for viewing cloud storage data from your terminal</strong>
86
+ </p>
87
+
88
+ <p align="center">
89
+ <a href="https://pypi.org/project/cloudcat/"><img src="https://img.shields.io/pypi/v/cloudcat.svg?style=flat-square&logo=pypi&logoColor=white" alt="PyPI version"></a>
90
+ <a href="https://pypi.org/project/cloudcat/"><img src="https://img.shields.io/pypi/pyversions/cloudcat.svg?style=flat-square&logo=python&logoColor=white" alt="Python versions"></a>
91
+ <a href="https://pypi.org/project/cloudcat/"><img src="https://img.shields.io/pypi/dm/cloudcat.svg?style=flat-square&logo=pypi&logoColor=white" alt="Downloads"></a>
92
+ <a href="https://github.com/jonathansudhakar1/cloudcat/blob/main/LICENSE"><img src="https://img.shields.io/github/license/jonathansudhakar1/cloudcat.svg?style=flat-square" alt="License"></a>
93
+ </p>
94
+
95
+ <p align="center">
96
+ <a href="#installation">Installation</a> •
97
+ <a href="#quick-start">Quick Start</a> •
98
+ <a href="#features">Features</a> •
99
+ <a href="#examples">Examples</a> •
100
+ <a href="#documentation">Documentation</a>
101
+ </p>
102
+
103
+ ---
104
+
105
+ **CloudCat** is a powerful command-line tool that lets you instantly preview and analyze data files stored in **Google Cloud Storage (GCS)**, **Amazon S3**, and **Azure Blob Storage** — without downloading entire files. Think of it as `cat`, `head`, and `less` combined, but for cloud storage with built-in support for CSV, JSON, Parquet, Avro, ORC, and plain text formats.
106
+
107
+ ## Why CloudCat?
108
+
109
+ - **No Downloads Required** — Stream and preview data directly from cloud storage
110
+ - **Format-Aware** — Intelligently handles CSV, JSON, Parquet, Avro, ORC, and plain text files
111
+ - **Directory Smart** — Automatically discovers data files in Spark/Hive/Kafka output directories
112
+ - **Beautiful Output** — Colorized tables, pretty-printed JSON, and schema visualization
113
+ - **Developer Friendly** — Simple CLI with sensible defaults and powerful options
114
+ - **Compression Support** — Automatic decompression of gzip, zstd, lz4, snappy, and bz2 files
115
+ - **SQL-like Filtering** — Filter rows with WHERE clauses (e.g., `--where "status=active"`)
116
+
117
+ ## Installation
118
+
119
+ ```bash
120
+ # Standard installation (includes GCS, S3, and Azure support)
121
+ pip install cloudcat
122
+
123
+ # With Parquet file support
124
+ pip install cloudcat[parquet]
125
+
126
+ # With Avro file support
127
+ pip install cloudcat[avro]
128
+
129
+ # With ORC file support (uses pyarrow)
130
+ pip install cloudcat[orc]
131
+
132
+ # With compression support (zstd, lz4, snappy)
133
+ pip install cloudcat[compression]
134
+
135
+ # Full installation with all formats and compression
136
+ pip install cloudcat[all]
137
+ ```
138
+
139
+ ### Requirements
140
+
141
+ - Python 3.7+
142
+ - Cloud provider credentials configured (see [Authentication](#authentication))
143
+
144
+ ## Quick Start
145
+
146
+ ```bash
147
+ # Preview a CSV file from GCS
148
+ cloudcat -p gcs://my-bucket/data.csv
149
+
150
+ # Preview a Parquet file from S3
151
+ cloudcat -p s3://my-bucket/analytics/events.parquet
152
+
153
+ # Preview JSON data from Azure with pretty formatting
154
+ cloudcat -p az://my-container/logs.json -o jsonp
155
+
156
+ # Read Avro files from Kafka
157
+ cloudcat -p s3://my-bucket/kafka-export.avro
158
+
159
+ # Read ORC files from Hive
160
+ cloudcat -p gcs://my-bucket/hive-table.orc
161
+
162
+ # Read log files as plain text
163
+ cloudcat -p az://logs/app.log -i text
164
+
165
+ # Read from a Spark output directory
166
+ cloudcat -p s3://my-bucket/spark-output/ -i parquet
167
+
168
+ # Read compressed files (auto-detected)
169
+ cloudcat -p gcs://my-bucket/data.csv.gz
170
+
171
+ # Filter rows with WHERE clause
172
+ cloudcat -p s3://bucket/users.parquet --where "status=active"
173
+
174
+ # Skip first 100 rows (pagination)
175
+ cloudcat -p gcs://bucket/data.csv --offset 100 -n 10
176
+ ```
177
+
178
+ ## Features
179
+
180
+ ### Cloud Storage Support
181
+
182
+ | Provider | URL Scheme | Status |
183
+ |----------|------------|--------|
184
+ | Google Cloud Storage | `gcs://` or `gs://` | ✅ Supported |
185
+ | Amazon S3 | `s3://` | ✅ Supported |
186
+ | Azure Blob Storage | `az://` or `azure://` | ✅ Supported |
187
+
188
+ ### File Format Support
189
+
190
+ | Format | Read | Auto-Detect | Streaming | Use Case |
191
+ |--------|------|-------------|-----------|----------|
192
+ | CSV | ✅ | ✅ | ✅ | General data files |
193
+ | JSON | ✅ | ✅ | ✅ | API responses, configs |
194
+ | JSON Lines | ✅ | ✅ | ✅ | Log files, streaming data |
195
+ | Parquet | ✅ | ✅ | ✅ | Spark/analytics data |
196
+ | Avro | ✅ | ✅ | ✅ | Kafka, data pipelines |
197
+ | ORC | ✅ | ✅ | ✅ | Hive, Hadoop ecosystem |
198
+ | Text | ✅ | ✅ | ✅ | Log files, plain text |
199
+ | TSV | ✅ | Via `--delimiter` | ✅ | Tab-separated data |
200
+
201
+ ### Compression Support
202
+
203
+ | Format | Extension | Built-in | Use Case |
204
+ |--------|-----------|----------|----------|
205
+ | Gzip | `.gz`, `.gzip` | ✅ | Most common, universal |
206
+ | Bzip2 | `.bz2` | ✅ | High compression ratio |
207
+ | Zstandard | `.zst`, `.zstd` | Optional | Fast, modern compression |
208
+ | LZ4 | `.lz4` | Optional | Very fast decompression |
209
+ | Snappy | `.snappy` | Optional | Hadoop ecosystem |
210
+
211
+ CloudCat automatically detects and decompresses files based on extension (e.g., `data.csv.gz`, `logs.json.zst`).
212
+
213
+ ### Output Formats
214
+
215
+ | Format | Flag | Description |
216
+ |--------|------|-------------|
217
+ | Table | `-o table` | Beautiful ASCII table with colored headers (default) |
218
+ | JSON | `-o json` | Standard JSON Lines output |
219
+ | Pretty JSON | `-o jsonp` | Syntax-highlighted, indented JSON |
220
+ | CSV | `-o csv` | Comma-separated values |
221
+
222
+ ### Key Capabilities
223
+
224
+ - **Schema Inspection** — View column names and data types
225
+ - **Column Selection** — Display only the columns you need
226
+ - **Row Limiting** — Control how many rows to preview
227
+ - **Row Offset** — Skip first N rows for pagination/sampling
228
+ - **WHERE Filtering** — Filter rows with SQL-like conditions
229
+ - **Record Counting** — Get total record counts (with Parquet metadata optimization)
230
+ - **Multi-File Reading** — Combine data from multiple files in a directory
231
+ - **Custom Delimiters** — Support for tab, pipe, semicolon, and other delimiters
232
+ - **Auto Decompression** — Transparent handling of compressed files
233
+
234
+ ## Examples
235
+
236
+ ### Basic Usage
237
+
238
+ ```bash
239
+ # Preview first 10 rows (default)
240
+ cloudcat -p gcs://bucket/data.csv
241
+
242
+ # Preview 50 rows
243
+ cloudcat -p s3://bucket/data.parquet -n 50
244
+
245
+ # Show only specific columns
246
+ cloudcat -p gcs://bucket/users.json -c id,name,email
247
+
248
+ # View schema only (no data)
249
+ cloudcat -p s3://bucket/events.parquet -s schema_only
250
+ ```
251
+
252
+ ### Working with Different Formats
253
+
254
+ ```bash
255
+ # CSV with custom delimiter (tab-separated)
256
+ cloudcat -p gcs://bucket/data.tsv -d "\t"
257
+
258
+ # Pipe-delimited file
259
+ cloudcat -p s3://bucket/export.txt -d "|"
260
+
261
+ # Semicolon-delimited (common in European data)
262
+ cloudcat -p gcs://bucket/report.csv -d ";"
263
+
264
+ # JSON array file
265
+ cloudcat -p s3://bucket/config.json
266
+
267
+ # JSON Lines file (auto-detected)
268
+ cloudcat -p gcs://bucket/events.jsonl
269
+ ```
270
+
271
+ ### Filtering and Pagination
272
+
273
+ ```bash
274
+ # Filter rows with WHERE clause
275
+ cloudcat -p s3://bucket/users.parquet --where "status=active"
276
+ cloudcat -p gcs://bucket/events.json --where "age>30"
277
+ cloudcat -p s3://bucket/logs.csv --where "level=ERROR"
278
+
279
+ # String matching filters
280
+ cloudcat -p gcs://bucket/data.csv --where "name contains john"
281
+ cloudcat -p s3://bucket/emails.json --where "email endswith @gmail.com"
282
+ cloudcat -p az://logs/app.log --where "message startswith ERROR"
283
+
284
+ # Skip first N rows (pagination)
285
+ cloudcat -p gcs://bucket/data.csv --offset 100 -n 10
286
+
287
+ # Combine offset with filters
288
+ cloudcat -p s3://bucket/users.parquet --where "active=true" --offset 50 -n 20
289
+ ```
290
+
291
+ ### Compressed Files
292
+
293
+ ```bash
294
+ # Gzip compressed (built-in)
295
+ cloudcat -p gcs://bucket/data.csv.gz
296
+ cloudcat -p s3://bucket/logs.json.gz
297
+
298
+ # Zstandard compressed (requires: pip install cloudcat[zstd])
299
+ cloudcat -p gcs://bucket/events.parquet.zst
300
+
301
+ # LZ4 compressed (requires: pip install cloudcat[lz4])
302
+ cloudcat -p s3://bucket/data.csv.lz4
303
+
304
+ # Bzip2 compressed (built-in)
305
+ cloudcat -p az://container/archive.json.bz2
306
+ ```
307
+
308
+ ### Directory Operations
309
+
310
+ CloudCat intelligently handles directories containing multiple data files (common with Spark, Hive, and distributed processing outputs):
311
+
312
+ ```bash
313
+ # Auto-detect and read first data file in directory
314
+ cloudcat -p gcs://bucket/spark-output/
315
+
316
+ # Read and combine multiple files (up to 25MB by default)
317
+ cloudcat -p s3://bucket/daily-logs/ -m all
318
+
319
+ # Read up to 100MB of data from multiple files
320
+ cloudcat -p gcs://bucket/events/ -m all --max-size-mb 100
321
+
322
+ # Force reading only the first file
323
+ cloudcat -p s3://bucket/output/ -m first
324
+ ```
325
+
326
+ **CloudCat automatically:**
327
+ - Skips empty files
328
+ - Ignores metadata files (`_SUCCESS`, `_metadata`, `.crc`, etc.)
329
+ - Prioritizes files matching the specified format
330
+ - Reports which files were selected
331
+
332
+ ### Output Format Examples
333
+
334
+ ```bash
335
+ # Default table output (great for terminals)
336
+ cloudcat -p gcs://bucket/data.csv
337
+ # ┌────┬────────────┬─────────┐
338
+ # │ id │ name │ value │
339
+ # ├────┼────────────┼─────────┤
340
+ # │ 1 │ Alice │ 100 │
341
+ # │ 2 │ Bob │ 200 │
342
+ # └────┴────────────┴─────────┘
343
+
344
+ # Pretty JSON (great for nested data)
345
+ cloudcat -p s3://bucket/events.json -o jsonp
346
+ # {
347
+ # "id": 1,
348
+ # "name": "Alice",
349
+ # "metadata": {
350
+ # "created": "2024-01-15"
351
+ # }
352
+ # }
353
+
354
+ # JSON Lines (great for piping to jq)
355
+ cloudcat -p gcs://bucket/data.parquet -o json | jq '.name'
356
+
357
+ # CSV (great for further processing)
358
+ cloudcat -p s3://bucket/data.json -o csv > output.csv
359
+ ```
360
+
361
+ ### Data Pipeline Examples
362
+
363
+ ```bash
364
+ # Convert Parquet to CSV
365
+ cloudcat -p gcs://bucket/data.parquet -o csv -n 0 > data.csv
366
+
367
+ # Preview and filter with jq
368
+ cloudcat -p s3://bucket/events.json -o json | jq 'select(.status == "error")'
369
+
370
+ # Quick data validation
371
+ cloudcat -p gcs://bucket/import.csv -s schema_only
372
+
373
+ # Sample data from large dataset
374
+ cloudcat -p s3://bucket/big-table.parquet -n 100 -c user_id,event_type
375
+
376
+ # Export specific columns to CSV
377
+ cloudcat -p gcs://bucket/users.parquet -c email,created_at -o csv -n 0 > emails.csv
378
+ ```
379
+
380
+ ### Real-World Use Cases
381
+
382
+ #### Debugging Spark Jobs
383
+ ```bash
384
+ # Check output of a Spark job
385
+ cloudcat -p gcs://data-lake/jobs/daily-etl/output/ -i parquet -n 20
386
+
387
+ # Verify schema matches expectations
388
+ cloudcat -p s3://analytics/spark-output/ -s schema_only
389
+ ```
390
+
391
+ #### Log Analysis
392
+ ```bash
393
+ # Preview recent logs
394
+ cloudcat -p gcs://logs/app/2024-01-15/ -m all -n 50
395
+
396
+ # Check error logs (combine with grep)
397
+ cloudcat -p s3://logs/errors/ -o json | grep "ERROR"
398
+ ```
399
+
400
+ #### Data Validation
401
+ ```bash
402
+ # Quick sanity check on data export
403
+ cloudcat -p gcs://exports/daily/users.csv -s show
404
+
405
+ # Verify record count
406
+ cloudcat -p s3://warehouse/transactions.parquet --no-count
407
+ ```
408
+
409
+ #### Format Conversion
410
+ ```bash
411
+ # Convert tab-separated to comma-separated
412
+ cloudcat -p gcs://imports/data.tsv -d "\t" -o csv > converted.csv
413
+
414
+ # Convert JSON to CSV for spreadsheet import
415
+ cloudcat -p s3://api-dumps/response.json -o csv > data.csv
416
+ ```
417
+
418
+ ## Command Reference
419
+
420
+ ```
421
+ Usage: cloudcat [OPTIONS]
422
+
423
+ Options:
424
+ -p, --path TEXT Cloud storage path (required)
425
+ Format: gcs://bucket/path, s3://bucket/path,
426
+ or az://container/path
427
+
428
+ -o, --output-format TEXT Output format: table, json, jsonp, csv
429
+ [default: table]
430
+
431
+ -i, --input-format TEXT Input format: csv, json, parquet, avro, orc, text
432
+ [default: auto-detect from extension]
433
+
434
+ -c, --columns TEXT Comma-separated list of columns to display
435
+ [default: all columns]
436
+
437
+ -n, --num-rows INTEGER Number of rows to display (0 for all)
438
+ [default: 10]
439
+
440
+ --offset INTEGER Skip first N rows
441
+ [default: 0]
442
+
443
+ -w, --where TEXT Filter rows with SQL-like conditions
444
+ Examples: "status=active", "age>30",
445
+ "name contains john", "email endswith @gmail.com"
446
+
447
+ -s, --schema TEXT Schema display: show, dont_show, schema_only
448
+ [default: show]
449
+
450
+ --no-count Disable automatic record counting
451
+
452
+ -m, --multi-file-mode TEXT Directory handling: auto, first, all
453
+ [default: auto]
454
+
455
+ --max-size-mb INTEGER Max data size for multi-file mode in MB
456
+ [default: 25]
457
+
458
+ -d, --delimiter TEXT CSV delimiter (use \t for tab)
459
+ [default: comma]
460
+
461
+ --profile TEXT AWS profile name (for S3 access)
462
+
463
+ --project TEXT GCP project ID (for GCS access)
464
+
465
+ --credentials TEXT Path to GCP service account JSON file
466
+
467
+ --account TEXT Azure storage account name
468
+
469
+ --help Show this message and exit
470
+ ```
471
+
472
+ ### WHERE Clause Operators
473
+
474
+ | Operator | Example | Description |
475
+ |----------|---------|-------------|
476
+ | `=` | `status=active` | Exact match |
477
+ | `!=` | `type!=deleted` | Not equal |
478
+ | `>` | `age>30` | Greater than |
479
+ | `<` | `price<100` | Less than |
480
+ | `>=` | `count>=10` | Greater than or equal |
481
+ | `<=` | `score<=50` | Less than or equal |
482
+ | `contains` | `name contains john` | Case-insensitive substring match |
483
+ | `startswith` | `email startswith admin` | String prefix match |
484
+ | `endswith` | `file endswith .csv` | String suffix match |
485
+
486
+ ## Authentication
487
+
488
+ ### Google Cloud Storage
489
+
490
+ CloudCat uses [Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). Set up authentication using one of these methods:
491
+
492
+ ```bash
493
+ # Option 1: User credentials (for development)
494
+ gcloud auth application-default login
495
+
496
+ # Option 2: Service account via environment variable
497
+ export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
498
+
499
+ # Option 3: Service account via CLI option
500
+ cloudcat -p gcs://bucket/data.csv --credentials /path/to/service-account.json
501
+
502
+ # Option 4: Specify GCP project
503
+ cloudcat -p gcs://bucket/data.csv --project my-gcp-project
504
+ ```
505
+
506
+ ### Amazon S3
507
+
508
+ CloudCat uses the standard [AWS credential chain](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html):
509
+
510
+ ```bash
511
+ # Option 1: Environment variables
512
+ export AWS_ACCESS_KEY_ID="your-access-key"
513
+ export AWS_SECRET_ACCESS_KEY="your-secret-key"
514
+ export AWS_DEFAULT_REGION="us-east-1"
515
+
516
+ # Option 2: AWS credentials file (~/.aws/credentials)
517
+ aws configure
518
+
519
+ # Option 3: AWS named profile
520
+ cloudcat -p s3://bucket/data.csv --profile production
521
+
522
+ # Option 4: IAM role (for EC2/ECS/Lambda)
523
+ # Automatically detected
524
+ ```
525
+
526
+ ### Azure Blob Storage
527
+
528
+ CloudCat supports multiple authentication methods for Azure:
529
+
530
+ ```bash
531
+ # Option 1: Connection string (simplest)
532
+ export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...;EndpointSuffix=core.windows.net"
533
+
534
+ # Option 2: Account URL with DefaultAzureCredential (for Azure AD auth)
535
+ export AZURE_STORAGE_ACCOUNT_URL="https://youraccount.blob.core.windows.net"
536
+ az login
537
+
538
+ # Option 3: Specify storage account via CLI option
539
+ cloudcat -p az://container/data.csv --account mystorageaccount
540
+ ```
541
+
542
+ **Path format:** `az://container-name/path/to/blob`
543
+
544
+ ## Performance Tips
545
+
546
+ 1. **Use `--no-count`** for large files when you don't need the total record count
547
+ 2. **Prefer Parquet** format when possible — record counts are instant from metadata
548
+ 3. **Use `--num-rows`** to limit data transfer for large files
549
+ 4. **Use `--columns`** to select only needed columns (especially effective with Parquet)
550
+ 5. **Use `-m first`** when you only need a sample from directories with many files
551
+
552
+ ## Troubleshooting
553
+
554
+ ### Common Issues
555
+
556
+ **"google-cloud-storage package is required"**
557
+ ```bash
558
+ pip install cloudcat[gcs]
559
+ ```
560
+
561
+ **"boto3 package is required"**
562
+ ```bash
563
+ pip install cloudcat[s3]
564
+ ```
565
+
566
+ **"pyarrow package is required"**
567
+ ```bash
568
+ pip install cloudcat[parquet]
569
+ ```
570
+
571
+ **"azure-storage-blob package is required"**
572
+ ```bash
573
+ pip install cloudcat[azure]
574
+ ```
575
+
576
+ **"fastavro package is required"**
577
+ ```bash
578
+ pip install cloudcat[avro]
579
+ ```
580
+
581
+ **"pyarrow with ORC support is required"**
582
+ ```bash
583
+ pip install cloudcat[orc]
584
+ ```
585
+
586
+ **"zstandard package is required for .zst files"**
587
+ ```bash
588
+ pip install cloudcat[zstd]
589
+ # or for all compression formats:
590
+ pip install cloudcat[compression]
591
+ ```
592
+
593
+ **"lz4 package is required for .lz4 files"**
594
+ ```bash
595
+ pip install cloudcat[lz4]
596
+ ```
597
+
598
+ **"python-snappy package is required for .snappy files"**
599
+ ```bash
600
+ pip install cloudcat[snappy]
601
+ ```
602
+
603
+ **Authentication errors**
604
+ - GCS: Run `gcloud auth application-default login`
605
+ - S3: Run `aws configure` or check your credentials
606
+ - Azure: Set `AZURE_STORAGE_CONNECTION_STRING` or `AZURE_STORAGE_ACCOUNT_URL` and run `az login`
607
+
608
+ **"Could not infer format from path"**
609
+ ```bash
610
+ # Specify the format explicitly
611
+ cloudcat -p gcs://bucket/data -i parquet
612
+ ```
613
+
614
+ ## Contributing
615
+
616
+ Contributions are welcome! Here's how you can help:
617
+
618
+ 1. **Report bugs** — Open an issue with reproduction steps
619
+ 2. **Suggest features** — Open an issue describing the use case
620
+ 3. **Submit PRs** — Fork, create a branch, and submit a pull request
621
+
622
+ ### Development Setup
623
+
624
+ ```bash
625
+ # Clone the repository
626
+ git clone https://github.com/jonathansudhakar1/cloudcat.git
627
+ cd cloudcat
628
+
629
+ # Create virtual environment
630
+ python -m venv venv
631
+ source venv/bin/activate # or `venv\Scripts\activate` on Windows
632
+
633
+ # Install in development mode with all dependencies
634
+ pip install -e ".[all]"
635
+
636
+ # Run tests
637
+ pytest
638
+ ```
639
+
640
+ ## Roadmap
641
+
642
+ - [x] Azure Blob Storage support
643
+ - [x] Avro format support
644
+ - [x] ORC format support
645
+ - [x] Plain text format support
646
+ - [x] SQL-like filtering (`--where` clause)
647
+ - [x] Compression support (gzip, zstd, lz4, snappy, bz2)
648
+ - [x] Row offset/pagination (`--offset`)
649
+ - [ ] Interactive mode with pagination
650
+ - [ ] Output to file with `--output-file`
651
+ - [ ] Configuration file support
652
+
653
+ ## Related Projects
654
+
655
+ - [s3cmd](https://s3tools.org/s3cmd) — S3 command-line tool
656
+ - [gsutil](https://cloud.google.com/storage/docs/gsutil) — Google Cloud Storage CLI
657
+ - [aws-cli](https://aws.amazon.com/cli/) — AWS command-line interface
658
+ - [azcopy](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10) — Azure Storage data transfer tool
659
+ - [duckdb](https://duckdb.org/) — In-process SQL OLAP database
660
+
661
+ ## License
662
+
663
+ MIT License — see [LICENSE](LICENSE) for details.
664
+
665
+
666
+ <p align="center">
667
+ <a href="https://github.com/jonathansudhakar1/cloudcat/issues">Report Bug</a> •
668
+ <a href="https://github.com/jonathansudhakar1/cloudcat/issues">Request Feature</a>
669
+ </p>