cloudcat 0.1.2__tar.gz → 0.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudcat
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: A CLI utility to read and display files from cloud storage
5
5
  Home-page: https://github.com/yourusername/cloudcat
6
6
  Author: Your Name
@@ -0,0 +1,161 @@
1
+ # CloudCat
2
+
3
+ A command-line utility to read and display data from cloud storage (Google Cloud Storage and AWS S3) with advanced features for handling directories, multiple files, and formatting output.
4
+
5
+ ## Features
6
+
7
+ - **Cloud Storage Support**: Read files from GCS (`gcs://`) and S3 (`s3://`)
8
+ - **Multiple File Formats**: Support for CSV, JSON, and Parquet
9
+ - **CSV Delimiter Support**: Handle tab-delimited and other custom-delimited files
10
+ - **Intelligent Directory Handling**: Automatically find and read data from directories
11
+ - **Multi-File Reading**: Combine data from multiple small files (up to configurable size)
12
+ - **Streaming**: Optimize to avoid downloading entire files when possible
13
+ - **Output Formatting**: Display as tables, JSON, pretty JSON with colors, or CSV
14
+ - **Schema Display**: View full schema information for all columns
15
+ - **Column Selection**: Filter to show only specific columns
16
+ - **Record Counting**: Automatically provides total record counts
17
+ - **Row Limiting**: Control how many rows to display
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ # Basic installation
23
+ pip install cloudcat
24
+
25
+ # With specific provider support
26
+ pip install cloudcat[gcs] # For Google Cloud Storage
27
+ pip install cloudcat[s3] # For AWS S3
28
+ pip install cloudcat[parquet] # For Parquet file support
29
+
30
+ # Full installation with all dependencies
31
+ pip install cloudcat[all]
32
+ ```
33
+
34
+ ## Quick Start
35
+
36
+ ```bash
37
+ # Basic file reading
38
+ cloudcat --path gcs://bucket/file.csv
39
+
40
+ # Reading tab-delimited files
41
+ cloudcat --path s3://bucket/data.csv --delimiter "\t"
42
+
43
+ # Reading from a directory (automatically finds data files)
44
+ cloudcat --path s3://bucket/spark-output/
45
+
46
+ # Reading multiple files (up to 25MB)
47
+ cloudcat --path gcs://bucket/logs/ --multi-file-mode all
48
+ ```
49
+
50
+ ## Command-Line Options
51
+
52
+ | Option | Short | Description |
53
+ |--------|-------|-------------|
54
+ | `--path` | `-p` | Path to the file or directory (required), format: `gcs://bucket/path` or `s3://bucket/path` |
55
+ | `--output-format` | `-o` | Output format: `table` (default), `json`, `jsonp` (pretty JSON), `csv` |
56
+ | `--input-format` | `-i` | Input format: `csv`, `json`, `parquet` (default: inferred from path) |
57
+ | `--columns` | `-c` | Comma-separated list of columns to display (default: all) |
58
+ | `--num-rows` | `-n` | Number of rows to display (default: 10) |
59
+ | `--schema` | `-s` | Schema display: `show` (default), `dont_show`, `schema_only` |
60
+ | `--no-count` | | Disable record count display (counts shown by default) |
61
+ | `--multi-file-mode` | `-m` | How to handle directories: `auto` (default), `first`, `all` |
62
+ | `--max-size-mb` | | Maximum size in MB to read for multi-file mode (default: 25) |
63
+ | `--delimiter` | `-d` | Delimiter to use for CSV files (use `\t` for tab) |
64
+
65
+ ## Directory Handling
66
+
67
+ When pointing to a directory (path ending with `/`), CloudCat can operate in three modes:
68
+
69
+ - **first**: Read only the first suitable non-empty file
70
+ - **auto**: Automatically decide between single file and multi-file reading
71
+ - **all**: Always read multiple files up to the specified size limit
72
+
73
+ When reading directories, CloudCat automatically:
74
+ - Skips empty files
75
+ - Ignores metadata files like `_SUCCESS`, `.crc`, etc.
76
+ - Prioritizes files matching the specified format
77
+ - Provides a summary of selected files
78
+
79
+ ## CSV Delimiter Support
80
+
81
+ CloudCat can handle various CSV delimiter types:
82
+
83
+ ```bash
84
+ # Tab-delimited files
85
+ cloudcat --path gcs://bucket/data.tsv --delimiter "\t"
86
+
87
+ # Pipe-delimited files
88
+ cloudcat --path s3://data/extract.csv --delimiter "|"
89
+
90
+ # Semicolon-delimited files (common in Europe)
91
+ cloudcat --path gcs://reports/data.csv --delimiter ";"
92
+ ```
93
+
94
+ ## Output Formats
95
+
96
+ - **table**: Formatted table with colored headers (default)
97
+ - **json**: Standard JSON, one object per line
98
+ - **jsonp**: Pretty JSON with syntax highlighting and colors
99
+ - **csv**: Comma-separated values format
100
+
101
+ ## Authentication
102
+
103
+ CloudCat uses the default authentication mechanisms for each cloud provider:
104
+
105
+ - For GCS: Application Default Credentials (ADC)
106
+ - For S3: AWS credentials from environment, ~/.aws/credentials, etc.
107
+
108
+ Make sure you have the appropriate credentials configured before using the tool.
109
+
110
+ ## Example Use Cases
111
+
112
+ ### Reading Tab-Delimited Files
113
+
114
+ ```bash
115
+ # Read a tab-delimited file and show as table
116
+ cloudcat --path gcs://analytics/export.tsv --delimiter "\t"
117
+
118
+ # Convert tab-delimited to JSON
119
+ cloudcat --path s3://exports/data.tsv --delimiter "\t" --output-format jsonp
120
+ ```
121
+
122
+ ### Exploring a Spark Output Directory
123
+
124
+ ```bash
125
+ # Automatically find and read data files, skipping metadata files
126
+ cloudcat --path gcs://analytics/spark-job-output/ --input-format parquet
127
+
128
+ # Read multiple files to get a more representative sample
129
+ cloudcat --path gcs://analytics/spark-job-output/ --multi-file-mode all --max-size-mb 50
130
+ ```
131
+
132
+ ### Quick Data Analysis
133
+
134
+ ```bash
135
+ # See the schema of a dataset
136
+ cloudcat --path s3://data-lake/customers.parquet --schema schema_only
137
+
138
+ # Look at specific columns with pretty formatting
139
+ cloudcat --path gcs://analytics/events.json --columns user_id,event_type,timestamp --output-format jsonp
140
+ ```
141
+
142
+ ### Data Export
143
+
144
+ ```bash
145
+ # Export data as CSV
146
+ cloudcat --path s3://exports/data.parquet --num-rows 1000 --output-format csv > exported_data.csv
147
+
148
+ # Convert tab-delimited to comma-delimited
149
+ cloudcat --path gcs://exports/data.tsv --delimiter "\t" --output-format csv > converted.csv
150
+ ```
151
+
152
+ ### Handling Small Files
153
+
154
+ ```bash
155
+ # Read and combine data from a directory with many small files
156
+ cloudcat --path gcs://logs/daily/ --multi-file-mode all --max-size-mb 100
157
+ ```
158
+
159
+ ## License
160
+
161
+ MIT
@@ -2,4 +2,4 @@
2
2
  #!/usr/bin/env python
3
3
  """cloudcat - A CLI utility to read and display files from cloud storage."""
4
4
 
5
- __version__ = "0.1.2"
5
+ __version__ = "0.1.4"