Skip to main content

Simple lib to deploy app using caprover

Project description

quickcap

Installation

pip install quickcap

Usage

Login

import os

caprover_server = os.environ.get("CAPROVER_SERVER") 
caprover_password =os.environ.get("CAPROVER_PASSWORD") 

token = caplogin(caprover_server, caprover_password)

Create a webcam app

First, create your app in a Python file:

example_app = """from fasthtml.common import *

app = FastHTML()

@app.route("/")
def home(): return Div(H1("Hello World!"), P("Deployed with CapRover API"))

serve()
"""

from pathlib import Path 
Path("myapp.py").write_text(example_app)
150

Setup and deploy

Create the app on CapRover with SSL and optional configuration:

app_name = "myapp"

setup_app(caprover_server, token, app_name, env_vars={"MY_SECRET": "supersecret123"})
{'status': 100, 'description': 'Updated App Definition Saved', 'data': {}}

Deploy your script:

# requirements: python package used by your app
requirements = ["python-fasthtml"]

deploy(caprover_server, token, app_name, "myapp.py", requirements)
{'status': 100, 'description': 'Deploy is done', 'data': {}}

Your app is now live at https://myapp.yourdomain.com!

Check logs

Runtime logs:

print(get_app_logs(caprover_server, token, app_name))
\x00\x00\x00\x00\x00\x00_2025-11-28T15:41:48.432303544Z INFO:     Will watch for changes in these directories: ['/app']
\x00\x00\x00\x00\x00\x00e2025-11-28T15:41:48.433467344Z INFO:     Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
\x00\x00\x00\x00\x00\x00W2025-11-28T15:41:48.433563845Z INFO:     Started reloader process [1] using WatchFiles
\x00\x00\x00\x00\x00\x0092025-11-28T15:41:48.439627618Z Link: http://localhost:80
\x00\x00\x00\x00\x00\x00D2025-11-28T15:41:48.885448868Z INFO:     Started server process [8]
\x00\x00\x00\x00\x00\x00J2025-11-28T15:41:48.885498426Z INFO:     Waiting for application startup.
\x00\x00\x00\x00\x00\x00G2025-11-28T15:41:48.885684464Z INFO:     Application startup complete.
\x00\x00\x00\x00\x00\x00R2025-11-28T15:41:56.441328792Z INFO:     10.0.1.5:56602 - "GET / HTTP/1.0" 200 OK
\x00\x00\x00\x00\x00\x00d2025-11-28T15:41:56.618178234Z INFO:     10.0.1.5:56612 - "GET /favicon.ico HTTP/1.0" 404 Not Found

Delete an app

delete_app(caprover_server, token, app_name)
{'status': 100, 'description': 'App is deleted', 'data': {}}

API Reference

Function Description
caplogin Login and get authentication token
setup_app Create app with SSL and configuration (recommended)
deploy Build and deploy FastHTML app from script(s)
get_app_logs Get runtime logs
get_app_deployment_logs Get build logs
delete_app Remove an app
create_app Register a new app (low-level)
update_app Update app configuration (low-level)
enable_ssl Enable HTTPS for an app (low-level)
upload_app Upload tar.gz archive (low-level)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quickcap-0.0.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quickcap-0.0.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file quickcap-0.0.1.tar.gz.

File metadata

  • Download URL: quickcap-0.0.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for quickcap-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3d807696445d07ec669657aa4d2cb0e97d2b883bdc439b5ed736e4bf8594285b
MD5 51dd6f48c67cde853db978df42caaee2
BLAKE2b-256 33c62e91b3fd3eb7d736f0dba5fcbca17caddebe779929753071f473e9df5ada

See more details on using hashes here.

File details

Details for the file quickcap-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: quickcap-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for quickcap-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01a7c009fbb33e843d90533a0cd20a73538269b9b011648077b29cd9a7f432d7
MD5 3117b10f11fe279ea36226b365f1d04d
BLAKE2b-256 efe035022a09e7e57d13b164e0bb8f9dfe795c2f6b5cb6014543cbe658b4cc66

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page