Saravanan666/pypi-org huggingface dataset:
Package: telethon-patch
Telethon-PatchA Wrap over Telethon (Telegram MtProto Library) with additional features.Installationpipinstalltelethon-patchUsageTo make telethon-patch to do it's work, add this lines before creating TelegramClientimporttelethonpatchFeaturesUse any Function without Importawaitclient.SendReactionRequest("chat",msg.id,reaction="👍")# or (Without 'Request' prefix)awaitclient.SendReaction(chat,msg.id,reaction="👍")Send Button linked to User's profilefromtelethon.tl.typesimportButtonuser=awaitclient.get_input_entity("me")button=Button.mention("Open Profile",user)awaitclient.send_message("username","Hey!, Message with mention Button",buttons=button)Chat Join Requests (In Detail)fromtelethonimportevents@client.on(events.JoinRequest())asyncdefexample(event):## Approve - Userawaitevent.approve()## Disapprove userawaitevent.reject()# or print Info of the user.print(awaitevent.get_user())Group Call Event (In Detail)@client.on(events.GroupCall())asyncdefgroupcall(group_call):ifgroup_call.started:print("Group Call Started!")returnifgroup_call.ended:print("Group Call Ended!")Message Extensionsmessage.message_link-Message link of message.message.comment()- Bound method to comment on channel or thread message.message.react()- Bound method to react on messages.Friendly Methods likeGroup callclient.start_group_callclient.join_group_callclient.leave_group_callclient.discard_group_callclient.get_group_callReactionclient.send_reaction(Topics)client.create_topicclient.edit_topicclient.get_topicsclient.join_chat(misc)client.toggle_hiddenclient.read (instead of send_read_acknowledge)(Photos)client.set_profile_photoclient.set_contact_photoEventsevents.GroupCallOccurs when certain action related to group call happens.started- Group call started.ended- Group call ended.scheduled- Whether a Group call has been scheduled.Methods.start(title, rtmp_stream, schedule)- Start a group call.discard()- End group call..toggle_record(start, video, video_portrait, title)- Toggle group call record.events.JoinRequestOccurs when new chat join request is sent..invite- ExportedChatInvite related to join request.about- User's about.Methods.approve()- Approve chat join request of user..reject()- Reject chat join request..get_user()- Get user sending request.Example of full functioning bot can be find inexamples
Package: telethon-pyaesni
Moduletelethon-pyaesnibrings even better performance toTelethonlib.Similar totelethon-tgcrypto, libAES-NI uses CPU hardware acceleration
to perform AES encryption and decryption.InstallationN.B.you must not havecryptginstalled, because it interferes with
this module.To install this module and patch your Telethon installation just run:pip install telethon-pyaesniCredits@painorfor making pyaesni and telethon-tgcrypto.@andrewfor writing readme for telethon-tgcrypto@lonami&contributorsfor makingtelethon
Package: telethon-secret-chat
Secret chat plugin for telethon,available on PyPi.This is still a work in progress so expect more commits to it. Originally
based on theEnd-to-End Encryption, Secret Chatsdocument, but it wasn’t
clear enough so I followed their advice and checked one of the implementations
that had it (MadelineProto). Therefore, this plugin is based onDaniil’s implementation at its core.Features☒ Accepting secret chats☒ Creating secret chats☒ Closing secret chats☒ Sending text messages☒ Recieving text messages☒ Uploading/downloading media☒ Dealing with rekeying[1]☒ Saving secret chats keys to database[2]☐ Saving messages to database[3]☒ Automatic decryption/accepting/finishing☐ Compatibility withtdlib[4][1]Every 100 messages you need to recreate the auth key.[2]Auth keys are saved client sides so if you restart the script you will
lose all secret chats you had and can no longer recieve messages from
them.[3]There is noget_messagesfunction in secret chats so users can’t see
old messages.[4]The secret chat implementation oftdlibdiffers from other clients,
so applications like Telegram X or the mac client may not work with
these chats.InstallationEasiest way is to install it throughpippipinstalltelethon-secret-chat~=0.2ExamplefromtelethonimportTelegramClientfromtelethon_secret_chatimportSecretChatManagerclient=TelegramClient(...)asyncdefreplier(event):# all events are encrypted by defaultifevent.decrypted_event.messageandevent.decrypted_event.message=="hello":awaitevent.reply("**hi**")# parse_mode is markdown by defaultasyncdefnew_chat(chat,created_by_me):ifcreated_by_me:print("User{}has accepted our secret chat request".format(chat))else:print("We have accepted the secret chat request of{}".format(chat))manager=SecretChatManager(client,auto_accept=True,new_chat_created=new_chat)# automatically accept new secret chatsmanager.add_secret_event_handler(func=replier)# we can specify the type of the eventwithclient:client.run_until_disconnected()To start a secret chat you can call:manager.start_secret_chat(target)To use sqlite as a storage session you need to pass an sqlite connection toSecretChatManager:manager=SecretChatManager(client,session=db_conn,auto_accept=True)# you can also pass client.session from telethon as suchmanager=SecretChatManager(client,session=client.session,auto_accept=True)To manually accept incoming you can do as follow:fromtelethon_secret_chatimportSecretChatManager,SECRET_TYPESmanager=SecretChatManager(client,auto_accept=False)manager.add_secret_event_handler(event_type=SECRET_TYPES.accept,func=accept_secret_chat_handler)In your handler, you can do the following:awaitmanager.accept_secret_chat(event.chat)
Package: telethon-session-sqlalchemy
ATelethonsession storage implementation backed bySQLAlchemy.Installationtelethon-session-sqlalchemy@ PyPIpipinstalltelethon-session-sqlalchemyUsageThis session implementation can store multiple Sessions in the same database,
but to do this, each session instance needs to have access to the same models
and database session.To get started, you need to create anAlchemySessionContainerwhich will
contain that shared data. The simplest way to useAlchemySessionContaineris to simply pass it the database URL:fromalchemysessionimportAlchemySessionContainercontainer=AlchemySessionContainer('postgres://user:pass@localhost/telethon')If you already have SQLAlchemy set up for your own project, you can also pass
the engine separately:my_sqlalchemy_engine=sqlalchemy.create_engine('...')container=AlchemySessionContainer(engine=my_sqlalchemy_engine)By default, the session container will manage table creation/schema updates/etc
automatically. If you want to manage everything yourself, you can pass your
SQLAlchemy Session anddeclarative_baseinstances and setmanage_tablestoFalse:fromsqlalchemy.ext.declarativeimportdeclarative_basefromsqlalchemyimportormimportsqlalchemy...session_factory=orm.sessionmaker(bind=my_sqlalchemy_engine)session=session_factory()my_base=declarative_base()...container=AlchemySessionContainer(session=session,table_base=my_base,manage_tables=False)You always need to provide eitherengineorsessionto the container.
If you setmanage_tables=Falseand provide asession,engineis not
needed. In any other case,engineis always required.After you have yourAlchemySessionContainerinstance created, you can
create new sessions by callingnew_session:session=container.new_session('some session id')client=TelegramClient(session)wheresome session idis an unique identifier for the session.
Package: telethon-session-sqlalchemy-fork
ATelethonsession storage implementation backed bySQLAlchemy.Installationtelethon-session-sqlalchemy@ PyPIpipinstalltelethon-session-sqlalchemyUsageThis session implementation can store multiple Sessions in the same database,
but to do this, each session instance needs to have access to the same models
and database session.To get started, you need to create anAlchemySessionContainerwhich will
contain that shared data. The simplest way to useAlchemySessionContaineris to simply pass it the database URL:fromalchemysessionimportAlchemySessionContainercontainer=AlchemySessionContainer('postgres://user:pass@localhost/telethon')If you already have SQLAlchemy set up for your own project, you can also pass
the engine separately:my_sqlalchemy_engine=sqlalchemy.create_engine('...')container=AlchemySessionContainer(engine=my_sqlalchemy_engine)By default, the session container will manage table creation/schema updates/etc
automatically. If you want to manage everything yourself, you can pass your
SQLAlchemy Session anddeclarative_baseinstances and setmanage_tablestoFalse:fromsqlalchemy.ext.declarativeimportdeclarative_basefromsqlalchemyimportormimportsqlalchemy...session_factory=orm.sessionmaker(bind=my_sqlalchemy_engine)session=session_factory()my_base=declarative_base()...container=AlchemySessionContainer(session=session,table_base=my_base,manage_tables=False)You always need to provide eitherengineorsessionto the container.
If you setmanage_tables=Falseand provide asession,engineis not
needed. In any other case,engineis always required.After you have yourAlchemySessionContainerinstance created, you can
create new sessions by callingnew_session:session=container.new_session('some session id')client=TelegramClient(session)wheresome session idis an unique identifier for the session.
Package: telethon-tgcrypto
Moduletelethon-tgcryptobrings better performance toTelethonlib.InstallationN.B.you must not havecryptginstalled, because it interferes with
this module.To install this module and patch your Telethon installation just run:pip install telethon-tgcryptoCredits@painorfor making this module@andrewfor writing this readme@tulirfor the basic implementation@lonami&contributorsfor makingtelethonunknowndeveloperfor the fast crypto module
Package: teletiffinfo
teletiffinfoRead metadata of remote TIFF according toTIFF6 spec(currently only reads width and height.)Requirementsserver must supportRANGE request.Why?For large TIFF files, it is often not feasible to download the full TIFF file in order to access the metadata.Installationvia pippipinstallteletiffinfoUsagefromteletiffinfoimporttry_tifftry_tiff("https://file-examples-com.github.io/uploads/2017/10/file_example_TIFF_10MB.tiff")# returns (1950, 1301)One could also add any custom headerfromteletiffinfoimporttry_tifftry_tiff("https://my.example.com/protected_tiff.tiff",{"Authorization":"Bearer ey..."})LicenseMIT
Package: teletvg-karjakak
TeleTVGTeleTVG created with Telethon [Telegram apis wrapper].For using TeleTVG, you need to create your own api-id and api-hash.Please visit:https://github.com/LonamiWebs/Telethon/blob/master/readthedocs/basic/signing-in.rstfor explanation.After create id and hash, it will store in user environment encrypted.The encryption method is using Clien-karjakak.https://pypi.org/project/Clien-karjakakInstallpip install -U teletvg-karjakakUsageFor Windows:> ttvgFor MacOS X:% ttvgWith script:from teletvg import main

main()HighlightSchedule message.To a user or multiple users in a group as one-to-one.Send message to a user or multiple users in a group as one-to-one.Send file to user or multiple users in a group as one-to-one.Text-expander.Expanding a simple abbreviation to a long words.Can write markdown text.Emoji Templates.Often used emojies can be saved and re-use.Take Note:Can only log-in as existing user.No Sign-Up as New User.No multiple account users log-in.Can Request for additional module:Need support donation :heart:For MacOS X:Emoji is disabled.[tkinter issue!]Emoji is Working in Python 3.10Changes:Some bugs fix on "GET REPLY" function.While event-loop on going, it will not run "GET REPLY" function.Will reassign "GET REPLY" again for next loop.Add for Help TeleTVG.pdf."Ctrl+F1" in Windows and "fn+F1" in MacOS X.Add protection archive.TIPSIf user want to copy with "Ctrl-v" on Get Reply message screen, make sure on the Send Message screen is empty. [Only works in Windows]"COPY" function only works on editable screen [Send Message screen].
Package: tele-upload
Tele-UploadUpload files to your Telegram channel or group with your telegram botFeaturesProgress barYou can change file name before upload on telegramNote : Bot can upload only 50 MB fileInstallationpip3installtele-uploadUsagetele-uploadsetup# setup your telegram credentialstele-uploadreset# reset to default your telegram credentialstele-uploadtest# test telegram bot tokentele-uploadup{file_name}# upload Telegram channel or grouptele-uploadd{url}# download and upload Telegram channel or groupAPIThe anonfile-upload client is also usable through an API (for test integration, automation, etc)tele_upload.main.test_token(bot_token)fromtele_upload.mainimporttest_tokentest_token(bot_token)# bot_token type strtele_upload.main.uploadd_file(bot_token, chat_id, file_name)fromtele_upload.mainimportuploadd_fileuploadd_file(bot_token,chat_id,file_name)# all arguments must be str
Package: televiewshka
TeleviewshkaNote: as for now, this is neither stable nor working code.
Being Created in ... purposes it is a subject for further updates and improvementsviewshka- Russian noun: informal of eng. "view", obtained by adding a diminutive suffix "shka"Televiewshka allows you develop UI & logic for telegram bots with class based views.
In views you can define its content and how user actions and replies must be handled on it.
When all stuff related particular step in user flow is held in one class, you can clearly
see relationship between componentsTeleviewshka supposed to be developed in such a manner to be compatible
with a bunch of libs and frameworks for telegram bot api widely used by communityI guess I should write few adaptors for this purpose someday(Supposed) ExamplefromtelebotimportTeleBotfromteleviewshkaimportKeyboardView,\KeyboardLayout,Button,adaptors,handler,render# create adaptor for your lib/frameworkbot=TeleBot("super-secret")bot=adaptors.create_adaptor(bot)# specify viewsclassFirstView(KeyboardView):@bot.action_handler(action="next")defgo_next(self,query:Query):returnrender("NextView",inplace=True,param=42)@staticmethoddefrender():returnKeyboardLayout(keyboard=(Button("Go next",on_click="next"),))classNextView(KeyboardView):@bot.action_handler()defback(self,query:Query):returnrender(FirstView,inplace=True)@staticmethoddefrender(param:int):returnKeyboardLayout(text=f"Passed param:{param}",keyboard=(Button("Go back",on_click="back"),))# run the botbot.start()Some details explainedViewssomething that can be rendered to user
and than handle user actions on itselves
actions are dispatched to appropriate view' and method
in accordance with user state (e.g. current_scene flag)
which is set when the view is renderedDispatchmessages are being dispatched according to user' state
state = current view
callback data or message = view methodUser statepass
Package: televize
Script to playCzech Television (Česká televize)streams in custom video player.InstallationDirectly using pip:pip install televizeDependenciespython >=3.5Any player which supports internet playlists.mpvis used by default.Other dependencies are listed inrequirements.txt.Usagetelevize live 24  # CT24
televize live D  # CT:D
televize live sport  # CT-sport
televize ivysilani http://www.ceskatelevize.cz/ivysilani/11276561613-kosmo/
televize ivysilani http://www.ceskatelevize.cz/porady/11276561613-kosmo/215512121020005-triumfComplete usage is printed using–helpargument:televize --helpmacOSTo open stream in a native player on macOS (e.g. VLC), use–playercommandopen -a APP –args.
For example:televize --player "open -a VLC --args" live 24RecommendationsA reload scripthttps://github.com/4e6/mpv-reloadis highly recommended formpv.AcknowledgementBased on Perl scriptstelevizeandctstreamfrom Petr Písař (http://xpisar.wz.cz).Changelog0.6.0 (2021-04-23)Support python 3.6-3.9.Restore certificate verification.Update README.Update settings for tests, static checks and CI.Resolve various warnings.0.5Fix after ceskatelevize.cz switched to HTTPS.Fix PyPI description by using ReST for readme and changelog.0.4Fix pypi upload0.3Add support for “pořady” URLs.Fix live streams after CT update in April.0.2Add–qualityargument to select stream quality.Better exception handling.
Package: televoice
Transcribe WhatsApp voice notesTranscribe looong voice notes so you can read instead of listening.Set environment variablesTELEVOICE_BOT_TOKEN: Telegram token from bot created using@BotFatherTELEGRAM_CLIENT_ID: Telegram client ID from@userinfobotOPENAI_API_KEY: OpenAI API key fromOpenAIInstallationpipinstalltelevoiceLaunch the bottelevoiceCaveatsCurrently hard-coded to transcribe Spanish voice notes.
Package: telewater
telewaterA telegram bot that applies watermark on images, gifs and videos.FeaturesFastbecause it is made using async libraries.Simpleto use.Any one who uses an instance of the bot will have to use the same watermark and position. This is meant to be used bysingle person/organization(by only you or your team), as configuration is stored at a global level instead of per user basis.No databaseconnection required.Itdoes not store media(photos/videos/gifs) on the server. Media is deleted immediately after the watermarked version is sent to the user.Watch thisvideo on YouTubeto learn how to use and deploy this bot.UsageUsing the bot is very simple. Just send a photo, video or gif to the bot. The bot will reply with the watermarked media.The bot commands/setand/getcan set and get the value of the configuration variables. The commands are simple and intuitive. The bot will show you the usage if you send an incorrect argument.DeployClick onthis linkand getfree 100$on Digital Ocean.NOTEYou will get nothing if you directly sign up from Digital Ocean Home Page.Use the linkabove, orclick on the big fat buttonabove to get free 100$.Read theGuide to Deploy to Digital Ocean.This application can also be easily deployed to Heroku, which is extremely good if you want to enjoy a free tier.You mayread furtherto learn about more more deployment options.Click on the above button. A form will appear, where you need to enter the credentials for the bot. After the app is deployed sucessfully,turn on the woker dynoto start the bot.InstallationThe following is the guide to installtelewateron your computer, or VPS.If you are a beginner, don't bother yourself with these. Just go ahead with the heroku method described abvoe.If you are familiar withDockerthenclick hereotherwise, continue reading.RequirementsMake sure to have these installed in your system.python3.9+andpip(the bot is built with the telethon library)ffmpeg(used by the bot for applying watermark)VerificationOpen you terminal to check if you have all basic requirements properly installed.Runpython --versionand you should get something like thisPython 3.9.2(or above).Runpip --versionand you should getpip 20.2.2(or above).Some systems may require to usepython3andpip3instead of the above.Runffmpeg -hand it should display a help message and version above4.2.4.Install via pippipinstalltelewaterStartingtelewaterTelewater has a simple command line interface to start the bot.Simply open your terminal and runtelewater. It will prompt you to enter the required information.Further readingEnvironment VariablesTelewater CLI usageInstall and run using dockerDeploy to Digital OceanRun multiple instancesFor any further help, feel free tocreate an issuein the GitHub repo.
Package: telewrap
TelewrapTelewrap is a Python package that can make your life as a developer so much easier.
With this tool, you don't have to constantly check your shell to see if your code has finished compiling or if your model has finished training.
Telewrap sends notifications straight to your telegram, freeing you up to focus on other tasks or take a break, knowing that you'll be alerted as soon as the job is done.Getting startedTLDRFor those of you that just want it to work:pipinstalltelewrap
tlconfigure# then follow the instructionstlwsleep5InstallationTo install Telewrap, run:pip install telewrapThis will install two command line interfaces:tlandtlw.ConfigurationTo configure Telewrap, run the following command and follow the printed instructions:bash tl configureBy default, the configuration file is saved in the expanded path~/.config/.telewrap.config. If you want to save it to a different directory, you can use the environment variableTELEWRAP_CONFIG_DIR. For example, the following command will save the configuration file under /tmp/.telewrap.config:TELEWRAP_CONFIG_DIR=/tmptlconfigureUsageCommand lineTo wrap a command line program until it finishes and get the result in your Telegram chat, run:tlwmy_programIf your command has any flags that are conflicting withtlyou can use the following formstlw--my_program--help# preferable as it allows for autocompletetlw"my_program --help"In a Python scriptIt's possible to use telewrap to keep track of the progress when executing lengthy blocks of code.
The following example works in Python scripts and Python notebooks.fromtelewrapimportTelewrapwithTelewrap():whilei<10:long_function()i+=1If you're using it in code you can even set the status_func and end_func to change the messages so that they fit your needs:fromtelewrapimportTelewrap,message_funcsimporttimei=0defstatus_func(x):returnf"Current iteration{i}\n{message_funcs.default_status_func(x)}"defend_func(x):returnf"Tada!!"withTelewrap(status_func=status_func,end_func=end_func):whilei<10:# A long functiontime.sleep(1)i+=1Some Useful ExamplesTelewrap is a valuable tool that for any task that requires waiting, one example is checking the availability of a website. All you need to do is write a script that checks whether a website is ready or you can use the one inexamples/is_website_ready.py.
Then just run:tlwpythonexamples/is_website_ready.pyhttps://google.comThis will provide you with a notification as soon as the website is available.
Package: telewrapper
TelewrapperTelegram API wrapper based on Telethon.Hierarchytelewrapper
|---- TeleUrlBtn()
|---- TeleBtn()
|---- Telewrapper()
|   |---- stop_loop()
|   |---- start_loop()
|   |---- new_cmd_event()
|   '---- new_msg_event()
|---- TeleCmd_start()
'---- TeleMsg_Echo()ExamplepythonSeetest.
Package: telexception
TelexceptionTelexception is a Python module that helps track raised exceptions in your code. When an exception is raised, Telexception sends a message to a specified Telegram chat.FeaturesSends automatic notifications to Telegram when exceptions are raisedCan send traceback and log files for more detailed troubleshootingEasy to integrate into existing Python projectsInstallationYou can install Telexception using pip:pipinstalltelexceptionUsageCreate telegram bot via @BotFather and get API_KEYGet user_id (you can find other telegram bots who can provide this information like @userinfobot)initialize the bot with your API key and user ID:bot=Telexception("api_key","user_id")Also you can send traceback or log file:bot=Telexception("api_key","user_id",send_traceback=True,path_to_logs='path/to/logs.log')Then, use the exception_handler decorator on any function you want to track:@bot.exception_handlerdefsome_function_with_problems(*args,**kwargs):passWhen some_function_with_problems raises an exception, a message will be sent to the specified Telegram chat.LicenseThis project is licensed under the terms of the MIT license.
Package: telfhk0
Hello dear friend who uses our librarythis module is at your service with speed and security!What is Telegram FHK module?It means “Telegram for hackers”.Why is this module trusted by hackers?Because this module is written with simple codes and has high speed and is safe!To read the module document, refer to the channel below :https://t.me/TelfhkWhat are the features of this module?High speedsafeSend message without filter for IraniansDownload the file from the site through a robot without filters for IraniansHas practical methodsUpdated every month + new optionsTo be able to use the module, be sure to subscribe to our channel!
Package: telget
TELGET - getting info about telegram usernames (Ver 1.0.0) .a small package for getting info about telegram accounts .USAGE1 - IMPORT PACKAGE>>> from telget import Username2 - MAKE OBJECT>>> username = "telegram_username">>> account = Username(username)3 - GET INFO ABOUT USERNAMEGET Account TYPE (Channel or Group or ....) ->>>> account.getType()GET Bio ->>>> account.getBio()GET Members (for channels and groups) ->>>> account.getMembers()Download And Save Profile Photo ->>>> account.getProfilePhoto(path_to_save)Have Fun ...