Saravanan666/pypi-org huggingface dataset:
Package: better-fastapi-discord
FastAPI Discord (OAuth)Support for "Login with Discord"/ Discord OAuth for FastAPI.InstallPIP Packagefastapi-discordExampleYou can find the Example inexpamples/fromtypingimportListfromfastapiimportDepends,FastAPIfromfastapi.responsesimportJSONResponsefromfastapi_discordimportDiscordOAuthClient,RateLimited,Unauthorized,Userfromfastapi_discord.exceptionsimportClientSessionNotInitializedfromfastapi_discord.modelsimportGuildPreviewapp=FastAPI()discord=DiscordOAuthClient("<client-id>","<client-secret>","<redirect-url>",("identify","guilds","email"))# scopes@app.on_event("startup")asyncdefon_startup():awaitdiscord.init()@app.get("/login")asyncdeflogin():return{"url":discord.oauth_login_url}@app.get("/callback")asyncdefcallback(code:str):token,refresh_token=awaitdiscord.get_access_token(code)return{"access_token":token,"refresh_token":refresh_token}@app.get("/authenticated",dependencies=[Depends(discord.requires_authorization)],response_model=bool,)asyncdefisAuthenticated(token:str=Depends(discord.get_token)):try:auth=awaitdiscord.isAuthenticated(token)returnauthexceptUnauthorized:returnFalse@app.exception_handler(Unauthorized)asyncdefunauthorized_error_handler(_,__):returnJSONResponse({"error":"Unauthorized"},status_code=401)@app.exception_handler(RateLimited)asyncdefrate_limit_error_handler(_,e:RateLimited):returnJSONResponse({"error":"RateLimited","retry":e.retry_after,"message":e.message},status_code=429,)@app.exception_handler(ClientSessionNotInitialized)asyncdefclient_session_error_handler(_,e:ClientSessionNotInitialized):print(e)returnJSONResponse({"error":"Internal Error"},status_code=500)@app.get("/user",dependencies=[Depends(discord.requires_authorization)],response_model=User)asyncdefget_user(user:User=Depends(discord.user)):returnuser@app.get("/guilds",dependencies=[Depends(discord.requires_authorization)],response_model=List[GuildPreview],)asyncdefget_guilds(guilds:List=Depends(discord.guilds)):returnguildsInspired byStarlette-DiscordQuart-Discord-OAuthQuart-DiscordThanks to @jnawk and @nwunderly
Package: better-feediverse
This repo is a copy and updated version ofedsu/feediverseYou can always view changes here:https://github.com/edsu/feediverse/compare/master...xopez:better_feediverse:masterDescriptionbetter_feediversewill read RSS/Atom feeds and send the messages as Mastodon posts.
It's meant to add a little bit of spice to your timeline from other places.
Please use it responsibly.Installpip install better_feediverseRunThe first time you runbetter_feediverseyou'll need to tell it your Mastodon
instance and get an access token which it will save in a configuration file. If
you don't specify a config file it will use~/.better_feediverse:better_feediverseOncebetter_feediverseis configured you can add it to your crontab:*/15 * * * * /usr/local/bin/better_feediverseRunbetter_feediverse --helpto show the command line options.Post FormatYou can customize the post format by opening the configuration file (default is
~/.better_feediverse) and updating thetemplateproperty of your feed. The default
format is:{title} {url}If you want you can use{summary}in your template, and add boilerplate text
like so:Bookmark: {title} {url} {summary}{hashtags}will look for tags in the feed entry and turn them into a space
separated list of hashtags. For some feeds (e.g. youtube-rss) you should use{link}instead of{url}.{content}is the whole content of the feed entry (with html-tags
stripped). Please be aware that this might easily exceed Mastodon's
default limit of 500 characters.
Package: bettergitcli
Disclaimer: BetterGitCLI isnotofficial GitHub software, nor is it in any way affiliated with GitHub.BetterGitCli is a third party GitHub CLI made with Python, providing easier access to managing your
GitHub account directly from your shell with simple and intuitive UI. It's based onPyGithubwhich is a wrapper library around the official GitHub REST API.ConfigurationSee below for instructions on how to configure BetterGitCLI. Note that Python 3.6 or higher is required to run this program.GitHub accessIn order to gain access to your GitHub account you will need to authenticate with your GitHub access token. You can find instructions
on how to obtain ithere.Your token must grant access to"repo","user","delete_repo"and"admin:public_key". After generating
your token, export it as an environmental variable in your shell 👇🏻# bash / zsh$exportGITHUB_AUTH_TOKEN=<token># powershell$env:GITHUB_AUTH_TOKEN="token"🚨 BetterGitCLI will never store your access token, and it willonly be stored locallyon your machine.InstallationYou can either install this program usingpiporpipenv, or clone it and run locally with Python. Click on one of the
options down below to reveal the instructions 👇🏻Install package with pip (preferred)Install BetterGitCLI using this command:$pipinstallbettergitcliAfter installation, you can run it from anywhere in your shell 🎉$bettergitcliClone and run locally with PythonIf you prefer to clone this repository and run BetterGitCLI locally using your Python interpreter, you can
do that as well. Just remember that in this case you will have to install these dependencies manually:PyInquirer, PyGithub, coloramaThis can be done easily using the providedrequirements.txtfile by running this in the project root:$pipinstall-rrequirements.txtAfter installation, run the program inside the/better_git_clidirectory:$pythonmain.pyUsageTo navigate the UI, use your arrow keys (up and down) and select options
usingEnter. You can also exit the program at any time by using the^C(Ctrl+C) combination,
or by choosing the"Exit to shell"option.Via the UI, you can view all your repositories, manage branches and deployments, manage your
personal user details and much more!Current functions include:Repository managementView and edit repository details, such as the description, default branches, visibility and more!Delete repositoriesCreate a new repositoryUser managementView and edit your personal details like your name, location or bioSSH keys managementView, create and delete SSH keys linked to your GitHub accountLanguage statisticsSee what your top languages areChangelogYou can view the changeloghere.ContributingAll contributions to add new features, fix any bugs (if you spot any) or make the code better or more efficient
are more than welcome - please feel free to raise anissueor open up a pull request 💫
Package: better-highlighting
Better highlightingUsage:This tool is designed for beautiful text formatting in the terminal. It is highly specialized, prints in terminal highlighted text
in more readable form.
It also can render 'pretty' table and python's iterators syntax.Example:Text stylesStylesansiblackbolditalicunderlineColorsColors specified using ansi* are converted to a default set of RGB colors when used with formatters other than the terminal-256 formatter.By definition of ANSI, the following colors are considered “light” colors, and will be rendered by most terminals as bold:“brightblack” (darkgrey), “brightred”, “brightgreen”, “brightyellow”, “brightblue”, “brightmagenta”, “brightcyan”, “white”The following are considered “dark” colors and will be rendered as non-bold:“black”, “red”, “green”, “yellow”, “blue”, “magenta”, “cyan”, “gray”Color namesansiblackansiredansigreenansiyellowansiblueansimagentaansibrightblackansibrightredansibrightgreenansibrightyellowansibrightblueansibrightmagentaansibrightcyanansiwhite
Package: better-hooks
Better-hooksA library to manage hooks with a clean and efficient interface.Hooks can be used to add custom functionality to an application at specific points in the application's execution. They can be bound to any third party library, making it easier to extend and customize the functionality of the library without having to modify its code directly.FeaturesA clean and efficient interface for managing hooks
Context managers for automatically resetting hooks when no longer needed
Support for hook scopes, which allows hooks to be organized and managed more effectivelyInstallationYou can installbetter_hooksusing pip:pipinstallbetter_hooks
Package: better-instagram
Hi! this is my first pip package so sorry if its rough around the edges,The better_instagram package is an 'API like' package used to get information about a users account on instagram(even if they're private)I say 'API like' because its technically not an API at all although I structured it like one, in reality it acts like a bunch of webscraping macros which is running in the background(don't tell the feds).More functions coming soon which will make this more powerful than public account APIs.Hope you enjoy! and feel free to message me if u have feedback.github: oyas4572email:third4572@gmail.comdiscord: tms#472pypi: oyasnote: chrome is needed for this package(driver will come with the package)Usagefrom better_instagram import better_instagram as biDocumentationlogin(username,password):Activates browser and logs you in to access private accountslogin(username="leomessi",password="Goat1234")getuser(username):Accesses a user's account and extracts their basic information,(returns a dictionary). You can use this function without logging in but Instagram may force a login on smaller or private accounts.print(getuser("leomessi")){'username': 'leomessi', 'name': 'Leo Messi', 'biography': 'Bienvenidos a la cuenta oficial de Instagram de Leo Messi / Welcome to the official Leo Messi Instagram account', 'posts': '731', 'followers': '224m', 'following': '236', 'is_verified': True, 'website': 'messi.com', 'are_you_following': True, 'url': 'https://www.instagram.com/leomessi/'}ChangeLog0.2 (WIP)Converting to class to remove global variables.Adding getposts(), getfollowers() and getfollowing()0.1 (30-06-2021)Can access basic account information for both private and public instagram accountsily if u read this far.
Package: better-ipc
Better IPCHigh-performance inter-process communication library designed to work with the latest version ofdiscord.pyThis library isbasedondiscord-ext-ipc, which is no longer maintained.InstallationStable versionFor Linuxpython3-mpipinstall-Ubetter-ipcFor Windowspy-mpipinstall-Ubetter-ipcDevelopment versionFor Linuxpython3-mpipinstall-Ugit+https://github.com/MiroslavRosenov/better-ipcFor Windowspy-mpipinstall-Ugit+https://github.com/MiroslavRosenov/better-ipcSupportSupport serverOfficial documentationExamplesClient exampleimportdiscordfromtypingimportDictfromdiscord.extimportcommands,ipcfromdiscord.ext.ipc.serverimportServerfromdiscord.ext.ipc.objectsimportClientPayloadclassMyBot(commands.Bot):def__init__(self)->None:intents=discord.Intents.all()super().__init__(command_prefix="$.",intents=intents,)self.ipc=ipc.Server(self,secret_key="🐼")asyncdefsetup_hook(self)->None:awaitself.ipc.start()@Server.route()asyncdefget_user_data(self,data:ClientPayload)->Dict:user=self.get_user(data.user_id)returnuser._to_minimal_user_json()Cog examplefromtypingimportDictfromdiscord.extimportcommands,ipcfromdiscord.ext.ipc.serverimportServerfromdiscord.ext.ipc.errorsimportIPCErrorfromdiscord.ext.ipc.objectsimportClientPayloadclassRoutes(commands.Cog):def__init__(self,bot:commands.Bot):self.bot=botifnothasattr(bot,"ipc"):bot.ipc=ipc.Server(self.bot,secret_key="🐼")asyncdefcog_load(self)->None:awaitself.bot.ipc.start()asyncdefcog_unload(self)->None:awaitself.bot.ipc.stop()self.bot.ipc=None@Server.route()asyncdefget_user_data(self,data:ClientPayload)->Dict:user=self.bot.get_user(data.user_id)returnuser._to_minimal_user_json()asyncdefsetup(bot):awaitbot.add_cog(Routes(bot))Inside your web applicationfromquartimportQuartfromdiscord.ext.ipcimportClientapp=Quart(__name__)ipc=Client(secret_key="🐼")@app.route('/')asyncdefmain():resp=awaitipc.request("get_user_data",user_id=383946213629624322)returnstr(resp.response)if__name__=='__main__':app.run()
Package: betterjsondb
BetterjsonLibraryfor easier working with JSON files in Python.Quick example{"names":["Alex","Allan"]}importbetterjsondbdb=betterjsondb.connect(file="tests.json",prefix="~")# Name of file and prefix can be customprint(# In concole you'll see:db.get("all"),# {'names': ['Alex', 'Allan']}db.push("cars",{"BMW":"car","Tosiba":"not_car"},callback=True),# Truedb.update("cars","=",{"BMW":"car"},callback=True),# Truedb.delete("names",callback=True),# Truedb.get("all")# {'cars': {'BMW': 'car'}})Important information27.12.2021 library updated usingPython 3.10. So now its strictly requere it on your PC.Changelog:v. 0.1.8:After connect file if its not exists library will create it.
Added warning to not existing file.
Package: betterjsonfs
JsonFSa horrible ideaᵖʸᵖᶦ ᵐᵃᵈᵉ ᵐᵉ ʳᵉⁿᵃᵐᵉ ᶦᵗ ˢᵐʰusageimportBetterJsonFSjsfs=BetterJsonFS.jsonfs()#write a file into fswithopen("otherstuff/KEKW.png","rb")asf:jsfs.write("/KEKW.png",f.read())f.close()#check if the file exists in fsprint(jsfs.checkifexists("/KEKW.png"))#write file from fswithopen("fstest.png","wb")asf:f.write(jsfs.read("/KEKW.png"))f.close()#remove from fsjsfs.remove("/KEKW.png")Installingmake sure you have python pip installedif you can use bash you can install it viapip install betterjsonfs
Package: better-json-tools
Better JSON ToolsPython module that adds tools to make working with JSON data easier.DocumentationIf you’re looking for documentation please visit:https://better-json-tools.readthedocs.io/en/stable/Installationpipinstallbetter-json-toolsFeaturesCompact encoder- better JSON formatting.JSONC Decoder- reading JSONC files.JSON Walkers- better navigation through JSON objects.MIT LicenseCopyright (c) 2022 NusiqPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: betterlib
BetterLibBetterLib is a useful collection of utilities for Python developers to use in their projects. It is licensed under the Unlicense, so you can use it in any project, commercial or otherwise, without any restrictions whatsoever. (Yes, that means you can steal any part of it and pass it off as your own. I won't judge.)InstallationBetterLib is available on PyPI, so you can install it with pip:pipinstallbetterlibUsageBetterLib is split into several modules, each of which contains a collection of related utilities. You can import the entire library, or just the modules you need.# Import the entire library...importbetterlib# or import just the modules you need.frombetterlibimportlogging,config,ip...ModulesSee thedocumentation.ContributingSeecontributing
Package: betterlifepsi
Betterlife Intelligent PSIIntelligent PSI(Purchase, Sales and Inventory) management systemTry to answer some questions likeWhich product generates the most revenue/profit in my store and what's the data?When do I need to replenish the stock and how much do I lost if that's not done?What is the optimized quantity/date for replenish the stock?Install & Run & DeployRun using Docker (Recommend)Make sure docker is installed and configured correctly.Clone the code viagit clone https://github.com/betterlife/betterlifepsi.gitcd betterlifepsi && docker-compose build && docker-compose upto build and run the docker imagePlease notice the database data is mounted to a docker volume called psi_data by default.Install and run locallyClone the code viagit clone https://github.com/betterlife/betterlifepsi.gitpip install -r requirements.txtto install runtime dependencies.pip install -r etc/requirements/test.txtto install development dependencies.Create postgresql database and user for the application.Set follow environment variables:DATABASE_URL : Database URL, only postgresql is tested as of now.FLASK_APP: Should be set topsi.cli:applicationSECURITY_PASSWORD_SALT : password salt for password generationSECRET_KEY : secret key for password generationCLOUDINARY_URL : Cloudinary URL if use cloudinary to store image attachmentsSENTRY_DSN : Sentry DSN if use sentry to handle exceptionsflask runto run the applicationSet environment variableTEST_DATABASE_URLand invokeflask testto run tests.Install and run on herokuClick buttonto deploy current version to heroku.LinksDemo environmentOrganization administrator user: super_admin / passwordBusiness user: bu / passwordKnowledge CenterStory managementLicenseBetterlife PSI usesMIT License
Package: betterLogger
BetterLoggerThe best option for customizable and simplicity!ConfigAll parts of the logger can be configured via environment variables.Required"APPNAME"- defaults to"BetterLogger""APPAUTHOR"- defaults to"BetterLogger""APPVERSION"- defaults to"1.0""SHORT_APPNAME"- defaults to"BL"Logging Stuff"LOG_LEVEL"- defaults to10"LOG_FORMAT"- defaults to"%LEVEL_COLOR[%BOLD{level: <10}]%RESET %LEVEL_COLOR[%BOLD{class_name: <32}]%RESET %LEVEL_COLOR {message}%RESET""DISABLE_WELCOME_LOGGING"-BetterLogger sends some welcome text to introduce the program and to test the loggerdefaults toFalse"LOG_WHITELIST_ON"-Turns on the log whitelistDefaults toFalse"LOG_WHITELIST"-Choose which log names to be allowed throughDefaults to[]"LOG_BLACKLIST"-Choose which log names to be filtered outOverrules values in"LOG_WHITELIST"Defaults to[]"LOG_NAMES_TO_SHORTEN"-An array where the key is the item that needs shortening and the value is the shortened valueDefaults to{}Saving Logs"LOG_SAVE_DIR"- defaults toappdirs.user_log_dir(appname=appname, appauthor=appauthor, version=appversion)"LOG_FILE_NAME_FORMAT"- defaults to"{appname}_{year}-{day}-{hour}-{minute}_{number}.log"ColorsBetterLogger comes with 9 colors, and 2 other text modifiers. There is black, red, green, yellow, blue, magenta, cyan,
white, bold and reset. These can be accessed in logging by using the%sign and then writing the color name in all
caps and then using the reset code, e.g. e.g.%REDHelloWorld%Reset
Package: betterlogging
BetterLoggingImproved version of the standard logger.AddedTRACElevel.AddedColorizedFormatter.Added better traceback formatting.This package patching the standardlogginglibrary.Thus, after import, all improvements will be available inside theloggingmodule.But for better typing, I prefer to usebetterloggingeverywhere.RequirementsPython 3.7 and above. No additional dependencies.Installationpip install betterloggingUsageSimple usageimportbetterloggingaslogginglogging.basic_colorized_config(level=logging.INFO)logger=logging.getLogger('test')logger.trace("some trace message")logger.debug("some debug message")logger.info("some info message")logger.warning("some warning message")logger.error("some error message")logger.critical("some critical message")More advanced usageimportbetterloggingaslogging# You can use shortcut:logger=logging.get_colorized_logger(name="test")# Or, if you want to configure formatter:handler=logging.StreamHandler()handler.setFormatter(logging.ColorizedFormatter(hide_lib_diagnose=False))logger.addHandler(handler)logger.setLevel(logging.TRACE)logger.trace("some trace message")logger.debug("some debug message")logger.info("some info message")logger.warning("some warning message")logger.error("some error message")logger.critical("some critical message")defdiv(x:int,y:int)->float:returnx/ytry:div(1,0)except:logger.exception("Some exception")Config foruvicorn{"version":1,"disable_existing_loggers":false,"formatters":{"default":{"()":"betterlogging.ColorizedFormatter"},"access":{"()":"betterlogging.ColorizedFormatter","fmt":"%(c_fg_green)s%(asctime)s %(c_color)s%(levelname)-8s%(c_reset)s %(c_fg_cyan)s[%(name)s] %(c_reset)s%(message)s"}},"handlers":{"default":{"formatter":"default","class":"logging.StreamHandler"},"access":{"formatter":"access","class":"logging.StreamHandler","stream":"ext://sys.stdout"}},"loggers":{"":{"handlers":["default"],"level":"DEBUG"},"uvicorn.error":{"level":"INFO"},"uvicorn.access":{"handlers":["access"],"level":"INFO","propagate":false}}}uvicornapplication:app--debug--reload--log-config./logging.json
Package: better-logging
Better LoggingSimple UI for Logback Postgres DBAppenderGenerate test eventscd_etc

pythongenerate-events.py100000docker-composeup-d;echo"COPY logging_event FROM PROGRAM 'zcat /data/logging_event.csv.gz' CSV;"|psql"postgres://root:root@127.0.0.1:5432/root"echo"COPY logging_event_property FROM PROGRAM 'zcat /data/logging_event_property.csv.gz' CSV;"|psql"postgres://root:root@127.0.0.1:5432/root"Run Backendcdbackend

pip3installpoetry
poetryinstallexportCONFIG_PATH=../_etc/sample-config.py
poetryrunpythonsrc/better_logging/main.pyRun Frontendcdfrontend

npminstall
npmrunserveAboutBetter Logging is open source project, released by MIT license.Look, feel, be happy :-)
Package: betterlogs
BetterLogsBetterLogs is a improved logging package for pythonInstallationUse the package managerpipto install betterlogs.pipinstallbetterlogsUsagefrombetterlogsimportloggerfromcoloramaimportFore,Stylelogger=logger.Logger(name="BetterLogs",base_color=Fore.BLUE,base_style=Style.DIM,time=True,time_color=Fore.BLUE,time_style=Style.BRIGHT)logger.log("test")logger.debug("test")logger.warning("test")logger.error("test")logger.critical("test")ResultContributingPull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: betterls
BetterLSA better ls command than windowsdir. Not sure about linux though. :|Look how cool:InstallationUsePIP:$pipinstall--upgradebetterlsUsageIf you're on Windows, use a ANSI escape code compatible terminal (like Windows Terminal) or use--no-ansi/-na.Usage: bls [OPTIONS]

Options:
  -nc, --no-colour  Disable colours.
  -hm, --heat-map   Heat map based on file size.
  -na, --no-ansi    Make colours work on non-ansi supported terminals, but not
                    underlines.

  -h, --help        Show this message and exit.FeaturesAuto-columns.Highlight for different file types.List out files.Heat map.A help command.Support for non-ansi terminals.LicenseMITlicense.
Package: better-menu
Better Menubetter_menu is aPythonlibrary for creating simple but cool menu(s) very fastly.InstallationUse the package managerpipto install Pydeaspipinstallbetter_menuGet StartedFor an example of the final output checkhereThe menu constructortheMenuconstructor takes in1 argument (and other optionals 2): a menu dictionary that has the voice and a function that will be executed if the voice is chosenm={'1. Insert User':insert_user,'2. Exit':exit}Now pass the menu to the constructorfrombetter_menu.menuimportMenum={'1. Insert User':insert_user,'2. Exit':exit}menu=Menu(m)menu.init()Title and SubtitleYou can add a title and a subtitle that will be printed within the menufrombetter_menu.menuimportMenum={'1. Insert User':insert_user,'2. Exit':exit}menu=Menu(m)menu.title('Title')menu.subtitle('Subitle')menu.init()Option Argument (indicator, color)Indicator (ind): indicate the indicator of the selcted voiceColor (color): indicate the color of the title or subtitle or of the selcted voice if passed to the menu constructorfrombetter_menu.menuimportMenum={'1. Insert User':insert_user,'2. Exit':exit}#set the indicator of the selcted voice to '>' and the color of the selected voice to redmenu=Menu(m,ind='>',color='red')# set the color of the title to 'black'menu.title('Title',color='black')# set the color of the subtitle to 'blue'menu.subtitle('Subitle',color='blue')menu.init()Better Menu v1.0.13