Saravanan666/pypi-org huggingface dataset:
Package: botsfordiscordapi
Bots for discord API handler for PythonThis is an api handler that I made for the Bots for Discord (Bot list)InstallTo use this you can install it using pip:pip install botsfordiscordapiExample usageimportbotsfordiscordapi#Authorize## API Version is currently 'v1' but may update in the futurebfd=botsfordiscordapi.login(token,api_version)#Push server count (Requires token)bfd.push(bot_id,server_count)#Get a bot on the list (If it exists)bfd.get(bot_id)Example ResponsesGET Response:{"approved":false,"avatar":"","count":1000000,// Server count"id":"","invite":"","longDesc":"","name":"","owner":"","ownername":"","ownernametwo":"","prefix":"","shortDesc":"","theme":"","timestamp":,"type":"","verified":false,"verifyqueue":false,"website":""}
Package: botshot
Botshot Chatbot FrameworkBotshot is a Python/Django framework for building stateful chatbots and conversational interfaces.With Botshot, you can build complex chatbots that remember past conversations.Botshot can:Receive messagesfromMessenger,TelegramorAmazon Alexa(more platforms coming soon)Understandand parse messages using aNLUservicee.g. "Show me the best concert" ->intent:recommend,query:concertManage the dialogueand move between the conversation's statesKeep track of the contextand history of the conversationSend messagesand media back to the userSend proactive messagesand notificationsConnectto 3rd party APIs and analyticsGetting startedJust install the package and run thebotsscript. You will also need the Redis database.sudoaptinstallredis-server
pip3installbotshot
botsinitmy_bot&&cdmy_bot
botsstartThat's it! Now openhttp://127.0.0.1:8000/chatand chat with your bot.You may also want to add some actual content, so check the docs ;-)DocsFind out how to make your own chatbot in theDocs.Questions?Join us on Slack!AuthorsMatúš Žilinec -mzilinecDavid Příhoda -prihodaJakub Drdák   -drdakjakLicenseThis project is dual licensed. You may only use Botshot for open-source projects under the AGPL license.  If you'd like to use Botshot for commercial projects, please contact us for a commercial license.
Package: botsniffer
BotSnifferDetects source code generated by AI on projects using Machine Learning and "Feature Extraction."UsageOn the command lineYou can use botsniffer in your terminal as command line. You need to train the tool before being able to detect code.I included some AI generated snippets, but you need to incorporate a bigger dataset in order to make it fully functional.$ pip3 install botsniffer
$ botsniffer ./ --train (will train using the code in the current directory. Any files with "ai" in the name will be taken as AI generated).
$ botsniffer ./ --identify (will list feature extraction scores plus AI as True/False)

## Notice

This tool does not provide legal advice; I'm not a lawyer.

The code is an experimental implementation. Refrain from relying on the accuracy of the output of this tool.

## Contributing

Contributions are very welcome! See [CONTRIBUTING](CONTRIBUTING.md) for more info.

## License

This code is licensed under the [Apache 2.0 License](LICENSE).
Package: botsocket
Secure socket communication via botnet>>> pip install botsocketBased on Command Bus design pattern.myserver.pyimportosfrombotsocket.serverimportstart_serverfrommycommandsimport*if__name__=='__main__':start_server(listen_ip='0.0.0.0',port=PORT,allowed_host=CLIENT_IP)mycommands.pyfrombotsocket.commandbusimportCommand,CommandHandlerclassMyCommand(Command):def__init__(self,msg):self.msg=msgclassMyCommandHandler(CommandHandler):defhandle(self,command):returncommand.msgmyclient.pyimportosfrombotsocket.clientimportsend_commandfrommycommandsimportMyCommandif__name__=='__main__':cmd=MyCommand('yo')result=send_command(cmd,server_ip=SERVER_IP,port=PORT)Notes for production:create self-signed certificatecert.pem;>>> openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365createlogging.yml;import all commands in myserver.py in order to unpickle command’s objects.
Package: bot-storage
bot-storageStorage - an object that allows you to save the states and data of users.The storage.py file describes the abstract class BaseStorage, inheriting from which, you can implement your own storage (eg DBStorage or JSONStorage).Such storages, however, will obviously not be more efficient than the already implemented RedisStorage.Installation:pipinstallbot-storageSetting upYourProject/tbot/storage.pyfromosimportgetenvfrombot_storage.storageimportRedisStoragestorage=RedisStorage(host=getenv('REDIS_HOST','localhost'),username=getenv('REDIS_USER',None),password=getenv('REDIS_PASSWORD',None))YourProject/settings.pyfromtbot.storageimportstorage# Your storage for user states & dataBOT_STORAGE=storageStart Redisredis-serverUsageFor example YourProject/tbot/handlers.pyfromtelebotimporttypesfromtelebot.apihelperimportApiTelegramExceptionfromtbot_base.botimporttbotfrom.storageimportstorageasst@tbot.message_handler(func=lambdamsg:st.get_user_state(msg.from_user.id)=='some_state#')defsend_faq_search(msg:types.Message):tbot.send_message(chat_id=msg.from_user.id,text='Hello!')
Package: botstrap
BotstrapAn easy-to-use utility toolbelt for Discord bots written in Python.Read the docs »OverviewDo you store your Discord bot token inplaintext? Don't get caught with your pants
down. Strap in!Botstrapis aPython librarysuit of power armor that perfectly fits your
Discord bot. It offers:🔐Secure encryptionand password protection to keep your bot tokens safe🤹 A straightforward way tomanage multiple tokensand/or bot configurations🌈 An intuitive, colorful, and customizablecommand-line interfacefor your bot🤝 Out-of-the-boxcompatibilitywith all of the most popular PythonDiscord
libraries... and more to come!InstallationPython3.10or higher is required. It's also generally a good idea to upgrade pip
(python -m pip install -U pip).pipinstall-UbotstrapFor additional/alternative installation instructions, see thedocumentation.QuickstartComing soon! In the meantime, check out:TheexamplesdirectoryStarterbot templatesfor various Discord librariesAnd most importantly:The extremely detailedBotstrap API ReferenceGit HooksAdding one or both of Botstrap'spre-commithooks to yourgitworkflow is an easy
and seamless way to improve the security of your codebase. (If you're unfamiliar with
pre-commit, here's itsquickstartguide. Highly recommend!)See below for descriptions of the available hooks, and add the one(s) you like to your.pre-commit-config.yaml:-repo:https://github.com/nuztalgia/botstraprev:0.2.9hooks:-id:detect-discord-bot-tokens-id:detect-encrypted-tokens🕵️detect-discord-bot-tokensThis hook checks the contents of your added/changed files every time yougit commit,
and raises an error if it finds any unencrypted bot tokens. It won't catch any plaintext
tokens that you've.gitignore-d or already committed, but itwillprevent you from
accidentally committing new ones.Note:This hook is especially useful for bots whose tokens aren't secured by the
main Botstrap library -including bots written in languages other than Python!✨💂detect-encrypted-tokensAlthough it isn'tquiteas dangerous to commit your encrypted bot tokens, doing so is
still very much a security risk. This hook prevents that from happening by raising an
error if you try togit commita file whose name matches the pattern used by
Botstrap's encrypted token files. (Hint:Keep this hook happy by adding*.keyto
your.gitignore.)BadgesLet everyone know your Discord bot is secure by adding a badge to your repository'sREADME.md:[![Botstrap](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fnuztalgia%2Fbotstrap%2Fmain%2F.github%2Fbadges%2Fbotstrap-on.json)](https://github.com/nuztalgia/botstrap)You can replacebotstrap-onin the above snippet with the text on one of the other
badges (e.g.tokens-secure).For more granular customization options, check out the available style parameters onshields.io.LicenseCopyright © 2022Nuztalgia. Released under theApache License, Version 2.0.
Package: bottango-playback-interface
bottango_playback_interfaceControl Bottango through its Web API from python.This python3.7+ module is made to interface with Bottango, a Hardware/Robot/Animatronics animation software created by Evan McMahonWhat is BottangoInstallationInstall through pip withpip install bottango_playback_interfaceUsageStart by creating your animations with Bottango, enable the Web API and enter the 'Animate' modeThen from your python scriptfrombottango_playback_interfaceimportBottangoPlaybackInterfacebpi=BottangoPlaybackInterface("localhost",59224)bpi.play_animation("animation_name_to_play")bpi.wait_animation_done()Methodsbpi.play_animation("animation_name_to_play")# Plays the animation with the corresponding namebpi.pause_animation()# Pause the current animationbpi.resume_animation()# Resume the current animationbpi.get_playback_state()# Get various informations from bottangobpi.wait_animation_done(timeout=max_wait_time)# Wait until the animation is over before returning or the timeout runs out.bpi.get_animation_list()# Returns an array with all available animation namesbpi.emergency_stop()# Turn off live mode from Bottango, must be reenable from there.Developmentgit clone this projectCreate a new venvpython3 -m venv --system-site-packages ./venvSource itsource ./venv/bin/activateInstall all dependancies with poetrypoetry installInstall git hookspre-commit installUpload to pypiSource the venvsource ./venv/bin/activateInstall twinepip install twineConfig your pypi credentials in the file~/.pypirc[pypi]username=pypi_usernamepassword=pypi_passwordRunpoetryinstalltwinecheckdist/*twineuploaddist/*
Package: bottem
Telegram bot just by calling one function.Description:If you have some functions and you want tobot themusebottem:wink:Actually, it is just a wrapper for pyrogram and adds a command handler for all of your module functions.RequirementsPython3+PyrogramUsage:cpconfig.init.exampleconfig.init
viconfig.initfrom.importmy_modulefrombottemimportBottemBottem(my_module)my_module.py:defhello(*args):return"Hello World!"defecho(*words):return" ".join(words)Then you just need to send commadn to your bot:/echo This text is echoed.to receiveThis text is echoed.reply/helloto receiveHello World!reply.Config fileapi_idfromtelegramapi_hashbot_tokenfrombotfatherReadpyrogramfor more config info.PS:BTW I've stolen this README.md from thisrepo
Package: bottender
[![travis-ci][travis-image]][travis-url]    [![pypi-version][pypi-image]][pypi-url]    [![codecov][codecov-image]][codecov-url][travis-image]: https://travis-ci.org/stegben/bottender-py.svg?branch=master[travis-url]: https://travis-ci.org/stegben/bottender-py[pypi-image]: https://badge.fury.io/py/bottender-py.svg[pypi-url]: https://badge.fury.io/py/bottender-py[codecov-image]: https://codecov.io/gh/stegben/bottender-py/branch/master/graph/badge.svg[codecov-url]: https://codecov.io/gh/stegben/bottender-pyRewrite the famous bot framework [Bottender](https://bottender.js.org/) in async python. All credits should be back to [Yoctol Info](https://www.yoctol.com/).# The following part is not ready yet, plz don't take them seriously## Installation```bashpip install bottender```## Usage```pythonfrom bottender import MessengerBotbot = MessengerBot(access_token="__access_token__",app_secret="__app_secret__",)@bot.on_eventasync def echo_handler(context):if context.event.is_text:await context.send_text('')# or# >>> bot.on_event(handler)```## Supported frameworks- SanicFirst, prepare a :``````Or, use `blueprint` for larger project:```pythonfrom sanic import Sanicfrom bottender.sanic import create_blueprintbot = ...bp = create_blueprint(bot, name='bot', url_prefix='/bot')app = Sanic(__name__)app.blueprint(bp)```or, use ``- aiohttpUse route hadler.```python```Home-page: https://github.com/stegben/bottender-pyAuthor: cphAuthor-email: stegben.benjamin@gmail.comLicense: UNKNOWNDescription: # bottender-py[![travis-ci][travis-image]][travis-url]    [![pypi-version][pypi-image]][pypi-url]    [![codecov][codecov-image]][codecov-url][travis-image]: https://travis-ci.org/stegben/bottender-py.svg?branch=master[travis-url]: https://travis-ci.org/stegben/bottender-py[pypi-image]: https://badge.fury.io/py/bottender-py.svg[pypi-url]: https://badge.fury.io/py/bottender-py[codecov-image]: https://codecov.io/gh/stegben/bottender-py/branch/master/graph/badge.svg[codecov-url]: https://codecov.io/gh/stegben/bottender-pyRewrite the famous bot framework [Bottender](https://bottender.js.org/) in async python. All credits should be back to [Yoctol Info](https://www.yoctol.com/).# The following part is not ready yet, plz don't take them seriously## Installation```bashpip install bottender```## Usage```pythonfrom bottender import MessengerBotbot = MessengerBot(access_token="__access_token__",app_secret="__app_secret__",)@bot.on_eventasync def echo_handler(context):if context.event.is_text:await context.send_text('')# or# >>> bot.on_event(handler)```## Supported frameworks- SanicFirst, prepare a :``````Or, use `blueprint` for larger project:```pythonfrom sanic import Sanicfrom bottender.sanic import create_blueprintbot = ...bp = create_blueprint(bot, name='bot', url_prefix='/bot')app = Sanic(__name__)app.blueprint(bp)```or, use ``- aiohttpUse route hadler.```python```Platform: UNKNOWNClassifier: Programming Language :: Python :: 3.6
Package: botter
Botter - Simple interface for creating cross-messenger botsBotteris a framework which allows your bots run in any available messenger.
Currently, there are only one implementation forDiscord,
but it is easy to implement other platforms.Okay, let's get started!Getting StartedCreating an ApplicationAt first, you should register a bot in the desired platform.
As all messengers provide different ways to do so, we will not describe this process here.Create HandlerBotter uses event-based architecture, with a most-common event -MessageEvent.
Events are handled byEventHandler's.So, let's create out own:frombotter.apiimport*frombotter.api.handlersimport*classSimpleEchoHandler(ReplyHandler):asyncdefhandle_message(self,message:InboundMessage)->Message:returnMessage(f"You've said:\n"+message.text)Here we use theReplyHandler, which:NestsMessageHandlerChecks the event isMessageEventCalls methodhandle_message()with the message from event.If this method returnsMessagerather than None,ReplyHandlerwould send it to server with a mention to the original message's author.Crate a BotThen we need to create aBot- object that aggregates handlers and mappings to the implementation.
Here we use discord driver as an example.frombotter.discordimportDiscordBotclassEchoBot(Bot[DiscordBot]):token='INSERT_YOUR_TOKEN_HERE'event_handlers=[SimpleEchoHandler]client=DiscordBot(token=token)Okay, let's try it out!Wow! It works!Extending EventsNow, let's try to have some fun with the events.
Package: bottilities
shortUtility functions for bots.
Used inbotskeleton(and all the bots that use it) andpuckfetcher.longThese are in the order defined inbottilities.py,
which in turn is basically defined by order of creation.
Not really organized nicely,
sorry.Methodsensure_dir(directory)Create directory if it doesn’t exist.expand(directory)Expand~to$HOME,
and expand other environment variables to their values,
in the provided path.
Designed for UNIX-based platforms:
unclear what will happen on others.generate_downloader(headers, args, max_per_hour=30)Produce a callable downloader.
Provide headers for URL call,
and provide some args
(for the rate limiting
(see that later in the document)),
which will be used to identify this function in rate-limiting.max_per_houris optional:
use it to decide how many times per hour downloads can happen.
The default is 30 times per hour.
The returned downloader is called as follows:downloader=generate_downloader({"foo":"bar"},"an identifier string")downloader(url=url,dest=dest)whereurlis where to download FROM anddestis where to SAVE the file.
It will make the directory for the file if it does not exist.
A text progress bar is shown during download,
and while rate limit is blocking.max_clamp(val, limit)Returnvalif it is less thanlimit,
otherwise returnlimit.parse_int_string(int_string)Given a string like “1 23 4-8 32 1”,
return a unique list of those integers in the string,
and the integers in the ranges in the string.
For this example,
the output would be [1, 4, 5, 6, 7, 8, 23, 32].
Non-numbers ignored.
Not necessarily sortedrate_limited(max_per_hour, *args)A decorator to rate-limit a function
(ensures that it runs no more thanmax_per_hourtimes per hour by sleeping sometimes).
Called like this:@util.rate_limited(120,name)defa_function(var1,var2="foo"):sanitize(filename, platform=None)Remove disallowed characters from potential filename.
Provide platform to sanitize for that platform,
otherwise current platform is found and used.set_up_logging(log_filename="log", verbosity=0)Set up a logger with reasonable settings.
Return it for log calls.random_line(file_path, encoding=FORCED_ENCODING)At time of writing,FORCED_ENCODINGis “UTF-8”.
Refer to code for latest.
Return a line from the provided file at random.
Package: bottle
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with url parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file and with no dependencies other than the
Python Standard Library.Homepage and documentation:http://bottlepy.org/Copyright (c) 2016, Marcel Hellkamp.
License: MIT (see LICENSE for details)
Package: bottle-api
Installation$ pip install bottle-apiBasic Usagejson_endpoint decorator will make a function to JSON WebAPI endpoint.
decorated function will return bottle.HTTPResponse.see this sample web app:#!python
from bottleapi import WebApiError
from bottleapi.jsonapi import json_endpoint
from bottle import Bottle, request

app = Bottle()

@json_endpoint
def devide():
    a = int(request.params['a'])
    b = int(request.params['b'])
    if b == 0:
        raise WebApiError('b cannot be zero', status=400)

    result = a / b
    return dict(value=result)

app.route('/devide', ['GET'], devide)if you access/device?a=1&b=1, it will return200 OKresponse with body:{"status": "ok", "result": {"value": 1}}with Content-Typeapplication/jsonbut when you accessdevice?a=1&b=0, you will get400 BAD REQUESTresponse with body:{"status": "error", "message": "b cannot be zero", "result": null}If you want to use JSONP, you can specify callback function name with parameter(jby default)
So accessing/device?a=4&b=2&j=my_callbackwill result:my_callback({"status": "ok", "result": {"value": 2}});If you dont like parameter or result data format, You can define your own formatters(success/error).
See jsonapi.py for customized formatter example.
Package: bottle-api-json-formatting
=====================bottle-api-json-formatting=====================A Bottle plugin which encapsulates results and errors in a json object. Thismakes it much easier to build REST based api services with bottle.Installation===============Install with one of the following commands:```bash$ pip install bottle-api-json-formatting$ easy_install bottle-api-json-formatting```or download the latest version from github:```bash$ git clone git://github.com/bustleandflurry/bottle-api-json-formatting.git$ cd bottle-api-json-formatting$ python setup.py install```Usage===============```pythonimport bottleimport bottle_api_json_formattingapp = bottle.Bottle()app.install(bottle_api_json_formatting.JsonFormatting())@app.route('/')def index():return 'This is a test.'@APP.route('/error')def index():raise Exception('This is an error.')if __name__ == '__main__':run(app, host='0.0.0.0', port=8080, debug=True)```Output=============Standard:```{"status": "success","status_code": 0,"data": "test"}```Error:```{"status": "error","status_code": 1,"data": null,"error": {"status": "500 Internal Server Error","status_code": 500,"message": "Internal Server Error"}}```Module Contents=============bottle\_api\_json\_formatting.**JsonFormatting**(*supported\_types=*['\*/\*'], *debug=False*)*supported\_types* allows you to expressly set which Content-Types are acceptable for a json formatted response. When set any Content-Types not in the will be passed through untouched.*debug* set to True will add the fields exception and traceback to error responses.
Package: bottle-apispec
bottle-apispecSimple plugin to easily enable integrate Bottle, APISpec and Marshmallow.ExamplefrombottleimportBottle,runfrombottle_apispecimportAPISpecPluginfrommarshmallowimportSchemafrommarshmallow.fieldsimportStringapp=Bottle()classMySchema(Schema):id=String()value=String()@app.get('/')defindex():"""API endpoint that return MySchema---get:description: API endpoint that return MySchemaresponses:200:description: It works!!!!schema: MySchema"""data,error=MySchema.load('id','value')returndataapp.install(APISpecPlugin(title='Example API',version='1.0.0',openapi_version='2.0',scan_package='.'))run(app)
Package: bottle-argsmap
bottle_argsmapAuto inject arguments via adictlike pattern.UsagefrombottleimportBottlefrombottle_argsmapimportArgsMapPluginapp=Bottle()plugin=try_install(app)# inject via singletonplugin.set_value('value','1544')# or inject via factory, dynamic creation is allowed# e.g. you can to inject database connection from a database poolplugin.set_factory('value',lambdaparam_name,route:...,context_manager=True,# auto call `__exit__` on the value after responsed)# finally, inject it@app.get('/path')defget_it(value):# value is injectedreturndict(value=value)MoreArgsMapPlugin().iocis a instance of typeanyioc.ServiceProvider, which means you can use all features fromanyioc.
Package: bottle-auth
Bottle plugin authentication, support with Google, Twitter and FacebookExamplefrombottleimportBottle,redirect,request,runfrombottle.extimportauthfrombottle.ext.auth.decoratorimportloginfrombottle.ext.auth.social.facebookimportFacebook,UserDeniedfrombottle.ext.auth.social.facebookimportNegotiationErrorfrompprintimportpformatfacebook=Facebook('fb-key','fb-secret','http://127.0.0.1:8000/','email')app=Bottle()plugin=auth.AuthPlugin(facebook)app.install(plugin)@app.route('/login')deflogin(auth):returnauth.redirect(request.environ)@app.route('/')@login(auth)defhome():user=auth.get_user(request.environ)return"Home page{}".format(pformat(user))run(app=app,host='0.0.0.0',port='3333',debug=True)Application in production:https://github.com/avelino/mining/blob/master/auth.pyGoogleCreate projectSign into your Google Apps account in your browserVisithttps://code.google.com/apis/console#accessin the same browserOn the left menu, Create a new ProjectTo start, you don’t need any Services, so select the API Access tab rom the left menu and “Create an OAuth 2.0 client ID…”Fill out the Client ID form for aweb applicationand uselocalhost:8000as your hostname
Package: bottle-beaker
Bottle plugin to session and caching library with WSGI MiddlewareExampleimportbottlefrombottle.extimportbeakersession_opts={'session.type':'file','session.cookie_expires':300,'session.data_dir':'./data','session.auto':True}app=beaker.middleware.SessionMiddleware(bottle.app(),session_opts)@bottle.route('/test')deftest():s=bottle.request.environ.get('beaker.session')s['test']=s.get('test',0)+1s.save()return'Test counter:%d'%s['test']bottle.run(app=app)
Package: bottle-cerberus
Cerberus pluginCerberus plugin for bottleinstallationVia pip:pip installbottle-cerberusOr clone:git clonehttps://github.com/agalera/bottle-cerberus.gitexample:frombottleimportget,install,runfrombottle_cerberusimportCerberusPlugin,SchemaclassExampleSchema(Schema):defschema(self):return{'ex':{'type':'integer'},'url':{'ex':{'coerce':int}}}classQuerySchema(Schema):defschema(self):return{'ex':{'coerce':int}}@get('/cerberus/<ex>',schemas={'body':ExampleSchema(),'query_string':QuerySchema())deftest_cerberus(ex):frombottleimportrequestprint("query_string",request.query['ex'],type(request.query['ex']))print("url",ex,type(ex))print("body",request.json.get('ex'),type(request.json.get('ex')))install(CerberusPlugin())run(host="0.0.0.0",port="9988")SchemasOptional keysbody: schema for request.jsonurl: schema for url (no query string)query_string: schema for query stringsSchemaGithub Schema:https://github.com/nicolaiarocci/cerberusDoc schema:http://docs.python-cerberus.org/en/stable/