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