plotly-cloud 0.1.0rc1__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,176 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ #poetry.lock
99
+
100
+ # pdm
101
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
102
+ #pdm.lock
103
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
104
+ # in version control.
105
+ # https://pdm.fming.dev/#use-with-ide
106
+ .pdm.toml
107
+
108
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
109
+ __pypackages__/
110
+
111
+ # Celery stuff
112
+ celerybeat-schedule
113
+ celerybeat.pid
114
+
115
+ # SageMath parsed files
116
+ *.sage.py
117
+
118
+ # Environments
119
+ .env
120
+ .venv
121
+ env/
122
+ venv/
123
+ ENV/
124
+ env.bak/
125
+ venv.bak/
126
+
127
+ # Spyder project settings
128
+ .spyderproject
129
+ .spyproject
130
+
131
+ # Rope project settings
132
+ .ropeproject
133
+
134
+ # mkdocs documentation
135
+ /site
136
+
137
+ # mypy
138
+ .mypy_cache/
139
+ .dmypy.json
140
+ dmypy.json
141
+
142
+ # Pyre type checker
143
+ .pyre/
144
+
145
+ # pytype static type analyzer
146
+ .pytype/
147
+
148
+ # Cython debug symbols
149
+ cython_debug/
150
+
151
+ # Ruff cache
152
+ .ruff_cache
153
+
154
+ # Pyright cache
155
+ pyrightconfig.json
156
+ .pyright/
157
+
158
+ .claude
159
+
160
+ # Editor directories and files
161
+ .vscode/
162
+ *.swp
163
+ *.swo
164
+ *~
165
+
166
+ # OS generated files
167
+ .DS_Store
168
+ .DS_Store?
169
+ ._*
170
+ .Spotlight-V100
171
+ .Trashes
172
+ ehthumbs.db
173
+ Thumbs.db
174
+
175
+ # Cloud environment configuration (created at packaging time)
176
+ cloud-env.toml
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Plotly, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,320 @@
1
+ Metadata-Version: 2.4
2
+ Name: plotly-cloud
3
+ Version: 0.1.0rc1
4
+ Summary: CLI for interacting with Plotly Cloud to deploy Dash apps
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.9
7
+ Requires-Dist: dash>=2.0.0
8
+ Requires-Dist: httpx>=0.24.0
9
+ Requires-Dist: nest-asyncio>=1.6.0
10
+ Requires-Dist: rich-argparse>=1.7.1
11
+ Requires-Dist: rich>=10.0.0
12
+ Requires-Dist: tomli-w>=1.2.0
13
+ Requires-Dist: tomli>=2.2.1
14
+ Description-Content-Type: text/markdown
15
+
16
+ # Plotly Cloud CLI
17
+
18
+ A command-line interface for interacting with Plotly Cloud to publish and manage Dash applications.
19
+
20
+ ## Features
21
+
22
+ - 🔐 **Authentication**: Login/logout with Plotly Cloud using OAuth
23
+ - 🚀 **Local Development**: Run Dash applications locally with comprehensive dev tools
24
+ - 📦 **Publish**: Publish Dash applications to Plotly Cloud with metadata management
25
+ - ⚙️ **Environment Configuration**: Centralized cloud configuration with staging/production support
26
+
27
+ ## Installation
28
+
29
+ ### From Source
30
+
31
+ ```bash
32
+ git clone <repository-url>
33
+ cd plotly-cloud-cli
34
+ pip install -e .
35
+ ```
36
+
37
+ ### Development Installation
38
+
39
+ For development, we recommend using UV and the provided Justfile:
40
+
41
+ ```bash
42
+ git clone <repository-url>
43
+ cd plotly-cloud-cli
44
+
45
+ # Install UV if you haven't already
46
+ curl -LsSf https://astral.sh/uv/install.sh | sh
47
+
48
+ # Install dependencies
49
+ just install
50
+
51
+ # Setup cloud environment configuration
52
+ just setup-cloud-env "your-staging-client-id" "your-production-client-id"
53
+
54
+ # Install CLI in development mode
55
+ just install-cli
56
+ ```
57
+
58
+ ## Quick Start
59
+
60
+ ### 1. Login to Plotly Cloud
61
+
62
+ ```bash
63
+ plotly login
64
+ ```
65
+
66
+ This will open your browser for OAuth authentication.
67
+
68
+ ### 2. Run a Dash Application
69
+
70
+ ```bash
71
+ plotly run app:app
72
+ ```
73
+
74
+ This runs your Dash app from the `app` module, using the `app` variable.
75
+
76
+ ### 3. Publish to Plotly Cloud
77
+
78
+ ```bash
79
+ # For new applications (first publish)
80
+ plotly publish --name "My App" --description "My application description"
81
+
82
+ # For existing applications (with default polling)
83
+ plotly publish
84
+
85
+ # Publish without polling status
86
+ plotly publish --poll-status=false
87
+ ```
88
+
89
+ ### 4. Logout
90
+
91
+ ```bash
92
+ plotly logout
93
+ ```
94
+
95
+ ## Environment Configuration
96
+
97
+ The CLI uses a `cloud-env.toml` file for environment-specific configuration (OAuth client IDs, API URLs). This file is gitignored and should be created during development or at packaging time.
98
+
99
+ ## Usage
100
+
101
+ ### Authentication Commands
102
+
103
+ #### Login
104
+ ```bash
105
+ plotly login [--browser | --no-browser]
106
+ ```
107
+
108
+ Options:
109
+ - `--browser`: Open browser for authentication (default)
110
+ - `--no-browser`: Don't open browser automatically
111
+
112
+ #### Logout
113
+ ```bash
114
+ plotly logout
115
+ ```
116
+
117
+ #### Check Current User
118
+ ```bash
119
+ plotly whoami
120
+ ```
121
+
122
+ Show current user information if logged in with a valid token. If the token is invalid, it will automatically clear the credentials.
123
+
124
+ ### Running Applications
125
+
126
+ #### Basic Usage
127
+ ```bash
128
+ plotly run <module:variable>
129
+ ```
130
+
131
+ Examples:
132
+ ```bash
133
+ plotly run app:app # Run app from app.py
134
+ plotly run myapp:dashboard # Run dashboard from myapp.py
135
+ plotly run main # Run from main.py (looks for first Dash app)
136
+ ```
137
+
138
+ #### Advanced Options
139
+
140
+ ```bash
141
+ plotly run app:app --host 0.0.0.0 --port 8080 --debug
142
+ ```
143
+
144
+ **Server Options:**
145
+ - `--host`: Host IP address (default: 127.0.0.1)
146
+ - `--port, -p`: Port number (default: 8050)
147
+ - `--proxy`: Proxy configuration
148
+ - `--debug, -d`: Enable debug mode
149
+
150
+ **Development Tools:**
151
+ - `--dev-tools-ui`: Enable dev tools UI
152
+ - `--dev-tools-props-check`: Enable component prop validation
153
+ - `--dev-tools-serve-dev-bundles`: Enable serving dev bundles
154
+ - `--dev-tools-hot-reload`: Enable hot reloading
155
+ - `--dev-tools-hot-reload-interval`: Hot reload polling interval (default: 3.0s)
156
+ - `--dev-tools-hot-reload-watch-interval`: File watch interval (default: 0.5s)
157
+ - `--dev-tools-hot-reload-max-retry`: Max failed reload attempts (default: 8)
158
+ - `--dev-tools-silence-routes-logging`: Silence Werkzeug route logging
159
+ - `--dev-tools-disable-version-check`: Disable Dash version upgrade check
160
+ - `--dev-tools-prune-errors`: Prune tracebacks to user code only
161
+
162
+ ### Publishing Commands
163
+
164
+ #### Publish Application
165
+ ```bash
166
+ plotly publish [OPTIONS]
167
+ ```
168
+
169
+ Publish your Dash application to Plotly Cloud with automatic status polling.
170
+
171
+ **Options:**
172
+ - `--project-path`: Path to project directory (default: current directory)
173
+ - `--config`: Path to configuration file (default: plotly-cloud.toml)
174
+ - `--name`: Application name (required for first publish)
175
+ - `--description`: Application description (optional)
176
+ - `--output`: Output path for publish zip file (default: temporary file)
177
+ - `--keep-zip`: Keep the publish zip file after upload
178
+ - `--poll-status`: Poll publish status until completion (default: true)
179
+ - `--poll-interval`: Polling interval in seconds (default: 1.0)
180
+ - `--poll-timeout`: Polling timeout in seconds (default: 180 = 3 minutes)
181
+
182
+ **Examples:**
183
+ ```bash
184
+ # Publish with default settings (includes status polling)
185
+ plotly publish
186
+
187
+ # Publish new app with custom name and description
188
+ plotly publish --name "My Dashboard" --description "Sales analytics dashboard"
189
+
190
+ # Publish without status polling
191
+ plotly publish --poll-status=false
192
+
193
+ # Publish with custom polling settings
194
+ plotly publish --poll-interval=2.0 --poll-timeout=300
195
+
196
+ # Publish and keep the zip file
197
+ plotly publish --output=my-app.zip --keep-zip
198
+ ```
199
+
200
+ #### Check Application Status
201
+ ```bash
202
+ plotly status [OPTIONS]
203
+ ```
204
+
205
+ Get current status and details of your published application.
206
+
207
+ **Options:**
208
+ - `--project-path`: Path to project directory (default: current directory)
209
+ - `--config`: Path to configuration file (default: plotly-cloud.toml)
210
+
211
+ **Example:**
212
+ ```bash
213
+ plotly status
214
+ ```
215
+
216
+ ## Requirements
217
+
218
+ - Python 3.9+
219
+
220
+ ### Python Dependencies
221
+
222
+ - `httpx>=0.24.0` - HTTP client for API requests
223
+ - `dash>=2.0.0` - Dash framework
224
+ - `rich>=10.0.0` - Rich terminal formatting
225
+
226
+ ### Development Dependencies
227
+
228
+ - `pytest>=6.0` - Testing framework
229
+ - `ruff>=0.1.0` - Code linting and formatting
230
+ - `pyright>=1.1.0` - Type checking
231
+
232
+ ## Development
233
+
234
+ ### Setup
235
+
236
+ We use [`uv`](https://docs.astral.sh/uv/) to manage dependencies and [Just](https://github.com/casey/just) is used for task automation. Install them and use our Justfile for common development tasks:
237
+
238
+ 1. Clone the repository
239
+ 2. Install uv: `curl -LsSf https://astral.sh/uv/install.sh | sh` or on windows: `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"`
240
+ 3. Install Just: `cargo install just` or see [installation docs](https://github.com/casey/just#installation)
241
+ 4. Setup the development environment:
242
+ ```bash
243
+ # Install dependencies
244
+ just install
245
+
246
+ # Setup cloud environment configuration
247
+ just setup-cloud-env "your-staging-client-id" "your-production-client-id"
248
+
249
+ # Install CLI in development mode
250
+ just install-cli
251
+ ```
252
+
253
+ ### Development Commands
254
+
255
+ Run `just` or `just --list` to see all available commands:
256
+
257
+ ```bash
258
+ # Testing
259
+ just test # Run all tests
260
+ just test-cov # Run tests with coverage
261
+ just test-file tests/test_commands.py # Run specific test file
262
+
263
+ # Code Quality
264
+ just lint # Run linting
265
+ just lint-fix # Run linting with auto-fix
266
+ just format # Format code
267
+ just quality # Run all quality checks (lint + typecheck + test)
268
+
269
+ # Cloud Configuration
270
+ just setup-cloud-env <staging_id> [production_id] # Setup cloud config
271
+ just show-cloud-config # Display current configuration
272
+
273
+ # Publishing
274
+ just publish [path] # Publish to cloud (default: current directory)
275
+
276
+ # Development
277
+ just install-cli # Install CLI in development mode
278
+ just test-cli # Test CLI after installation
279
+ just run-example app:app # Run example Dash app
280
+
281
+ # Maintenance
282
+ just clean # Clean build artifacts
283
+ just build # Build package
284
+ ```
285
+
286
+ ### Alternative Setup (without Just)
287
+
288
+ If you prefer not to use Just:
289
+
290
+ 1. Create a virtual environment:
291
+ ```bash
292
+ python -m venv .venv
293
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
294
+ ```
295
+ 2. Install in development mode:
296
+ ```bash
297
+ pip install -e ".[dev]"
298
+ ```
299
+
300
+ ### Project Structure
301
+
302
+ ```
303
+ plotly-cloud-cli/
304
+ ├── plotly_cloud/
305
+ │ ├── __init__.py # Package initialization
306
+ │ ├── cli.py # Main CLI entry point
307
+ │ └── _commands.py # Command implementations
308
+ ├── pyproject.toml # Project configuration
309
+ ├── uv.lock # Dependency lock file
310
+ ├── .gitignore # Git ignore rules
311
+ └── README.md # This file
312
+ ```
313
+
314
+ ## License
315
+
316
+ [License information to be added]
317
+
318
+ ## Support
319
+
320
+ For issues and questions, please open an issue on the GitHub repository.