Saravanan666/pypi-org huggingface dataset:
Package: telemulator3
Library telemulator3The free, open-source telemulator3 library designed to simplify automatic testing of Telegram bots created using thepyTelegramBotAPI library.The telemulator3 library partially emulates the Telegram Bot API in unit tests and allows you to create typical scenarios for the interaction of your bot with the Telegram Bot API.Installationpipinstalltelemulator3UsageCreate TeleBot instance and start emulate Telegram API for bot.fromtelebotimportTeleBotfromtelemulator3importTelemulatorbot=TeleBot('xxx-yyy-zzz',threaded=False)@bot.message_handler(commands=['start','help'])defsend_welcome(message):bot.reply_to(message,"Howdy, how are you doing?")telemul=Telemulator()telemul.set_tested_bot(bot,username='my_bot',name='My Bot')At start, there are no registered users in emulated API.assertnottelemul.api.usersMake API user, that represent our bot.
It's a first registered user.mybot=telemul.api.get_me()assertmybot.is_botassertmybot.username=='my_bot'assertlen(telemul.api.users)==1New user open private chat with bot and send/startcommand.
Bot must answer as defined and his answer must be in chat history.fromtelemulator3importsend_commanduser=telemul.api.create_user('User')chat=user.private()send_command(chat,'/start',user)assertchat.history.contain('Howdy, how are you doing?')User create group and add bot as member.group=user.create_group('My group')group.add_members(user,[mybot])assertgroup.history.contain('invite new members:')And so on.mybot.leave(group)assertgroup.history.contain('My Bot (ID 1) left chat')# group.history.dump()Developmentgit clone git@github.com:vb64/telemulator3
cd telemulator3
make setup PYTHON_BIN=/path/to/python3
make tests
Package: tele-muninn
tele-muninnDocumentation:https://namuan.github.io/tele-muninnSource Code:https://github.com/namuan/tele-muninnPyPI:https://pypi.org/project/tele-muninn/Just like Alfred but for TelegramInstallationpipinstalltele-muninnUsageSetup following environment variables:export TELE_MUNINN_BOT_TOKEN=Run following command:tele-muninnDevelopmentClone this repositoryRequirements:PoetryPython 3.7+Create a virtual environment and install the dependenciespoetryinstallActivate the virtual environmentpoetryshellTestingpytestReleasingTrigger theDraft release workflow(pressRun workflow). This will update the changelog & version and create a GitHub release which is inDraftstate.Find the draft release from theGitHub releasesand publish it. When
a release is published, it'll triggerreleaseworkflow which creates PyPI
release and deploys updated documentation.MakefileRunmaketo see the list of available commands.
Package: telenib
telenibRead header of remote nifti according tonifti1 specandnifti2 speceither gzipped or not.Requirementsserver must supportRANGE request.requestsnibabelWhy?For large nifti files, it is often not feasible to download the full nifti file in order to access the header.Installationvia pippipinstalltelenibUsagefromtelenibimportget_nii_headerfromnibabelimportNifti1Header,Nifti2Headernii_url="https://nifti.nimh.nih.gov/nifti-1/data/avg152T1_RL_nifti.nii.gz"tele_header=get_nii_header(nii_url)assertisinstance(tele_header,Nifti1Header)orisinstance(tele_header,Nifti2Header)One could also add any custom headerfromtelenibimportget_nii_header# from https://nifti.nimh.nih.gov/nifti-1/datanii_url="https://my.example.co/my/dir/nii.nii.gz"tele_header=get_nii_header(nii_url,headers={'Authorization':f'token my-secret-token'})print(tele_header)LicenseMIT
Package: telenor-nbiot
# nbiot-python[![Travis-CI](https://api.travis-ci.com/telenordigital/nbiot-python.svg)](https://travis-ci.com/telenordigital/nbiot-python)NBIoT-Python provides a Python client for the REST API for Telenor NB-IoT.## ConfigurationThe configuration file is located at `${HOME}/.telenor-nbiot`. The file is a simplelist of key/value pairs. Additional values are ignored. Comments must startwith a `#`:## This is the URL of the Telenor NB-IoT REST API. The default value is# https://api.nbiot.telenor.io and can usually be omitted.address=https://api.nbiot.telenor.io## This is the API token. Create new token by logging in to the Telenor NB-IoT# front-end at https://nbiot.engineering and create a new token there.token=<your api token goes here>The configuration file settings can be overridden by setting the environmentvariables `TELENOR_NBIOT_ADDRESS` and `TELENOR_NBIOT_TOKEN`. If you only use environment variablesthe configuration file can be ignored.  Finally, there is a Client constructor thataccepts the address and token directly.## Updating resourcesThe various `Client.update*` methods work via HTTP PATCH, which means they will only modify or set fields, not delete them.  There are special `Client.delete*tag` methods for deleting tags.# Sample code```pythonfrom nbiot import nbiotclient = nbiot.Client()stream = await client.collection_output_stream('<YOUR_COLLECTION_ID>')while True:try:msg = await stream.recv()except nbiot.OutputStreamClosed:breakprint(msg.payload)```# DevelopmentDevelopment is done using [Pipenv](https://docs.pipenv.org/).  Run `pipenv sync --dev` to install all dependencies.Because Python has not properly solved dependency management yet, dependencies must be be repeated in [setup.py](setup.py) under the `install_requires` entry.## TestingTests are written using [pytest](https://pytest.org/).  Run `pipenv run pytest` to run all the tests.## DeploymentTo build and upload a new version to PyPI, make sure that you are using Python 3 and run```bashpython setup.py sdistpython setup.py bdist_wheeltwine upload dist/*          # `pip install twine` to get this tool```
Package: telenor_web2sms
InstallationTo install telenor_web2sms run:$ pip install telenor_web2smsConsole app usageQuick start:$ telenor_web2smsShow help:$ telenor_web2sms --helpPython API usageQuick start:>>> from telenor_web2sms import TelenorWeb2SMS
>>> web2sms = TelenorWeb2SMS('username', 'password') # Authenticate
>>> web2sms.send_sms('phone_number', 'message') # Send SMSContributeIf you find any bugs, or wish to propose new featuresplease let me know.If you’d like to contribute, simply forkthe repository, commit your changes
and send a pull request. Make sure you add yourself toAUTHORS.New in telenor_web2sms 1.0.2Minor tweak in README.
Package: telenotipy
HumanTech - Telegram Notification - Python ClientHow to install$ pip install telenotipyHow to useCreate a new TelegramNotificationClient with your API tokenfromtelenotipyimportTelegramNotificationClientclient=TelegramNotificationClient('API TOKEN')The token must be retrieved from the TeleNotiPy server instance.Send notifications to your users!client.send_notification(to=['UserID1','UserID2']message="Hi from My Application")Simple flowFirst you want to send a subscription to a Telegram UserfromtelenotipyimportTelegramNotificationClientclient=TelegramNotificationClient('MY API TOKEN')subscription=client.create_subscription()# Send subscription.id to a Telegram user# The user must send the command /start followed by this token to the bot# This can be simplified by giving the user a Start link:# - https://telegram.me/MyTeleNotiPyBot?start=TheSubscriptionIDThen you might want to check if the user has accepted the subscriptionfromtelenotipyimportTelegramNotificationClientclient=TelegramNotificationClient('MY API TOKEN')subscription=client.get_subscription(the_subscription_id)print(subscription.is_bound)# If the subscription is bound, it means that the user has acceptedYou want to send notifications to one or more Telegram UsersfromtelenotipyimportTelegramNotificationClientclient=TelegramNotificationClient('MY API TOKEN')client.send_notification(to=[the_subscription_id_1,the_subscription_id_2,...]message="Hi, here is my message!")Advanced usageUse a different serverclient=TelegramNotificationClient('API TOKEN','The telenotipy server address')Create a new subscriptionsubscription=client.create_subscription()subscription.id# The User Tokensubscription.is_bound# Whether the subscription is bound to a Telegram User, is False when creatingList your existing subscriptionssubscriptions=client.list_subscriptions(page=1)subscriptions.previous_page# The Previous page numbersubscriptions.next_page# The Next page numbersubscriptions.count# The total count of subscriptions (all pages)subscriptions.results# The list of subscriptionsGet the info about an existing subscriptionsubscription_id='The Subscription ID'subscription=client.get_subscription(subscription_id):subscription.id# The User Tokensubscription.is_bound# Whether the subscription is bound to a Telegram UserDelete an existing subscriptionsubscription_id='The Subscription ID'client.delete_subscription(subscription_id):
Package: telenvi
telenviSome remote sensing tricks from telenvi master students.
Contain tools to work on satellites images. You can easily load georeferenced raster files in python, compute indices on them or extract their values, then make crops, resample and reprojection.GitHub repoThe code is available here : github.com/pyzak117/telenviDependanciesto work with telenvi you need the following libraries:gdalnumpygeopandasmatplotlibpillow (PIL)shapelyInstallationpip install telenviUse from a python scriptfrom telenvi import raster_tools as rt
Package: teleoss
Tele LogCommand line toolkit for tele osshow to commpilepythonsetup.pysdistbdist_wheelhow to releasetwineupload-rpypidist/*.whlhow to installpipinstallteleosshow to use# initial, in the main moduleimportloggingfromtelelogimportget_loggerlogger=logging.getLogger()logger=get_logger(logger)logger.info("hello main module")# in othre moduleimportlogginglogger=logging.getLogger(__name__)logger.info("hello other module")
Package: teleout
TeleoutPipe stdout and files to telegramThis software uses telegram botsPowered with loveExamplesls -la | teleout -u 418878871 -c- send output ofls -lato chat418878871with monospace fontteleout -u 418878871 -f main.py "<b>This is main.py!</b>" --html- send filemain.py, with bolded text "This is main.py!"FeaturesSend files, text messages directly to telegramPipe to teleout(ls | teleoutwill work)HTML parse mode supportedEasy install and useCaptions for filesManualusage:main.py[-h][-uUSER][-fFILE][-c][-F][-tTOKEN][-n][-q][--html][--ansi-colors][message[message...]]Pipestdoutandfilestotelegram(viabots).

positionalarguments:messagespecifytextofmessagetosend,overwritespipes.

optionalarguments:-h,--helpshowthishelpmessageandexit-uUSER,--userUSERspecifyuserwithchat_idtosend-fFILE,--fileFILEsendfile,textwillbesentascaption.-c,--codesendtextwith<code>texttomakeitmonospace,applytagsescapingandsendashtml-F,--force-filesendtextinfileevenifitisshorterthan4096symbols-tTOKEN,--tokenTOKENspecifytelegramapitoken.ifnotsetwillusedefault-n,--newusewith--tokenor--usertosetnewdefault-q,--quitesendmessagewithoutnotifications,defaultisfalse--htmlparseashtmlandapply<b>,<i>etc.tags--ansi-colorsdon'tremoveANSIescapecodesfrompipedstringsInstallationFrom pippip install teleoutFrom gitwgethttps://raw.githubusercontent.com/TeaDove/teleout/master/teleout/main.py-Oteleout.py&&chmodu+xteleout.pyGet bot token from@BotFatherStart teleout withteleout, enter your token, default chat id.Enjoy!Works fine on Linux and Mac OS.don't worry, there are no sniffer and smth like thatfor feedbacks, write mehereinspired byhttps://termbin.com
Package: telepath
telepathtelepathis a Django library for exchanging data between Python and JavaScript, allowing you to build apps with rich client-side interfaces while keeping the business logic in server-side code.What does it do?It provides a mechanism for packing structured data, including Python objects, into a JSON-serializable format. This mechanism can be extended to support any Python class, by registering the class with a corresponding JavaScript implementation. The packed data can then be included in an HTTP response, and unpacked in JavaScript to obtain an equivalent data structure to the original. Think of it aspickle, but with the unpickling happening in the browser.Full documentation:https://wagtail.github.io/telepath/
Package: telephone
TelephoneusagefromtelephoneimportTelephonemizerfromdatasetsimportload_datasettelephonemizer=Telephonemizer()telephonemizer.convert_text("hello")ds=load_dataset("patrickvonplaten/librispeech_asr_dummy","clean",split="validation")telephonemizer.convert_voice(ds[0]["audio"]["array"])preprocessbartpythondata_preprocessing_bart.py--data./example/example.txt--mask_tok"<extra_id_0>"--poisson_lam20--mask_prob0.01--output_name./example/example_out_bart.csvt5pythondata_preprocessing_t5.py--data./example/example.txt--poisson_lam20--mask_prob0.15--output_name./example/example_out_t5.csv
Package: telepost
telepostGet post from telegram and make ready to repost it to other places (twitter / douban / reddit).usageimport telepost
import time
import plain_db
import asyncio

existing = plain_db.load('existing')
channel = 'twitter_translate'

post = telepost.getPost(channel, existing, min_time=1, max_time = time.time()) # get the first post outside existing ones

posts = telepost.getPosts(channel, min_time=1, max_time = time.time() - 24 * 10 * 60 * 60) # return a generator

async def run():
	# credential file need to contain telegram_api_hash, telegram_api_id and telegram_user_password
	post_id = 1392
	post_size = 2
	filenames = await telepost.getImages(channel, post_id, post_size)
	await telepost.exitTelethon()

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
r = loop.run_until_complete(run())
loop.close()how to installpip3 install telepost
Package: teleput
Teleput CLI ToolThis is a command-line script to send messages and files
to yourself with theTeleput Bot.
Install it like this:pip3 install --user teleputThen get a key from the bot (click the link above) and pass it to the tool:teleput -k YOUR_KEYNow sending messages to yourself is simple:teleput "Message"
pbpaste | teleput -And even files:teleput review.docx
teleput image.jpgNote that it tries to detect the file format, so images and sounds will
be compressed. To send files without compression, use--rawswitch:teleput -r image.jpgOnly one file can be sent. But you also can add a comment with a second argument:teleput image.jpg "Look at this image!"Author and LicenseWritten by Ilya Zverev, published under the ISC license.
Package: telepybot
TelepybotPython client for making your own Telegram bot!It has support for webhooks and it automatically handles the setup of self-signed SSL certificates, so you can run it even on a Raspberry Pi or any other home server/laptop (find an example of this inexamples/webhook_setup.py).Install with:pip -m install telepybotTo use it, just import the Telepybot class and pass it your bot's token:# Sending a simple messagefromtelepybotimportTelepybottelepybot=Telepybot(token='YOUR_BOT_API_TOKEN')user_id='123456'telepybot.sendMsg(user_id,'This message was sent using Telepybot!')See theexamples/directory for more examples.Feel free to use it for your own projects and be sure to create issues if something is not working right. Pull requests and feature requests are welcome.How to get an API Token?You can generate one using theofficial instructionsfrom Telegram, it should be fairly straightforward.
Package: telepy-notify
What is this?Super fast (<5min setup) telegram notifications for task-completion, task progress, errors and more. This is a minimal module (one file, no pip dependencies).How do I use this?pip install telepy_notifyTake 30sec to get a token:open up a chat withhttps://t.me/botfathersend/newbotto ^copy the token out of the response messageDM your bot to initialize it (important!)Use itfromtelepy_notifyimportNotifier## setup#notify=Notifier(# read from filetoken_path="some/file/thats/git/ignored/telegram.token",# # OR read from ENV var, ex:# token_env_var="TELEGRAM_TOKEN",# # OR give the token directly, ex:# token="alkdsfjakjfoirj029294ijfoi24j4-2",# optional: a prefix for all messages (good if multiple machines)message_prefix="Lambda Machine: Experiment 19:",# optional: set to true when debugging to avoid a million notificationsdisable=False,)# NOTE:#    other people can run your code without setting up a bot#    because telepy will NEVER throw errors#    if a notification fails, or if a token is bad#    it will intentionally only print warnings instead of#    crashing whatever long-running process you have## Basic notification#notify.send("Howdy!")notify.send("Howdy! <b>I'm bold</b>")notify.send("Howdy! <b>I'm bold</b>\n<code>thing = [1,3,4]</code>")## get duration and/or error information#withnotify.when_done:blah_blah_blah=10forblahinrange(blah_blah_blah):fromtimeimportsleepsleep(0.1)raiseException(f'''Hello Telegram :)''')# """# process took: 1sec, ended at: Sun Aug 20 11:23:38 2023 however it ended with an error: Exception('Hello Telegram :)')# """## Progress notifications##    - gives ETA and other time-info#    - can limit notify-rate (by time passed or percent-progress)#        e.g. percent_per_notify=50 => message me after 50% progress#        e.g. minutes_per_notify=30 => message once every 30min#    - notify_iter_delay is used to wait a few iterations before sending an ETA#      (makes the ETA of the first notification more accurate)forprogress,epochinnotify.progress(range(100),percent_per_notify=50,minutes_per_notify=30,notify_iter_delay=1):index=progress.index# do stuffimportrandomaccuracy=random.random()ifaccuracy>0.99:notify.send("Gottem 🎉🎉🎉")# end do stuffprogress.message=f"recent accuracy: <code>{accuracy}</code>"# that^ outputs:# message1:#     [=================>.................] 50.00%#     |  50/100#     | remaining: 0sec#     | eta: 11:52:48#     | elapsed: 0sec#     | recent accuracy: 0.5086382690344122# message2:#     Done in 1sec at 11:52:49
Package: tele-pyro
Telethon to PyrogramPyPi
Isort
Test
Lint
license
Gitter
Downloads
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)Simple script for convert telethon session file to pyrogram session fileFor use:Clone repogit clone git@github.com:semenovsd/Telethon-To-Pyrogram.gitInstall Telethon and Pyrogrampoetry installor user pippip install Telethon PyrogramRun convertor.pypython convertor.pyand follow instructions
Package: telepythy-service
Telepythy ServiceThis is the service library forTelepythy. This library has no dependencies, is supported on Python 2.7+ and 3.3+, and can be used to embed aTelepythyclient or server into any environment.To install, simply use:$pipinstalltelepythy-serviceYou can start the service directly on the command-line:$telepythy-svc[-c,--connect]'<host>:<port>'$telepythy-svc[-s,--serve]'<interface>:<port>'# or$python-mtelepythy...With no options, a server will start listening on the default interface and port:localhost:7373.To embed aTelepythyservice in your code, you can use any of the following functions:importtelepythy# start a server threadtelepythy.start_server()# or start a client threadtelepythy.start_client()# or start a client/server directly (blocking), with optional argumentstelepythy.client(locals={'client':True},address='localhost:7373')telepythy.server(locals={'client':False},address='localhost:1337')See the<telepythy>/examplesdirectory from theTelepythyrepository for examples on how to embed the service into existing code.
Package: teleredis
ATelethonsession storage implementation backed by Redis.UsageThis session implementation can store multiple Sessions in the same key hive.Installingpip3installteleredisUpgradingpip3install-UteleredisQuick startfromtelethonimportTelegramClientfromteleredisimportRedisSessionimportredis# These example values won't work. You must get your own api_id and# api_hash from https://my.telegram.org, under API Development.api_id=12345api_hash='0123456789abcdef0123456789abcdef'redis_connector=redis.Redis(host='localhost',port=6379,db=0,decode_responses=False)session=RedisSession('session_name',redis_connector)client=TelegramClient(session,api_id,api_hash)client.start()
Package: telerembash
TeleRemBashis aTelegramBotfor executing
scripts on a remote system, baked withTOTPAuthentication
for a secure and easy setup (QR codes).To keep things simpleTeleRamBashallows a single Telegram user
after a successfulTOTPAuthentication to execute a pre-defined
(bash) script by sending a command to the Bot in a Telegram chat, like this:/dosome-scriptoptional-param1UsageTo install from pypi:pipinstalltelerembashFirst create a configuration for your Telegram Bot instance by specifying
the bot’sAPI_TOKENand the Telegram username of the whitelisted user:telereminit--api-tokenAPI_TOKEN--usernameUSERNAMEthis should create atelerem.config.yamlin the current directory
and output a QR Code to be scanned in your TOTP Authenticator App (i.e.Google Authenticator,andOTP, etc).To see all available options, try:telerem--helpyou can edittelerem.config.yamlby hand or calltelerem initmultiple times,
to tweak the config.
Note thescripts_rootin the config - this is the location (absolute or relative to
the current working directory) of the directory containing the script your bot will
execute.To start the bot:teleremstart--configconfig.yamlOnce your bot is running, you should add it in a chat.
It will ignore all your messages until it sees a/auth<code>command, where<code>is the authentication code generated by
your TOTP Authenticator.And once you are successfully authenticated, you can execute a script
by sending a Telegram message like this:/dosome-script-nameparam1param2The bot will reply to a/docommand by looking underscripts_rootfor
a file with the namesome-script-nameorsome-script-name.shand executing it (with the provided optional parameters).Run as a Service (WIP)You can also create a systemd service or a daemon script for
running your bot in the background like this:telereminstall--systemd|sudobash# for systemdtelereminstall--initd|sudobash#   otherwisethis will:create a system userteleremdsetup a python venv under/home/teleremd/create a service (eithersystemdorinit.d):systemd service unit/etc/systemd/system/teleremd.servicedeamon script/etc/init.d/teleremdpopulate the daemon configuration under/etc/teleremd.config.yamland finally:sudosystemctldaemon-reload# for systemdsudosystemctlstartteleremdNEWS21.Jan.2021- available on pypi16.Jan.2021- install as a systemd service (init.d still WIP)15.Jan.2021- README: Usage instructions09.Jan.2021- initial commitLICENSEMIT. SeeLicense File.ResourcesTelegram- Telegram BOT APIPyOTP- The Python One-Time Password Librarypython-qrcode- QR code generator for text terminals