plash-cli


Nameplash-cli JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/AnswerDotAI/plash_cli
SummaryCLI for the Plash hosting service
upload_time2025-03-20 15:05:47
maintainerNone
docs_urlNone
authorJeremy Howard
requires_python>=3.7
licenseApache Software License 2.0
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # plash-cli


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

**WARNING** - Plash is in Beta and we have released it in its
semi-stable state to gather early feedback to improve. We do not
recommend hosting critical applications yet.

## Usage

### Installation

Install latest from the GitHub
[repository](https://github.com/AnswerDotAI/plash-cli):

``` sh
$ pip install git+https://github.com/AnswerDotAI/plash-cli.git
```

or from [pypi](https://pypi.org/project/plash-cli/)

``` sh
$ pip install plash_cli
```

## Deploy Your First FastHTML App

### Set Up Your Plash Token

You’ll need to set a PLASH_TOKEN and PLASH_EMAIL environment variables
to use Plash. To obtain these, do the following:

1.  Signup for an account at https://pla.sh/
2.  Activate your Plash subscription
3.  Follow instructions in your Plash dashboard to save credentials
    locally

### Create a FastHTML App

Create a directory for your FastHTML app, and go into it:

``` sh
mkdir minimal
cd minimal
```

Create `main.py` containing:

``` python
from fasthtml.common import *

app, rt = fast_app()

@rt
def index():
    return H1("Hello world!")

serve()
```

Then create a requirements.txt containing:

    python-fasthtml

### Deploy your app

Run `plash_deploy`. Your app will be live at
`https://<app-name>.pla.sh`. The URL will be shown in the deployment
output.

### App Dependencies

If your app needs additional dependencies to run, we offer a number of
ways to have them included in your deployed app.

#### Python Dependencies

To have python dependencies installed in your deployed app, you can
provide a `requirements.txt` and it will be pip installed. By default,
all deployed apps have fasthtml as a dependency.

#### Non-Python Dependencies

For any other depencies of setup processes, you can provide a `setup.sh`
which will be executed during the build step of your app. For example,
you can use this to install apt packages (this is ran as root in your
apps container, so omit any `sudo`):

``` bash
#!/bin/bash
apt install <package_name>
```

#### Env Variables

If your app depends on secrets or other types of environment variables,
you can have them available in your deployed app by providing a
`plash.env`, which will be sourced during your apps startup. Here is an
example:

    export MY_ENV_VARIABLE=hijkl
    export ANOTHER_SECRET=abcdef

Inside of your running container, we automatically set an environment
variable (`PLASH_PRODUCTION=1`) so you are able to use it for checking
if your application is inside a Plash deployment or not.

## Databases

For apps that use persistent storage, we recommend sqlite. The docker
container your app runs in has a working directory of /app which is a
volume mounted to a folder that we hourly backup. Therefore, we
recommend placing your sqlite database somewhere in that directory. Note
when redeploying an app with plash_deploy, we automatically overwrite
existing files with the same name as those uploaded. Therefore to
prevent data loss, ensure any local database files do not clash with any
deployed database names that your app may set up. You can use the
environment variable `PLASH_PRODUCTION`, which we automatically set to 1
in your Plash container, to modify your apps behavior for local and
production development. You can download any deployed database names by
clicking the Download App button to get a compressed file of all files
in your /app folder in your deployed app.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/AnswerDotAI/plash_cli",
    "name": "plash-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "nbdev jupyter notebook python",
    "author": "Jeremy Howard",
    "author_email": "info@fast.ai",
    "download_url": "https://files.pythonhosted.org/packages/05/54/d207f35833e37b34a921b8b0fc83f9dd419337051f6a9946a7fb40d5e90c/plash_cli-0.0.2.tar.gz",
    "platform": null,
    "description": "# plash-cli\n\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n**WARNING** - Plash is in Beta and we have released it in its\nsemi-stable state to gather early feedback to improve. We do not\nrecommend hosting critical applications yet.\n\n## Usage\n\n### Installation\n\nInstall latest from the GitHub\n[repository](https://github.com/AnswerDotAI/plash-cli):\n\n``` sh\n$ pip install git+https://github.com/AnswerDotAI/plash-cli.git\n```\n\nor from [pypi](https://pypi.org/project/plash-cli/)\n\n``` sh\n$ pip install plash_cli\n```\n\n## Deploy Your First FastHTML App\n\n### Set Up Your Plash Token\n\nYou\u2019ll need to set a PLASH_TOKEN and PLASH_EMAIL environment variables\nto use Plash. To obtain these, do the following:\n\n1.  Signup for an account at https://pla.sh/\n2.  Activate your Plash subscription\n3.  Follow instructions in your Plash dashboard to save credentials\n    locally\n\n### Create a FastHTML App\n\nCreate a directory for your FastHTML app, and go into it:\n\n``` sh\nmkdir minimal\ncd minimal\n```\n\nCreate `main.py` containing:\n\n``` python\nfrom fasthtml.common import *\n\napp, rt = fast_app()\n\n@rt\ndef index():\n    return H1(\"Hello world!\")\n\nserve()\n```\n\nThen create a requirements.txt containing:\n\n    python-fasthtml\n\n### Deploy your app\n\nRun `plash_deploy`. Your app will be live at\n`https://<app-name>.pla.sh`. The URL will be shown in the deployment\noutput.\n\n### App Dependencies\n\nIf your app needs additional dependencies to run, we offer a number of\nways to have them included in your deployed app.\n\n#### Python Dependencies\n\nTo have python dependencies installed in your deployed app, you can\nprovide a `requirements.txt` and it will be pip installed. By default,\nall deployed apps have fasthtml as a dependency.\n\n#### Non-Python Dependencies\n\nFor any other depencies of setup processes, you can provide a `setup.sh`\nwhich will be executed during the build step of your app. For example,\nyou can use this to install apt packages (this is ran as root in your\napps container, so omit any `sudo`):\n\n``` bash\n#!/bin/bash\napt install <package_name>\n```\n\n#### Env Variables\n\nIf your app depends on secrets or other types of environment variables,\nyou can have them available in your deployed app by providing a\n`plash.env`, which will be sourced during your apps startup. Here is an\nexample:\n\n    export MY_ENV_VARIABLE=hijkl\n    export ANOTHER_SECRET=abcdef\n\nInside of your running container, we automatically set an environment\nvariable (`PLASH_PRODUCTION=1`) so you are able to use it for checking\nif your application is inside a Plash deployment or not.\n\n## Databases\n\nFor apps that use persistent storage, we recommend sqlite. The docker\ncontainer your app runs in has a working directory of /app which is a\nvolume mounted to a folder that we hourly backup. Therefore, we\nrecommend placing your sqlite database somewhere in that directory. Note\nwhen redeploying an app with plash_deploy, we automatically overwrite\nexisting files with the same name as those uploaded. Therefore to\nprevent data loss, ensure any local database files do not clash with any\ndeployed database names that your app may set up. You can use the\nenvironment variable `PLASH_PRODUCTION`, which we automatically set to 1\nin your Plash container, to modify your apps behavior for local and\nproduction development. You can download any deployed database names by\nclicking the Download App button to get a compressed file of all files\nin your /app folder in your deployed app.\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "CLI for the Plash hosting service",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/AnswerDotAI/plash_cli"
    },
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b4e72886bd5bdc08c442bacae90f1b97cbb539f9e44e9ddeebd59b024459737a",
                "md5": "534632c45f3aad423c49bd5fa0f01c01",
                "sha256": "193eaf0fbea148d65c149c6b603ce86f5de77c3e4fc3b38c266bc690e59825d4"
            },
            "downloads": -1,
            "filename": "plash_cli-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "534632c45f3aad423c49bd5fa0f01c01",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 9585,
            "upload_time": "2025-03-20T15:05:45",
            "upload_time_iso_8601": "2025-03-20T15:05:45.159386Z",
            "url": "https://files.pythonhosted.org/packages/b4/e7/2886bd5bdc08c442bacae90f1b97cbb539f9e44e9ddeebd59b024459737a/plash_cli-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0554d207f35833e37b34a921b8b0fc83f9dd419337051f6a9946a7fb40d5e90c",
                "md5": "6fdd48c10a1ba356b4944c4fce576156",
                "sha256": "a669bb0c1e631723048f9ddfe5f0e6191d5a2905bf1591e55334f27a794f7a10"
            },
            "downloads": -1,
            "filename": "plash_cli-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6fdd48c10a1ba356b4944c4fce576156",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10192,
            "upload_time": "2025-03-20T15:05:47",
            "upload_time_iso_8601": "2025-03-20T15:05:47.063944Z",
            "url": "https://files.pythonhosted.org/packages/05/54/d207f35833e37b34a921b8b0fc83f9dd419337051f6a9946a7fb40d5e90c/plash_cli-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-20 15:05:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AnswerDotAI",
    "github_project": "plash_cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "plash-cli"
}
        
Elapsed time: 1.52655s