Skip to main content

A collection of utilities for running services on repl.it

Project description

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

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

replutil-0.1.1.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

replutil-0.1.1-py3-none-any.whl (16.1 kB view hashes)

Uploaded Python 3

Supported by

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