Project Description
pyteleprint
pyteleprint is a package for remote prints, notification and alerts for python programs. The notification mechanism is done via Telegram.
Why should I use this?
This is meant for users who want print() to be a remote notification and alert mechanism if they are not present at their workstation when the program is being executed or for a persisting python application.
Features
- Remote alerts
- Remote print
- Remote notification
Requirements
- Requires Python -v >= 3.4.0
- Telegram App
Installation
$ pip install pyteleprint
Initial Preparations
The Telegram app must be installed into your mobile system.
First, create a personal bot using (@BotFather). Once the creation process is done, you will receive an API token. Note this API Token for further use.
Using pyteleprint
Create a new script or use shell to execute the following code
from pyteleprint.printer.chat_extract import ChatIDExtractor
API_TOKEN = "YOUR_NEW_BOT_API_TOKEN" # Obtained from creating a bot through BotFather
ChatIDExtractor(API_TOKEN).start()
Once the script is executed, the program would start polling for messages to get chat id. Send a message to your new bot. This will help the program extract the chat id. Use this chat id to send notifications and alerts.
If in future, you delete or lose the chat thread, you can redo the above process to get the new chat id.
This chat id can be used statically in any application at any point in time iff the chat thread with the bot exists. But, if the user deletes the chat with their bot then they have to re-extract the chat id since there would be a new chat thread to communicate with the bot.
Now, you have the API Token and the chat id with you, use them to create a Printer object in your scripts and use the print() method to send notifications,prints and alerts.
from pyteleprint.printer.printer import Printer
API_TOKEN = "YOUR_BOT_API_TOKEN"
CHAT_ID = 12345 # Chat id obtained from ChatIDExtractor().start()
p = Printer(API_TOKEN,CHAT_ID)
p.print("Hello World")
Metadata
Release files for pyteleprint 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyteleprint-1.0.4.tar.gz | 2.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyteleprint-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.7 kB
Release files / pyteleprint-1.0.4.tar.gz
| Download URL | pyteleprint-1.0.4.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5727cadf8d419d67cec061a4049c808e998b812242df3cd2821f53f7b52350ef
|
|
BLAKE2b-256 checksum How to use checksums |
7b378f2df9a25e0fea696a0de71ac5e1acc67b9d3c34527f7cd7e1880eb95cff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.4.2 requests/2.21.0 setuptools/43.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.4.0
|
Release files / pyteleprint-1.0.4-py3-none-any.whl
| Download URL | pyteleprint-1.0.4-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d98efd3fee9f346b33482499e4c8636e0f966b5635e56a20b20213fed6a17c2
|
|
BLAKE2b-256 checksum How to use checksums |
dba15f74fd437e1efbf5052d60991065ce62ac0db1f06d0e80c715f5460a1614
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.4.2 requests/2.21.0 setuptools/43.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.4.0
|
Security for pyteleprint 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.