dataspring-cli 0.3.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.
@@ -0,0 +1,20 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ .Python
6
+ env/
7
+ venv/
8
+ .venv/
9
+ *.egg-info/
10
+ dist/
11
+
12
+ # Environment files
13
+ .env
14
+ .env.local
15
+
16
+ # IDE
17
+ .idea/
18
+ .vscode/
19
+ *.swp
20
+ *.swo
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.5
2
+ Name: dataspring-cli
3
+ Version: 0.3.0
4
+ Summary: DataSpring CLI - Query metrics and manage dashboards from the terminal
5
+ Project-URL: Homepage, https://dataspring.app
6
+ Project-URL: Documentation, https://dataspring.app/docs
7
+ Author-email: DataSpring <support@dataspring.app>
8
+ License: Proprietary
9
+ Keywords: analytics,bi,dashboard,dbt,metricflow,metrics
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: Other/Proprietary License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Database
21
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
22
+ Requires-Python: >=3.12
23
+ Requires-Dist: google-auth-oauthlib>=1.4.1
24
+ Requires-Dist: google-auth>=2.57.0
25
+ Requires-Dist: httpx>=0.28.1
26
+ Requires-Dist: pydantic-settings>=2.15.0
27
+ Requires-Dist: pydantic>=2.13.4
28
+ Requires-Dist: pyyaml>=6.0.3
29
+ Requires-Dist: rich>=15.0.0
30
+ Requires-Dist: typer>=0.27.1
31
+ Description-Content-Type: text/markdown
32
+
33
+ # DataSpring CLI
34
+
35
+ Query metrics and manage dashboards from the terminal.
36
+
37
+ ## Installation
38
+
39
+ ### Using uv (Recommended)
40
+
41
+ ```bash
42
+ # Install from local build
43
+ uv tool install ./backend
44
+
45
+ # Or install from GitHub (once published)
46
+ uv tool install git+https://github.com/dataspring/dataspring#subdirectory=backend
47
+ ```
48
+
49
+ ### Using pip
50
+
51
+ ```bash
52
+ pip install ./backend
53
+ ```
54
+
55
+ ## Quick Start
56
+
57
+ ```bash
58
+ # Login with Google OAuth
59
+ dataspring login
60
+
61
+ # Check who you're logged in as
62
+ dataspring whoami
63
+
64
+ # List available metrics
65
+ dataspring metrics list
66
+
67
+ # Query metrics
68
+ dataspring query -m total_revenue -g month --limit 5
69
+
70
+ # Get visualization suggestions
71
+ dataspring query -m total_revenue -g month --suggest-viz
72
+
73
+ # Export to JSON
74
+ dataspring query -m total_revenue --format json > data.json
75
+ ```
76
+
77
+ ## Commands
78
+
79
+ ### Authentication
80
+
81
+ ```bash
82
+ dataspring login # Login via Google OAuth (opens browser)
83
+ dataspring whoami # Show current user and organization
84
+ dataspring logout # Clear stored credentials
85
+ dataspring org list # List your organizations
86
+ dataspring org switch ID # Switch to a different organization
87
+ ```
88
+
89
+ ### Querying Metrics
90
+
91
+ ```bash
92
+ # List available metrics
93
+ dataspring metrics list
94
+ dataspring metrics list --format json
95
+
96
+ # Get metric details
97
+ dataspring metrics show total_revenue
98
+
99
+ # Query data
100
+ dataspring query -m revenue -g month # Monthly revenue
101
+ dataspring query -m revenue -d region --limit 10 # By region
102
+ dataspring query -m revenue -m orders -g week # Multiple metrics
103
+ dataspring query -m revenue --start 2024-01-01 --end 2024-12-31
104
+
105
+ # With visualization suggestion
106
+ dataspring query -m revenue -g month --suggest-viz
107
+
108
+ # List dimensions
109
+ dataspring dimensions list
110
+ ```
111
+
112
+ ### Dashboard Management
113
+
114
+ ```bash
115
+ # List dashboards
116
+ dataspring dashboards list
117
+
118
+ # Show dashboard details
119
+ dataspring dashboards show DASHBOARD_ID
120
+
121
+ # Create a new dashboard
122
+ dataspring dashboards create "My Dashboard"
123
+ dataspring dashboards create "Team Metrics" -v org # Visible to team
124
+
125
+ # Delete a dashboard
126
+ dataspring dashboards delete DASHBOARD_ID
127
+ dataspring dashboards delete DASHBOARD_ID --yes # Skip confirmation
128
+ ```
129
+
130
+ ### Manifest Management (Admin Only)
131
+
132
+ ```bash
133
+ # View manifest status
134
+ dataspring manifest status
135
+
136
+ # Export manifest
137
+ dataspring manifest export -o manifest.yaml
138
+
139
+ # Import manifest
140
+ dataspring manifest upload manifest.yaml
141
+ dataspring manifest upload manifest.yaml --force # Overwrite conflicts
142
+
143
+ # Semantic models
144
+ dataspring models list
145
+ dataspring models show orders
146
+ dataspring models create model.yaml
147
+ dataspring models update orders updated.yaml
148
+ dataspring models delete orders
149
+
150
+ # Metrics
151
+ dataspring metrics create metric.yaml
152
+ dataspring metrics update total_revenue updated.yaml
153
+ dataspring metrics delete total_revenue
154
+ dataspring metrics preview metric.yaml # Test before saving
155
+ ```
156
+
157
+ ## Output Formats
158
+
159
+ All commands support `--format`:
160
+
161
+ | Format | Description |
162
+ |--------|-------------|
163
+ | `table` | Human-readable ASCII table (default) |
164
+ | `json` | JSON output for scripting |
165
+ | `yaml` | YAML output for config editing |
166
+
167
+ ```bash
168
+ dataspring metrics list --format json | jq '.[0]'
169
+ dataspring dashboards show abc123 --format yaml > dashboard.yaml
170
+ ```
171
+
172
+ ## Configuration
173
+
174
+ Credentials are stored in `~/.dataspring/`:
175
+
176
+ ```
177
+ ~/.dataspring/
178
+ ├── credentials.json # OAuth tokens (encrypted)
179
+ └── config.json # User preferences
180
+ ```
181
+
182
+ ## Development
183
+
184
+ ```bash
185
+ # Build the wheel
186
+ cd backend
187
+ uv build
188
+
189
+ # Install locally for testing
190
+ uv tool install dist/dataspring_cli-*.whl --force
191
+
192
+ # Run tests
193
+ uv run pytest tests/ -v
194
+ ```
195
+
196
+ ## Environment Variables
197
+
198
+ | Variable | Description |
199
+ |----------|-------------|
200
+ | `FIRESTORE_EMULATOR_HOST` | Use Firestore emulator |
201
+ | `FIREBASE_AUTH_EMULATOR_HOST` | Use Auth emulator |
202
+ | `ENV` | Environment: `production`, `development`, `test` |
@@ -0,0 +1,170 @@
1
+ # DataSpring CLI
2
+
3
+ Query metrics and manage dashboards from the terminal.
4
+
5
+ ## Installation
6
+
7
+ ### Using uv (Recommended)
8
+
9
+ ```bash
10
+ # Install from local build
11
+ uv tool install ./backend
12
+
13
+ # Or install from GitHub (once published)
14
+ uv tool install git+https://github.com/dataspring/dataspring#subdirectory=backend
15
+ ```
16
+
17
+ ### Using pip
18
+
19
+ ```bash
20
+ pip install ./backend
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ ```bash
26
+ # Login with Google OAuth
27
+ dataspring login
28
+
29
+ # Check who you're logged in as
30
+ dataspring whoami
31
+
32
+ # List available metrics
33
+ dataspring metrics list
34
+
35
+ # Query metrics
36
+ dataspring query -m total_revenue -g month --limit 5
37
+
38
+ # Get visualization suggestions
39
+ dataspring query -m total_revenue -g month --suggest-viz
40
+
41
+ # Export to JSON
42
+ dataspring query -m total_revenue --format json > data.json
43
+ ```
44
+
45
+ ## Commands
46
+
47
+ ### Authentication
48
+
49
+ ```bash
50
+ dataspring login # Login via Google OAuth (opens browser)
51
+ dataspring whoami # Show current user and organization
52
+ dataspring logout # Clear stored credentials
53
+ dataspring org list # List your organizations
54
+ dataspring org switch ID # Switch to a different organization
55
+ ```
56
+
57
+ ### Querying Metrics
58
+
59
+ ```bash
60
+ # List available metrics
61
+ dataspring metrics list
62
+ dataspring metrics list --format json
63
+
64
+ # Get metric details
65
+ dataspring metrics show total_revenue
66
+
67
+ # Query data
68
+ dataspring query -m revenue -g month # Monthly revenue
69
+ dataspring query -m revenue -d region --limit 10 # By region
70
+ dataspring query -m revenue -m orders -g week # Multiple metrics
71
+ dataspring query -m revenue --start 2024-01-01 --end 2024-12-31
72
+
73
+ # With visualization suggestion
74
+ dataspring query -m revenue -g month --suggest-viz
75
+
76
+ # List dimensions
77
+ dataspring dimensions list
78
+ ```
79
+
80
+ ### Dashboard Management
81
+
82
+ ```bash
83
+ # List dashboards
84
+ dataspring dashboards list
85
+
86
+ # Show dashboard details
87
+ dataspring dashboards show DASHBOARD_ID
88
+
89
+ # Create a new dashboard
90
+ dataspring dashboards create "My Dashboard"
91
+ dataspring dashboards create "Team Metrics" -v org # Visible to team
92
+
93
+ # Delete a dashboard
94
+ dataspring dashboards delete DASHBOARD_ID
95
+ dataspring dashboards delete DASHBOARD_ID --yes # Skip confirmation
96
+ ```
97
+
98
+ ### Manifest Management (Admin Only)
99
+
100
+ ```bash
101
+ # View manifest status
102
+ dataspring manifest status
103
+
104
+ # Export manifest
105
+ dataspring manifest export -o manifest.yaml
106
+
107
+ # Import manifest
108
+ dataspring manifest upload manifest.yaml
109
+ dataspring manifest upload manifest.yaml --force # Overwrite conflicts
110
+
111
+ # Semantic models
112
+ dataspring models list
113
+ dataspring models show orders
114
+ dataspring models create model.yaml
115
+ dataspring models update orders updated.yaml
116
+ dataspring models delete orders
117
+
118
+ # Metrics
119
+ dataspring metrics create metric.yaml
120
+ dataspring metrics update total_revenue updated.yaml
121
+ dataspring metrics delete total_revenue
122
+ dataspring metrics preview metric.yaml # Test before saving
123
+ ```
124
+
125
+ ## Output Formats
126
+
127
+ All commands support `--format`:
128
+
129
+ | Format | Description |
130
+ |--------|-------------|
131
+ | `table` | Human-readable ASCII table (default) |
132
+ | `json` | JSON output for scripting |
133
+ | `yaml` | YAML output for config editing |
134
+
135
+ ```bash
136
+ dataspring metrics list --format json | jq '.[0]'
137
+ dataspring dashboards show abc123 --format yaml > dashboard.yaml
138
+ ```
139
+
140
+ ## Configuration
141
+
142
+ Credentials are stored in `~/.dataspring/`:
143
+
144
+ ```
145
+ ~/.dataspring/
146
+ ├── credentials.json # OAuth tokens (encrypted)
147
+ └── config.json # User preferences
148
+ ```
149
+
150
+ ## Development
151
+
152
+ ```bash
153
+ # Build the wheel
154
+ cd backend
155
+ uv build
156
+
157
+ # Install locally for testing
158
+ uv tool install dist/dataspring_cli-*.whl --force
159
+
160
+ # Run tests
161
+ uv run pytest tests/ -v
162
+ ```
163
+
164
+ ## Environment Variables
165
+
166
+ | Variable | Description |
167
+ |----------|-------------|
168
+ | `FIRESTORE_EMULATOR_HOST` | Use Firestore emulator |
169
+ | `FIREBASE_AUTH_EMULATOR_HOST` | Use Auth emulator |
170
+ | `ENV` | Environment: `production`, `development`, `test` |
@@ -0,0 +1,15 @@
1
+ """DataSpring CLI - Command-line interface for DataSpring.
2
+
3
+ This package provides a terminal-based interface to DataSpring's
4
+ metric query and dashboard capabilities.
5
+
6
+ Usage:
7
+ dataspring login # Authenticate via Google OAuth
8
+ dataspring whoami # Show current user and org
9
+ dataspring metrics list # List available metrics
10
+ dataspring query -m revenue -g month # Query metrics
11
+ """
12
+
13
+ from .main import app
14
+
15
+ __all__ = ["app"]