1
0
Fork 0
mirror of synced 2026-12-06 18:52:25 +00:00
No description
Find a file
Parker Wahle fea559b950 pypi
2022-01-26 21:16:11 +00:00
replutil pypi 2022-01-26 21:16:11 +00:00
tests Initial commit 2022-01-26 20:19:40 +00:00
.breakpoints Initial commit 2022-01-26 20:19:40 +00:00
.gitignore Initial commit 2022-01-26 20:19:40 +00:00
.replit Initial commit 2022-01-26 20:19:40 +00:00
LICENSE Create LICENSE 2022-01-26 15:34:57 -05:00
poetry.lock Initial commit 2022-01-26 20:19:40 +00:00
pyproject.toml pypi 2022-01-26 21:16:11 +00:00
README.md pypi 2022-01-26 21:16:11 +00:00

replutil

A collection of utilities for running services on repl.it.

Includes utilities for getting attributes of the container, as well as keeping the container alive using the UptimeRobot API.

KeepAlive Example

You can obtain a token on the the UptimeRobot dashboard.

from replutil import *
from time import sleep
import logging

logging.basicConfig(level=logging.INFO)

with ReplKeepAlive("token"):
    # Do your long running operations here...
    sleep(40)

Registering servers, ports, and watchers are abstracted away from the end user.

When used as a context manager, the library will automatically handle registering and deregistering watchers as well as staring and keeping open webservers.

Yes, all you need to have your repl container run forever is a single line and an indent. No hacker plan, freedom!

If this is used in a larger project, like, say, a Discord bot, you should do any asyncio event loop logic (including Client.run) in the context manager scoping block as it creates processes.

Install

You can install this package via pip:

pip install replutil