plotly-cloud 0.1.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,180 @@
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
177
+
178
+ # React component build output
179
+ plotly_cloud/cloud_devtools.js*
180
+ plotly_cloud/cloud_devtools.css*
@@ -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,294 @@
1
+ Metadata-Version: 2.4
2
+ Name: plotly-cloud
3
+ Version: 0.1.0
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<1.0.0,>=0.24.0
9
+ Requires-Dist: nest-asyncio>=1.6.0
10
+ Requires-Dist: rich>=10.0.0
11
+ Requires-Dist: tomli-w>=1.2.0
12
+ Requires-Dist: tomli>=2.2.1
13
+ Description-Content-Type: text/markdown
14
+
15
+ # Plotly Cloud CLI
16
+
17
+ A command-line interface for interacting with Plotly Cloud to publish and manage Dash applications.
18
+
19
+ ## Features
20
+
21
+ - 🔐 **Authentication**: Login/logout with Plotly Cloud using OAuth
22
+ - 🚀 **Local Development**: Run Dash applications locally with comprehensive dev tools
23
+ - 📦 **Publish**: Publish Dash applications to Plotly Cloud with metadata management
24
+ - ⚙️ **Environment Configuration**: Centralized cloud configuration with staging/production support
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install plotly-cloud
30
+ ```
31
+
32
+ ## Quick Start
33
+
34
+ ### 1. Login to Plotly Cloud
35
+
36
+ ```bash
37
+ plotly login
38
+ ```
39
+
40
+ This will open your browser for OAuth authentication.
41
+
42
+ ### 2. Run a Dash Application
43
+
44
+ ```bash
45
+ plotly run app:app
46
+ ```
47
+
48
+ This runs your Dash app from the `app` module, using the `app` variable.
49
+
50
+ ### 3. Publish to Plotly Cloud
51
+
52
+ ```bash
53
+ # For new applications (first publish)
54
+ plotly publish --name "My App" --description "My application description"
55
+
56
+ # For existing applications (with default polling)
57
+ plotly publish
58
+
59
+ # Publish without polling status
60
+ plotly publish --poll-status=false
61
+ ```
62
+
63
+ ### 4. Logout
64
+
65
+ ```bash
66
+ plotly logout
67
+ ```
68
+
69
+ ## Environment Configuration
70
+
71
+ 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.
72
+
73
+ ## Usage
74
+
75
+ ### Authentication Commands
76
+
77
+ #### Login
78
+ ```bash
79
+ plotly login [--browser | --no-browser]
80
+ ```
81
+
82
+ Options:
83
+ - `--browser`: Open browser for authentication (default)
84
+ - `--no-browser`: Don't open browser automatically
85
+
86
+ #### Logout
87
+ ```bash
88
+ plotly logout
89
+ ```
90
+
91
+ #### Check Current User
92
+ ```bash
93
+ plotly whoami
94
+ ```
95
+
96
+ Show current user information if logged in with a valid token. If the token is invalid, it will automatically clear the credentials.
97
+
98
+ ### Running Applications
99
+
100
+ #### Basic Usage
101
+ ```bash
102
+ plotly run <module:variable>
103
+ ```
104
+
105
+ Examples:
106
+ ```bash
107
+ plotly run app:app # Run app from app.py
108
+ plotly run myapp:dashboard # Run dashboard from myapp.py
109
+ plotly run main # Run from main.py (looks for first Dash app)
110
+ ```
111
+
112
+ #### Advanced Options
113
+
114
+ ```bash
115
+ plotly run app:app --host 0.0.0.0 --port 8080 --debug
116
+ ```
117
+
118
+ **Server Options:**
119
+ - `--host`: Host IP address (default: 127.0.0.1)
120
+ - `--port, -p`: Port number (default: 8050)
121
+ - `--proxy`: Proxy configuration
122
+ - `--debug, -d`: Enable debug mode
123
+
124
+ **Development Tools:**
125
+ - `--dev-tools-ui`: Enable dev tools UI
126
+ - `--dev-tools-props-check`: Enable component prop validation
127
+ - `--dev-tools-serve-dev-bundles`: Enable serving dev bundles
128
+ - `--dev-tools-hot-reload`: Enable hot reloading
129
+ - `--dev-tools-hot-reload-interval`: Hot reload polling interval (default: 3.0s)
130
+ - `--dev-tools-hot-reload-watch-interval`: File watch interval (default: 0.5s)
131
+ - `--dev-tools-hot-reload-max-retry`: Max failed reload attempts (default: 8)
132
+ - `--dev-tools-silence-routes-logging`: Silence Werkzeug route logging
133
+ - `--dev-tools-disable-version-check`: Disable Dash version upgrade check
134
+ - `--dev-tools-prune-errors`: Prune tracebacks to user code only
135
+
136
+ ### Publishing Commands
137
+
138
+ #### Publish Application
139
+ ```bash
140
+ plotly publish [OPTIONS]
141
+ ```
142
+
143
+ Publish your Dash application to Plotly Cloud with automatic status polling.
144
+
145
+ **Options:**
146
+ - `--project-path`: Path to project directory (default: current directory)
147
+ - `--config`: Path to configuration file (default: plotly-cloud.toml)
148
+ - `--name`: Application name (required for first publish)
149
+ - `--description`: Application description (optional)
150
+ - `--output`: Output path for publish zip file (default: temporary file)
151
+ - `--keep-zip`: Keep the publish zip file after upload
152
+ - `--poll-status`: Poll publish status until completion (default: true)
153
+ - `--poll-interval`: Polling interval in seconds (default: 1.0)
154
+ - `--poll-timeout`: Polling timeout in seconds (default: 180 = 3 minutes)
155
+
156
+ **Examples:**
157
+ ```bash
158
+ # Publish with default settings (includes status polling)
159
+ plotly publish
160
+
161
+ # Publish new app with custom name and description
162
+ plotly publish --name "My Dashboard" --description "Sales analytics dashboard"
163
+
164
+ # Publish without status polling
165
+ plotly publish --poll-status=false
166
+
167
+ # Publish with custom polling settings
168
+ plotly publish --poll-interval=2.0 --poll-timeout=300
169
+
170
+ # Publish and keep the zip file
171
+ plotly publish --output=my-app.zip --keep-zip
172
+ ```
173
+
174
+ #### Check Application Status
175
+ ```bash
176
+ plotly status [OPTIONS]
177
+ ```
178
+
179
+ Get current status and details of your published application.
180
+
181
+ **Options:**
182
+ - `--project-path`: Path to project directory (default: current directory)
183
+ - `--config`: Path to configuration file (default: plotly-cloud.toml)
184
+
185
+ **Example:**
186
+ ```bash
187
+ plotly status
188
+ ```
189
+
190
+ ## Requirements
191
+
192
+ - Python 3.9+
193
+
194
+ ### Python Dependencies
195
+
196
+ - `httpx>=0.24.0` - HTTP client for API requests
197
+ - `dash>=2.0.0` - Dash framework
198
+ - `rich>=10.0.0` - Rich terminal formatting
199
+
200
+ ### Development Dependencies
201
+
202
+ - `pytest>=6.0` - Testing framework
203
+ - `ruff>=0.1.0` - Code linting and formatting
204
+ - `pyright>=1.1.0` - Type checking
205
+
206
+ ## Development
207
+
208
+ ### Setup
209
+
210
+ 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:
211
+
212
+ 1. Clone the repository
213
+ 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"`
214
+ 3. Install Just: `cargo install just` or see [installation docs](https://github.com/casey/just#installation)
215
+ 4. Setup the development environment:
216
+ ```bash
217
+ # Install dependencies
218
+ just install
219
+
220
+ # Setup cloud environment configuration
221
+ just setup-cloud-env "your-staging-client-id" "your-production-client-id"
222
+
223
+ # Install CLI in development mode
224
+ just install-cli
225
+ ```
226
+
227
+ ### Development Commands
228
+
229
+ Run `just` or `just --list` to see all available commands:
230
+
231
+ ```bash
232
+ # Testing
233
+ just test # Run all tests
234
+ just test-cov # Run tests with coverage
235
+ just test-file tests/test_commands.py # Run specific test file
236
+
237
+ # Code Quality
238
+ just lint # Run linting
239
+ just lint-fix # Run linting with auto-fix
240
+ just format # Format code
241
+ just quality # Run all quality checks (lint + typecheck + test)
242
+
243
+ # Cloud Configuration
244
+ just setup-cloud-env <staging_id> [production_id] # Setup cloud config
245
+ just show-cloud-config # Display current configuration
246
+
247
+ # Publishing
248
+ just publish [path] # Publish to cloud (default: current directory)
249
+
250
+ # Development
251
+ just install-cli # Install CLI in development mode
252
+ just test-cli # Test CLI after installation
253
+ just run-example app:app # Run example Dash app
254
+
255
+ # Maintenance
256
+ just clean # Clean build artifacts
257
+ just build # Build package
258
+ ```
259
+
260
+ ### Alternative Setup (without Just)
261
+
262
+ If you prefer not to use Just:
263
+
264
+ 1. Create a virtual environment:
265
+ ```bash
266
+ python -m venv .venv
267
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
268
+ ```
269
+ 2. Install in development mode:
270
+ ```bash
271
+ pip install -e ".[dev]"
272
+ ```
273
+
274
+ ### Project Structure
275
+
276
+ ```
277
+ plotly-cloud-cli/
278
+ ├── plotly_cloud/
279
+ │ ├── __init__.py # Package initialization
280
+ │ ├── cli.py # Main CLI entry point
281
+ │ └── _commands.py # Command implementations
282
+ ├── pyproject.toml # Project configuration
283
+ ├── uv.lock # Dependency lock file
284
+ ├── .gitignore # Git ignore rules
285
+ └── README.md # This file
286
+ ```
287
+
288
+ ## License
289
+
290
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
291
+
292
+ ## Support
293
+
294
+ For issues and questions, please open an issue on the GitHub repository.