Metadata-Version: 2.4
Name: streamlit-wakeup
Version: 0.2.2
Summary: Wake sleeping Streamlit Community Cloud applications.
Author: Dev Bhuyan
License: MIT
Keywords: streamlit,streamlit-community-cloud,resume,wake,automation
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Dynamic: license-file

# streamlit-wakeup

[![PyPI version](https://img.shields.io/pypi/v/streamlit-wakeup.svg)](https://pypi.org/project/streamlit-wakeup/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/DevBhuyan/streamlit-wakeup)

A lightweight Python library and CLI tool to automatically wake up sleeping Streamlit Community Cloud applications.

---

## 🚀 Installation

Install the package directly from PyPI:

```bash
pip install streamlit-wakeup
```

---

## 🛠️ Usage

You can use `streamlit-wakeup` either as a Python module, a terminal command, or a continuous daemon.

### 1. Command Line Interface (CLI)
Once installed, you can trigger a wake-up signal directly from your terminal:

```bash
streamlit-wakeup https://your-app.streamlit.app
```

#### Keep-Alive Daemon Loop
To keep your app alive continuously on a local machine or server, use the `--interval` flag to ping your deployment at specific intervals (in seconds):

```bash
# Keep the app awake by pinging it every 5 minutes (300 seconds)
streamlit-wakeup https://your-app.streamlit.app --interval 300
```

### 2. Automated GitHub Actions Setup
You can completely automate the keep-alive process using a free GitHub Actions workflow. Run the initialization command at the root of your local repository:

```bash
streamlit-wakeup --init
```

This will automatically scaffold out a `.github/workflows/streamlit_keep_alive.yml` workflow template. Just update the URL inside that file, commit it, and push it to GitHub!

### 3. Python Module
If you want to integrate the wake-up logic directly into another automation script:

```python
from streamlit_wakeup import wake_up

# Send a single secure wake-up API call
response = wake_up("https://your-app.streamlit.app")
print(f"Status: {response.status_code}")
```

---

## 📝 License

Distributed under the MIT License. See `LICENSE` for more information.

Developed with ❤️ by [Dev Bhuyan](https://github.com/DevBhuyan).

