If you like the package please can you star the github.
Development of the package is currently temporarally paused i will continue if issues or suggestions are posted.
██████╗ ██╗███╗ ██╗ ██████╗ ███████╗███████╗██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██║████╗ ██║██╔════╝ ██╔════╝██╔════╝██╔══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║██╔██╗ ██║██║ ███╗ ███████╗█████╗ ██████╔╝██║ ██║█████╗ ██████╔╝
██╔═══╝ ██║██║╚██╗██║██║ ██║ ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██╔══╝ ██╔══██╗
██║ ██║██║ ╚████║╚██████╔╝ ███████║███████╗██║ ██║ ╚████╔╝ ███████╗██║ ██║
╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝
built by @Necrownyx
PingServer
PingServer is a python package that makes things more convenient to set up a server to be pinged by uptimerobot.com this package is most useful on sites like replit.com where your program might shut down after being idle for too long
Usage
First import the package with:
pip install PingServer
Then import it with:
import PingServer
Then add this one line to start the server:
PingServer.start()
The start() command has an optional parameter for a message on the web page to be pinged.
How to run on a thread.
If you want to run the server on its own thread you can put this in your code:
PingServer.thread().start()
This module of the package can also take a custom message for example:
PingServer.thread("hello, world!").start()
Will output "hello, world!" on the webpage.
How to serve multiple pages.
If you want to serve multiple different pages first create the page use either:
PingServer.create_page(route, message)
with route being the route of the site for example: '/' and message being the message to be served to users or a html file name for example index.html this file must be in the templates directory of your project.
You can loop through this as many times as you want.
Then when you have defined all of the pages for your site run:
PingServer.launch_pages().start()
To run all the sites on a thread or:
PingServer.launch_pages_nothread()
To run the sites on the main thread.
Background.
This is the first python package I have ever made and is somewhat of a tutorial for myself with something I will be able to use for things like discord bots on replit.com and more.
Metadata
Release files for PingServer 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| PingServer-1.0.1.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PingServer-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / PingServer-1.0.1.tar.gz
| Download URL | PingServer-1.0.1.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31129c822067d1feb114993e59a10333532a18dbc8d5576e1af2a6847b84161b
|
|
BLAKE2b-256 checksum How to use checksums |
6e26344f673a507b4ec922363d0fbfaad70d93dc3359f4bb533ddf02aab8e947
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / PingServer-1.0.1-py3-none-any.whl
| Download URL | PingServer-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83b8137d097e2660e1b85c1f74268ab004740e3be2e7916b82ebb3e5ebed6140
|
|
BLAKE2b-256 checksum How to use checksums |
aa4a7d9af9ff1580db59c655958cebf6e005304d64a8d3315660690d9e065029
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|