Saravanan666/pypi-org huggingface dataset:
Package: aiogmaps
aiogmapsAsyncio client library for Google Maps API Web ServicesRequirementsgooglemaps>= 3.0Getting StartedpipinstallaiogmapsUsageAPI KeyimportasynciofromaiogmapsimportClientasyncdefmain(loop):api_key='xxx'asyncwithClient(api_key,loop=loop)asclient:resp=awaitclient.place(place_id='ChIJN1t_tDeuEmsRUsoyG83frY4')print(resp)if__name__=='__main__':loop=asyncio.get_event_loop()loop.run_until_complete(main(loop))Client ID & SecretimportasynciofromaiogmapsimportClientasyncdefmain(loop):client_id='xxx'client_secret='xxx'asyncwithClient(client_id=client_id,client_secret=client_secret,loop=loop)asclient:resp=awaitclient.place(place_id='ChIJN1t_tDeuEmsRUsoyG83frY4')print(resp)if__name__=='__main__':loop=asyncio.get_event_loop()loop.run_until_complete(main(loop))DocumentationThis library works as a wrapper around official googlemaps library.For detailed API referencehttps://developers.google.com/maps/documentation/https://googlemaps.github.io/google-maps-services-python/docs/
Package: aiogoogle
AiogoogleAsyncGoogle API clientAiogoogle makes it possible to access most of Google's public APIs which include:Google Calendar APIGoogle Drive APIGoogle Contacts APIGmail APIGoogle Maps APIYoutube APITranslate APIGoogle Sheets APIGoogle Docs APIGogle Analytics APIGoogle Books APIGoogle Fitness APIGoogle Genomics APIGoogle Cloud StorageKubernetes Engine APIAndmoreDocumentation 📑You can find the documentationhere.
Package: aiogovee
aiogoveePython 3 /asyncio library for communication with Govee devices using their local API.This is my first time coding in Python, this library was written using François Wautier'saiolifxas sample / guide and adapted to communicate with the much simplerGovee Local APIInstallationThis library is published on PyPi so:pip3 install aiogoveeorpython3 -m pip install aiogoveeHow to control your Govee DevicesFirst, you need enable local API for each supported device:- Open the Govee App
 - Click on the Device
 - Click on the Gear signs at the top right corner
 - Turn On "Lan Control"NOTE: If your don't see the "Lan Control" switch, most likely your device is not supported, you can check the Govee Local API documentation linked above to for the list of supported devices, they update this document as they add support for more devices. If your device is listed there then either your device does not have the latest firmware or its hardware version is too old and does not support this feature (I've sees reports of this from some users), at this point your best bet it to contact Govee Support about it, they are very responsive and helpful.Once you have enabled "Lan Control" for your devices, you can test the library by using the example utility to fully manage your those Devices:python3 -m aiogoveeWhile the application is running, it will run discovery over each network interface available (including VLAN interfaces) every 5s (Library default is 180s but I configured it lower for this demo utility). Devices do not always respond to the discovery broadcast but they usually all show up after a couple of discovery attempts, just let the application run for a bit longer and hit enter to refresh the list of discovered devices.At the moment the API is very limited, these are the only supported operations:- Get Status
 - Turn On/Off
 - Change Brightness (0-100)
 - Change Color (R) (G) (B)
 - Change ColorTemperature in Kelvin (0-9000)How to use the LibraryEssentially, you create an object with at least 2 methods:- register
- unregisterYou then start the GoveeListener task in asyncio, passing the object created above, the IP of the desired network interface to run discovery on (you can start multiple GoveeListeners if you have multiple network interfaces to subnets with Govee devices) and the discovery interval in seconds (180s by default). It will register any new Device it finds.Once a device is registered, there are attribute methods for any of the supported actions in the API.The easiest way is to look at themain.py which is the demo utility included as an example of how to use the library.ThanksThanks to François Wautier, his aiolifx library which provided a great learning resource and base for this project.
Package: aiogql
This is a GraphQL client for Python. Plays nicely withgraphene,graphql-core,graphql-jsand any other GraphQL implementation
compatible with the spec.GQL architecture is inspired byReact-RelayandApollo-Client.Installation$ pip install aiogqlUsageThe example below shows how you can execute queries against a local
schema.fromgqlimportgql,Clientclient=Client(schema=schema)query=gql('''
{
  hello
}
''')client.execute(query)LicenseMIT
License
Package: aiogqlc
Asynchronous/IO GraphQL clientA Python asynchronous/IO GraphQL client based onaiohttp.In addition to standard HTTP POSTqueriesandmutationsthis client fully supports
theGraphQL multipart form requests specfor file uploads
and thegraphql-ws subprotocolfor WebSocket basedsubscriptions.Read the documentationInstallationpipinstallaiogqlcBasic usageCheck thedocumentationfor detailed and more advanced usage examples.QueriesimportasyncioimportaiohttpfromaiogqlcimportGraphQLClientENDPOINT="https://swapi-graphql.netlify.app/.netlify/functions/index"document="""query {allFilms {films {title}}}"""asyncdefmain():asyncwithaiohttp.ClientSession()assession:client=GraphQLClient(ENDPOINT,session=session)response=awaitclient.execute(document)print(awaitresponse.json())if__name__=="__main__":asyncio.run(main())MutationsimportaiohttpfromaiogqlcimportGraphQLClientdocument="""mutation ($userId: ID!) {deleteUser (id: $userId) {id}}"""variables={"userId":"42",}asyncdefmain():asyncwithaiohttp.ClientSession()assession:client=GraphQLClient("https://example.com/graphql/",session=session)response=awaitclient.execute(document,variables=variables)print(awaitresponse.json())File uploadsimportaiohttpfromaiogqlcimportGraphQLClientdocument="""mutation($file: Upload!) {uploadFile(file: $file) {size}}"""variables={"file":open("test.txt","rb")}asyncdeffoo():asyncwithaiohttp.ClientSession()assession:client=GraphQLClient("https://example.com/graphql/",session=session)response=awaitclient.execute(document,variables=variables)print(awaitresponse.json())SubscriptionsimportaiohttpfromaiogqlcimportGraphQLClientdocument="""subscription($postId: ID!) {likeAdded(postId: $postId)}"""variables={"postId":"42"}asyncdefmain():asyncwithaiohttp.ClientSession()assession:client=GraphQLClient("https://example.com/graphql/",session=session)asyncwithclient.connect()asconnection:asyncforpayloadinconnection.subscribe(document,variables=variables):print(payload)DocumentationRead the documentationto learn more about queries, mutations, subscriptions, file uploads and even authentication.
Package: aiogram
aiogramis a modern and fully asynchronous framework forTelegram Bot APIwritten in Python 3.8 usingasyncioandaiohttp.Make your bots faster and more powerful!Documentation:🇺🇸English🇺🇦UkrainianFeaturesAsynchronous (asyncio docs,PEP 492)Has type hints (PEP 484) and can be used withmypySupportsPyPySupportsTelegram Bot API 7.1and gets fast updates to the latest versions of the Bot APITelegram Bot API integration code wasautogeneratedand can be easily re-generated when API gets updatedUpdates router (Blueprints)Has Finite State MachineUses powerfulmagic filtersMiddlewares (incoming updates and API calls)ProvidesReplies into WebhookIntegrated I18n/L10n support with GNU Gettext (or Fluent)WarningIt is strongly advised that you have prior experience working
withasynciobefore beginning to useaiogram.If you have any questions, you can visit our community chats on Telegram:🇺🇸@aiogram🇺🇦@aiogramua🇺🇿@aiogram_uz🇰🇿@aiogram_kz🇷🇺@aiogram_ru🇮🇷@aiogram_fa🇮🇹@aiogram_it🇧🇷@aiogram_br
Package: aiogram2252-page
AiogramPaginationInline 2.25.2DescriptionA simple library for aiogram 2.25.2 that allows you to easily do pagination for any Inline keyboards.Install for pip:pipinstallaiogram2252-pageCreate paginations objectfromaiogram2252_page.paginatorimportPaginatorfromaiogramimporttypeskb=types.InlineKeyboardMarkup()paginator=Paginator(data=kb,size=5)Paramsdata: Any ready-to-use keyboard InlineKeyboardMarkup or any iterable object with InlineKeyboardButton.size: The number of rows of buttons on one page, excluding the navigation bar.ReturnA paginator object that, when called, returns a ready-made keyboard with pagination.Get data for registrations handler paginatorfromaiogram2252_page.paginatorimportPaginatorfromaiogramimporttypeskb=types.InlineKeyboardMarkup()paginator=Paginator(data=kb,size=5)@dp.message_handler()asyncdefsome_func(message:types.Message):awaitmessage.answer(text='Pagination ',reply_markup=paginator())Return paginator_handler()Data for registrations paginator.ExampleimportrandomfromaiogramimportBot,Dispatcher,typesfromaiogram.contrib.fsm_storage.memoryimportMemoryStoragefromaiogram.dispatcher.filtersimportCommandStartfromaiogram.utils.executorimportExecutorfromaiogram2252_page.paginatorimportPaginatortoken=''storage=MemoryStorage()bot=Bot(token=token)dp=Dispatcher(bot,storage=storage)@dp.message_handler(CommandStart(),state='*')asyncdefstart(message:types.Message):awaitmessage.answer('Hello world!')'''row_width - this parameter indicates the number of columns in the pagination'''kb=types.InlineKeyboardMarkup(row_width=2)kb.add(*[types.InlineKeyboardButton(text=str(random.randint(1000000,10000000)),callback_data='pass')foriinrange(100)])'''size is a parameter that indicates the number of rows in a column'''paginator=Paginator(data=kb,size=5,dp=dp,callback_startswith="page:")awaitmessage.answer(text='Paginator',reply_markup=paginator())if__name__=='__main__':Executor(dp).start_polling()ScreenshotsFirst page:Second page:Last page:Clicking on the current page number returns to the first pageThe order of entries is not lost.License MIT
Package: aiogram2-fork
This is a fork of the aiogram 2 framework. The creator of aiogram isAlex Root Junioraiogramis a pretty simple and fully asynchronous framework forTelegram Bot APIwritten in Python 3.7 withasyncioandaiohttp. It helps you to make your bots faster and simpler.You canread the docs here.Facts about the aiogram 2.0:The aiogram version 2.25.1 was used as a basisThere is support for a stable version of the Telegram Bot API (7.0)Official aiogram resourcesNews:@aiogram_liveCommunities:🇺🇸@aiogram🇺🇦@aiogramua🇺🇿@aiogram_uz🇰🇿@aiogram_kz🇷🇺@aiogram_ru🇮🇷@aiogram_fa🇮🇹@aiogram_it🇧🇷@aiogram_brPip:aiogramDocs:ReadTheDocsSource:Github repoIssues/Bug tracker:Github issues trackerTest bot:@aiogram_botUnofficial resourcesAiogram 2.0 source:Aiogram 2.0Issues/Bug tracker:Github issues tracker aiogram 2.0
Package: aiogram3b8-calendar
# Date Selection tool for Aiogram Telegram Bots## DescriptionA simple inline calendar, date selection tool for [aiogram](https://github.com/aiogram/aiogram) telegram bots written in Python.
Offers two types of date pickers:
Navigation calendar - user can either select a date or move to the next or previous month/year by clicking a singe button.
Dialog calendar - user selects year on first stage, month on next stage, day on last stageProject was forked for aiogram version 3.0.0b8 (3.0.0b7)## Usage
Install packagepip install aiogram3b8_calendarA full working example on how to use aiogram-calendar is provided inbot_example.py.
You create a calendar and add it to a message with areply_markupparameter and then you can process it in a callbackqueyhandler method using theprocess_selectionmethod.## Gif demo:![aiogram_calendar](https://j.gifs.com/nRQlqW.gif)
Package: aiogram3-calendar
Date Selection tool for Aiogram Telegram BotsDescriptionA simple inline calendar, date selection tool foraiogramtelegram bots written in Python.
Offers two types of date pickers:
Navigation calendar - user can either select a date or move to the next or previous month/year by clicking a singe button.
Dialog calendar - user selects year on first stage, month on next stage, day on last stageUsageInstall packagepip install aiogram3_calendarA full working example on how to use aiogram-calendar is provided inbot_example.py.
You create a calendar and add it to a message with areply_markupparameter and then you can process it in a callbackqueyhandler method using theprocess_selectionmethod.Gif demo:
Package: aiogram3-di
Example of usageimportloggingfromosimportgetenvfromtypingimportAnnotatedfromaiogramimportRouter,Bot,Dispatcherfromaiogram.typesimportMessage,Userfromaiogram3_diimportsetup_di,Dependsrouter=Router()defget_user_full_name(event_from_user:User)->str:returnevent_from_user.full_name@router.message()asyncdefstart(message:Message,full_name:Annotated[str,Depends(get_user_full_name)])->None:awaitmessage.answer(f"Hi{full_name}")defmain()->None:logging.basicConfig(level=logging.INFO)bot=Bot(token=getenv("BOT_TOKEN"))dp=Dispatcher()dp.include_router(router)setup_di(dp)dp.run_polling(bot)if__name__=="__main__":main()Handler Dependencies.You can useDependsin the flags parameter of the handler, for example:flags={"dependencies":[Depends(verify_user)]}DetailsIt is inspired byFastAPI.If you define a normal def, your function will be called in a different thread.LicenseMIT
Package: aiogram3-form
aiogram3-formA library to create forms in aiogram3pipinstallaiogram3-formExampleimportasynciofromaiogramimportBot,Dispatcher,F,Router,typesfromaiogram3_formimportForm,FormFieldfromaiogram.fsm.contextimportFSMContextbot=Bot(token="YOUR_TOKEN")dispatcher=Dispatcher()router=Router()dispatcher.include_router(router)classNameForm(Form,router=router):first_name:str=FormField(enter_message_text="Enter your first name please")second_name:str=FormField(enter_message_text="Enter your second name please",filter=(F.text.len()>10)&F.text,)age:int=FormField(enter_message_text="Enter age as integer",error_message_text="Age should be numeric!",)@NameForm.submit()asyncdefname_form_submit_handler(form:NameForm,event_chat:types.Chat):# handle form data# also supports aiogram standart DI (e. g. middlewares, filters, etc)awaitform.answer(f"{form.first_name}{form.second_name}of age{form.age}in chat{event_chat.title}")@router.message(F.text=="/form")asyncdefform_handler(_,state:FSMContext):awaitNameForm.start(bot,state)# start your formasyncdefmain():awaitdispatcher.start_polling(bot)asyncio.run(main())
Package: aiogram_album
aiogram albumBase handlerfromaiogram_albumimportAlbumMessage@router.message(F.media_group_id)asyncdefmedia_handler(message:AlbumMessage):awaitmessage.reply(f"album\n"f"size:{len(message)}\n"f"content types:{[m.content_type.valueforminmessage]}")PyrogramAlbumMiddlewareInstallpipinstallaiogram_albumPyrogramcachetoolsTgCryptoUsage[!CAUTION]
Obtain the API key by following Telegram’s instructions and rules athttps://core.telegram.org/api/obtaining_api_idfromaiogram_album.pyrogram_album.middlewareimportPyrogramAlbumMiddlewareawaitPyrogramAlbumMiddleware.from_app_data(bot_token=BOT_TOKEN,api_id=API_ID,api_hash=API_HASH,router=dp,)orfromaiogram_album.pyrogram_album.middlewareimportPyrogramAlbumMiddlewarefrompyrogramimportClientfromaiogramimportBotbot=Bot(BOT_TOKEN)client=Client(str(bot.id),bot_token=BOT_TOKEN,api_hash=API_HASH,api_id=API_ID,no_updates=True)awaitclient.start()PyrogramAlbumMiddleware(client=client,router=dp,)TTLCacheAlbumMiddlewareInstallpipinstallaiogram_albumcachetoolsUsagefromaiogram_album.ttl_cache_middlewareimportTTLCacheAlbumMiddlewareTTLCacheAlbumMiddleware(router=dp)CountCheckAlbumMiddlewareInstallpipinstallaiogram_albumUsagefromaiogram_album.count_check_middlewareimportCountCheckAlbumMiddlewareCountCheckAlbumMiddleware(router=dp)WithoutCountCheckAlbumMiddlewareInstallpipinstallaiogram_albumUsagefromaiogram_album.no_check_count_middlewareimportWithoutCountCheckAlbumMiddlewareWithoutCountCheckAlbumMiddleware(router=dp)LockAlbumMiddlewareInstallpipinstallaiogram_albumcachetoolsUsagefromaiogram_album.lock_middlewareimportLockAlbumMiddlewareLockAlbumMiddleware(router=dp)
Package: aiogram-autodoc
aiogram-autodocThis package allows you to generate documentation for handlers processing commands.Supports docstrings and filter inside the handler (DescriptionFilter).Example:from aiogram import Bot, Dispatcher
from aiogram.types import Message
from aiogram_autodoc import AutoDoc, DescriptionFilter

BOT_TOKEN = '00000:something-words-in-token'

bot = Bot(BOT_TOKEN, validate_token=False)
dp = Dispatcher(bot)

dp.filters_factory.bind(DescriptionFilter)


@dp.message_handler(commands=['start'], description='Description for the function with the /start command')
async def start(msg: Message):
    pass


@dp.message_handler(commands=['help'])
async def help(msg: Message):
    """Description for a function with the /help command, using docstring"""
    pass


@dp.message_handler()
async def just_function(msg: Message):
    """Just a function without a command that doesn't output in result"""
    pass


docs = AutoDoc(dp)
docs.parse()
result_as_dict = docs.to_dict()
Package: aiogram-broadcaster
Aiogram BroadcasterA simple and straightforward broadcasting implementation for aiogramInstallaiton$ pip install aiogram-broadcasterExamplesFew steps before getting started...First, you should obtain token for your bot fromBotFatherand make sure you started a conversation with the bot.Obtain your user id fromJSON Dump Botin order to test out broadcaster.Note:These and even more examples can found inexamples/directoryBase usagefromaiogram_broadcasterimportTextBroadcasterimportasyncioasyncdefmain():# Initialize a text broadcaster (you can directly pass a token)broadcaster=TextBroadcaster('USERS IDS HERE','hello!',bot_token='BOT TOKEN HERE')# Run the broadcaster and close it afterwardstry:awaitbroadcaster.run()finally:awaitbroadcaster.close_bot()if__name__=='__main__':asyncio.run(main())Embed a broadcaster in a message handlerfromaiogramimportBot,Dispatcher,typesfromaiogram_broadcasterimportMessageBroadcasterimportasyncioasyncdefmessage_handler(msg:types.Message):"""The broadcaster will flood to a user whenever it receives a message"""users=[msg.from_user.id]*5# Your users listawaitMessageBroadcaster(users,msg).run()# Run the broadcasterasyncdefmain():# Initialize a bot and a dispatcherbot=Bot(token='BOT TOKEN HERE')dp=Dispatcher(bot=bot)# Register a message handlerdp.register_message_handler(message_handler,content_types=types.ContentTypes.ANY)# Run the bot and close it afterwardstry:awaitdp.start_polling()finally:awaitbot.session.close()if__name__=='__main__':asyncio.run(main())
Package: aiogram-calendar
Date Selection tool for Aiogram Telegram BotsDescriptionA simple inline calendar, date selection tool foraiogramtelegram bots written in Python.Offers two types of date pickers:Navigation calendar - user can either select a date or move to the next or previous month/year by clicking a singe button.Dialog calendar - user selects year on first stage, month on next stage, day on last stage.From version 0.2 supports aiogram 3, use version 0.1.1 with aiogram 2.Main featuresTwo calendars with abilities to navigate years, months, days altogether or in dialogAbility to set specified locale (language of captions) or inherit from user`s localeLimiting the range of dates to select fromHighlighting todays dateUsageInstall packagepip install aiogram_calendarA full working example on how to use aiogram-calendar is provided in *bot_example.py*.In example keyboard with buttons is created.Each button triggers a calendar in a different way by adding it to a message with areply_markup.reply_markup=await SimpleCalendar().start_calendar()^^ will reply with a calendar created using English localization (months and days of week captions). Locale can be overridden by passing locale argument:reply_markup=await SimpleCalendar(locale='uk_UA').start_calendar()or by getting locale from User data provided by telegram API using get_user_locale method by passingmessage.from_userto itreply_markup=await SimpleCalendar(locale=await get_user_locale(message.from_user)).start_calendar()Depending on what button of calendar user will press callback is precessed using theprocess_selectionmethod.selected, date = await SimpleCalendar(locale=await get_user_locale(callback_query.from_user)).process_selection(callback_query, callback_data)Here locale is specified fromcallback_query.from_userGif demo:
Package: aiogram-calendar3x
# Date Selection tool for Aiogram Telegram Bots## Description
A simple inline calendar, date selection tool for [aiogram](https://github.com/aiogram/aiogram) telegram bots written in Python.
Offers two types of date pickers:
Navigation calendar - user can either select a date or move to the next or previous month/year by clicking a singe button.
Dialog calendar - user selects year on first stage, month on next stage, day on last stage## Usage
Install packagepip install aiogram_calendarA full working example on how to use aiogram-calendar is provided inbot_example.py.
You create a calendar and add it to a message with areply_markupparameter and then you can process it in a callbackqueyhandler method using theprocess_selectionmethod.## Gif demo:![aiogram_calendar](https://j.gifs.com/nRQlqW.gif)
Package: aiogram-cli
aiogram-cli (PoC)Command line interface for developersWorks only withaiogram3.0+Here is only bootstrap for CLI interface with extensions based onpkg_resourcesInstallationFrom PyPipip install aiogram-cliorpip install aiogram[cli]UsageJust run in terminalaiogramand see what you can do with it.ExampleWriting extensionsAnyaiogram-cliextension package should provide an entry point like this:[aiogram_cli.plugins]
my_extension = my_package.module:my_commandOr with poetry like this:[tool.poetry.plugins."aiogram_cli.plugins"]"builtin-about"="aiogram_cli.about:command_about""builtin-plugins"="aiogram_cli.plugins:command_plugins"
Package: aiogram-dev2
aiogramis a pretty simple and fully asynchronous framework forTelegram Bot APIwritten in Python 3.7 withasyncioandaiohttp. It helps you to make your bots faster and simpler.You canread the docs here.Official aiogram resourcesNews:@aiogram_liveCommunity:@aiogramRussian community:@aiogram_ruPip:aiogramDocs:ReadTheDocsSource:Github repoIssues/Bug tracker:Github issues trackerTest bot:@aiogram_bot
Package: aiogram-di
Aiogram DIInstallationLatest version from GitHubpip install git+https://github.com/MaximZayats/aiogram-diFrom PyPipip install -U aiogram-diUsageInitializationfromaiogram_diimportDIMiddleware@dataclassclassA:id:intdp.message.middleware(DIMiddleware({A:lambda:A(id=1),}))Usage@dp.message()asyncdefhandler(message:Message,a:A,# <- will be injected)->None:asserta.id==1
Package: aiogram-forms
aiogram-formsIntroductionaiogram-formsis an addition foraiogramwhich allows you to create different forms and process user input step by step easily.DocumentationDocumentation can be foundhere.Installationpipinstallaiogram-formsUsageCreate form you need by subclassingaiogram_forms.forms.Form. Fields can be added fromaiogram_forms.forms.fieldssubpackage.fromaiogram_formsimportdispatcherfromaiogram_forms.formsimportForm,fields,FormsManagerfromaiogram_forms.errorsimportValidationErrordefvalidate_username_format(value:str):"""Validate username starts with leading @."""ifnotvalue.startswith('@'):raiseValidationError('Username should starts with "@".',code='username_prefix')@dispatcher.register('test-form')classTestForm(Form):username=fields.TextField('Username',min_length=4,validators=[validate_username_format],error_messages={'min_length':'Username must contain at least 4 characters!'})email=fields.EmailField('Email',help_text='We will send confirmation code.')phone=fields.PhoneNumberField('Phone number',share_contact=True)language=fields.ChoiceField('Language',choices=(('English','en'),('Russian','ru')))@classmethodasyncdefcallback(cls,message:types.Message,forms:FormsManager,**data)->None:data=awaitforms.get_data('test-form')# Get form data from stateawaitmessage.answer(text=f'Thank you,{data["username"]}!',reply_markup=types.ReplyKeyboardRemove()# Use this for reset if last field contains keyboard)router=Router()@router.message(Command(commands=['start']))asyncdefcommand_start(message:types.Message,forms:FormsManager)->None:awaitforms.show('test-form')# Start form processingasyncdefmain():dp=Dispatcher()dp.include_router(router)dispatcher.attach(dp)# Attach aiogram to forms dispatcherbot=Bot(...)awaitdp.start_polling(bot)HistoryAll notable changes to this project will be documented inCHANGELOGfile.