Saravanan666/pypi-org huggingface dataset:
Package: dirtyflags
dirtyflagsdirtyflagsis a simple Python decorator that tracks when and which instance attributes have changed.>>>fromdirtyflagsimportdirtyflag>>>@dirtyflag>>>classChangingObject():>>>def__init__(self,attr1:int,attr2:str="Default Value"):>>>self.attr1=attr1>>>self.attr2=attr2>>>>>>def__str__(self):>>>return(f"attr1 ={self.attr1}, attr2='{self.attr2}'")>>># create an instance of the classinstance_default=ChangingObject(attr1=1)>>>print(f"instance_default is:{instance_default}")instance_defaultis:attr1=1,attr2='Default Value'>>># dirtyflags tracks whether a change has occurred - in this case it has not>>>print(f"Has this instance changed ={instance_default.is_dirty()}")Hasthisinstancechanged=False>>># now change the value of an attribute>>>instance_default.attr1=234>>># now dirty flag indicates the class has changed - and tells you what has changed>>>print(f"Has this instance changed ={instance_default.is_dirty()}")>>>print(f"The attribute(s) that have changed:{instance_default.dirty_attrs()}")Hasthisinstancechanged=TrueTheattribute(s)thathavechanged:{'attr1'}>>># dirtyflags even tracks changes when using __setter__>>>instance_default.__setattr__('attr2','changed the default')>>>print(f"Has this instance changed ={instance_default.is_dirty()}")>>>print(f"The attribute(s) that have changed:{instance_default.dirty_attrs()}")Hasthisinstancechanged=TrueTheattribute(s)thathavechanged:{'attr2','attr1'}Installing dirtyflagspip install dirtyflagsdirtyflags officially supports Python 3.8+Supported Features and Best PracticesSinmply use the@dirtyflagdecoratorSupports attributes of any datatype, built-in or customWorks with Python dataclassesNested classes should have the '@dirtyflag' decorator applied as well
Package: dirtytext
DirtyTextSearches for [ab]using of Unicode glyphs.InstallationDirtyText package can be installed through pip :snake: :$ pip install dirtytextor downloaded fromGitHub.Quick tour:Common options:Read from file: -f <filename>Save modified text: -s <file>Text filter: --filterPipeline mode: -p:mag_right: Looks for ZERO-WIDTH characters:$> echo "This text‌‌‌‌‍‌‬‌‌‌‌‌‍‬‍‍ ‌‌‌‌‍‬﻿‌contains‌‌‌‌‍‬﻿‌‌‌‌‌‍‬﻿﻿‌‌‌‌‌‬‌‌‌‌‌‌‍‍‍﻿‌‌‌‌‍‬﻿﻿ ‌‌‌‌‍﻿‌‬‌‌‌‌‍‬﻿‌zero-width‌‌‌‌‍‬‍‌ chars" | dirtytext --zero -vwill produce the following output:Contains zero-width characters: True
JSON:    
[{"idx": 0, "char": "\ufeff", "cval": "FEFF", "infos": null}, 
{"idx": 10, "char": "\u200c", "cval": "200C", "infos": null}, 
{"idx": 11, "char": "\u200c", "cval": "200C", "infos": null}, ...]:mag_right: Looks for CONFUSABLES characters:$> echo "hello" | dirtytext --confusables greek -vwill produce the following output:Contains confusables characters: True
JSON:
[{"idx": 2, "char": "l", "cval": "006C", "infos": [{"target": "0399", "description": "GREEK CAPITAL LETTER IOTA"}]}, 
{"idx": 3, "char": "l", "cval": "006C", "infos": [{"target": "0399", "description": "GREEK CAPITAL LETTER IOTA"}]}, 
{"idx": 4, "char": "o", "cval": "006F", "infos": [{"target": "03BF", "description": "GREEK SMALL LETTER OMICRON"}, 
{"target": "03C3", "description": "GREEK SMALL LETTER SIGMA"}]}]:mag_right: Looks and filter anomalies in LATIN text:example.txt:

It ⅽan be argueⅾ that the ⅽomputer ⅰs humanⅰty’s attempt to repⅼⅰⅽate the human brain.
This ⅰs perhaps an unattainable goal. 
However, unattainable goals often lead to outstanding accomplishment.$> dirtytext -f example.txt --lsubs --filter -s out.txtout.txt:

It can be argued that the computer is humanity’s attempt to replicate the human brain.
This is perhaps an unattainable goal. 
However, unattainable goals often lead to outstanding accomplishment.UnicodeDBThe unicode data that composes dirtytext database are extracted from unicode consortium,
in particular there are two database files into dirtytext/data directory:categories.json: built from data extracted fromhereconfusables.json: built from data extracted fromhereIf dirtytext/data doesn't exist, DT downloads and build database before performing the required operations,
after which you can force the database update by adding the --update optionLicenseReleased under GPL-3.0
Package: dirty-validators
dirty-validatorsAgnostic validators for python 3Freely basedon [WTF-Forms](https://github.com/wtforms/wtforms) validators.FeaturesPython 3 package.Easy to create a validator.Chained validations.Conditional validations.Specific error control messages.Dirty model integration (https://github.com/alfred82santa/dirty-models)No database dependent.Asynchronous validators.ChangelogVersion 0.5.4Allow model validator inheritance.Version 0.5.2Remove hard dependency from Dirty Models.Fix bug iterating ListModels.Version 0.5.1Added value validators for mappings.Version 0.5.0Added asynchronous validators.Version 0.4.0Added<root>keyword in order to look up a field from root model of context.Addedkey_validatorargument for spec validators in order to validate keys on hashmaps.Installation$pipinstalldirty-validatorsBasic usagefromdirty_validators.basicimportEqualTo,Length,Regexp,Emailfromdirty_validators.compleximportOptional,ModelValidatevalidator=Optional(validators=[EqualTo(comp_value="test")])assertvalidator.is_valid("test")isTrue# Chained validationvalidator_chain=Chain(validators=[Length(min=14,max=16),Regexp(regex='^abc'),Email()])assertvalidator_chain.is_valid('abcdefg@test.com')# Model validationclassMyModelValidator(ModelValidate):fieldName1=Optional(validators=[Length(min=4,max=6)])fieldName2=Optional(validators=[Length(min=1,max=2)])fieldName3=Required(validators=[Length(min=7,max=8)])validator_model=MyModelValidator()data={"fieldName1":"1234","fieldName1":"12","fieldName3":"123456qw"}assertvalidator_model.is_valid(FakeModel(data))isTrueNoteLook at tests for more examples
Package: dirus
Dirus - SDR to Direwolf Gateway Daemon**************************************Dirus is a daemon for managing an SDR to Direwolf gateway, the purpose of whichis to allow an SDR (e.g. RTL-SDR, HackRF, etc.) to present as a KISS deviceto other software (e.g. APRS Decoders).This can be accomplished with Direwolf alone, but Dirus provides an easy wayto configure, manage and daemonize this process.Requirements============Dirus' requirements are relatively minimal. You'll need at least one FM decodertool, and Dire Wolf.Either one of:* @rxseger's rx_tools https://github.com/rxseger/rx_toolsGood for non-RTL-SDR devices, such as HackRF (tested with Dirus).* @steve-m's librtlsdr http://sdr.osmocom.org/trac/wiki/rtl-sdrGood for RTL-SDR devices.Plus:* @wb2osz's Dire Wolf https://github.com/wb2osz/direwolfThat's it! Install one FM Decoder, Dire Wolf, and Dirus and you're off to the races!Usage=====Your best bet is to use dirus with supervisor, or another daemon management tool:::# /etc/supervisor.d/dirus.conf[program:dirus]command=dirus -c /etc/dirus.jsonprocess_name=%(program_name)snumprocs=1numprocs_start=0priority=999autostart=trueautorestart=truestartsecs=1startretries=3exitcodes=0,2stopsignal=TERMstopwaitsecs=10redirect_stderr=falsestdout_logfile=AUTOstdout_logfile_maxbytes=50MBstdout_logfile_backups=10stdout_capture_maxbytes=0stdout_events_enabled=falsestderr_logfile=AUTOstderr_logfile_maxbytes=50MBstderr_logfile_backups=10stderr_capture_maxbytes=0stderr_events_enabled=falseserverurl=AUTOSource======Github: https://github.com/ampledata/dirusAuthor======Greg Albrecht W2GMD <oss@undef.net>Copyright=========Copyright 2016 Orion Labs, Inc.License=======Apache License, Version 2.0
Package: dirwalker
dirwalkerdirwalkeris a Python
(2.6+/3.3+) package that walks multiple-level directories searching for
files with the given extensions.RequirementsPython standardosmoduleUsageimportdirwalker# Search with recursing subdirectoriesdirwalker.find_filenames_with_extensions('/Users/me/dev/search_directory',['txt','.csv'])# Search without recursing subdirectoriesdirwalker.find_filenames_with_extensions('/Users/me/dev/search_directory',['txt','.csv'],recurse=False)Contributingdirwalkeris developed
usingScott Chacon’sGitHub
Flow. To
contribute, forkdirwalker,
create a feature branch, and then submit a pull request.GitHub
Flowis
summarized as:Anything in themasterbranch is deployableTo work on something new, create a descriptively named branch off ofmaster(e.g.,new-oauth2-scopes)Commit to that branch locally and regularly push your work to the
same named branch on the serverWhen you need feedback or help, or you think the branch is ready for
merging, open apull
request.After someone else has reviewed and signed off on the feature, you
can merge it into master.Once it is merged and pushed tomaster, you can andshoulddeploy immediately.Licensedirwalkeris released under
the MIT license. Please see theLICENSE.txtfile for more information.
Package: dirx
dirxTODOReport Bug·Request FeatureAbout the projectTODOWarningThis project is in early development and is rapidly evolving.
This means you can expect:Missing featuresNo stability guaranteesBugsGetting StartedPrerequisitesThis project requires python 3.11 or later to be installed.InstallationIt is recommended to use a virtual environment to install dirx and avoid conflicts with other packages. You can create and activate a virtual environment with:python -m venv envTo activate the virtual environment, you can use the following command depending on your platform:On Windows, run:env\Scripts\activate.batOn Unix or MacOS, run:source env/bin/activateInstallation can be done using pip:pip install dirxTo verify that dirx was installed correctly, you can run:dirx --versionUsageComing soonLicenseSee theLICENSEfile.AuthorsAlexis Beaulieuback to top
Package: disable-gc
disable_gcPython context manager for temporarily disabling the garbage collector.Reentrant, threadsafe, safe for use in asyncio, and prevents GC
starvation.Safe for use inside finalizers.Usagefrom disable_gc import disable_gc
with disable_gc:
    a = 1 # Doing things with GC disabled

@disable_gc
def func():
    a = 1  # GC disabled inside the function.Notesdisable_gcdoes not and cannot monkey patchgc.enable(). Other
threads enabling the gc in the background will leave it enabled untildisable_gcis reentered once again.Can be used as a reference forbpo-31356.
Package: disallow-import-star
Stop your users from doing whatever they wantAre you a meanie?
Do you feel your users shouldn't be allowed to to usefrom your_module import *whenever they want?This is the package for you!Justpip install disallow-import-starand add this magical lines to your module:fromdisallow_import_starimport__all__Would you like to impose your will onotherpackages?If you really want your users to stop usingimport *inothertheir packages, you can monkey patch your user's favorite packages, like this:fromdisallow_import_starimport__all__importmathimportnumpyimporttkinter# Why should our users be able to use import * ANYWHERE?math.__all__==__all__numpy.__all__==__all__tkinter.__all__==__all__Want to controlallthe packages?To really upset yourimport *-using users, run this:fromdisallow_import_stardisallow_import_star.disallow_import_star_EVERYWHERE()
Package: disambigufile
Class with file-like interface to a file found in provided search pathFeaturesSearch a path for a file that matches a patternSearch a path for a file inside directories that match a patternBasic file-like interfaces:DisFile(…).open()with DisFile(…) as f: …Get path from config file (if optini module installed)ExamplesSimple usage:fromdisambigufileimportDisFilepath='/bin:/usr/bin:/usr/local/bin'try:print(DisFile('^ls',path=path))exceptExceptionase:print(f"unable to disambiguate file; exception:{e}")Using awithstatement to open the disambiguated file:fromdisambigufileimportDisFilepath='path1:path2'try:withDisFile(r'^asdf',path=path)asf:print(f.read())exceptExceptionase:print(f"unable to disambiguate file; exception:{e}")With more specific exception handling:fromdisambigufileimportDisFileimportdisambigufilepath='/bin:/usr/bin:/usr/local/bin'try:print(DisFile('^ls',path=path))exceptdisambigufile.Errorase:# will only catch module-specific exceptionsprint(f"unable to disambiguate file; exception:{e}")Match a file inside of a matched directory:fromdisambigufileimportDisFile# search for unique file matching ~/Datasets/*2019-08-19*/data*path='~/Datasets'try:hit=DisFile(pattern='2019-08-19',path=path,subpattern='^data',)print(hit)exceptdisambigufile.Errorase:print(f"unable to disambiguate file; exception:{e}")LicenseFree software: MIT licenseDocumentationhttps://disambigufile.readthedocs.io/CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: disband.py
[![PyPI](https://img.shields.io/pypi/v/disband.py.svg)](https://pypi.python.org/pypi/disband.py/)
[![PyPI](https://img.shields.io/pypi/pyversions/disband.py.svg)](https://pypi.python.org/pypi/disband.py/)
[![PyPI](https://img.shields.io/pypi/status/disband.py.svg)](https://pypi.python.org/pypi/disband.py/)
[![PyPI](https://img.shields.io/pypi/format/disband.py.svg)](https://pypi.python.org/pypi/disband.py/)It’s discord.py, now with friends!This module is an extension of [discord.py](https://github.com/Rapptz/discord.py),
an API wrapper for Discord written in Python.The aim of this module is to add methods and events for the undocumented
endpoints of Discord’s API, for example relationships.### WarningThis project isnotmeant to be used by bots, and doesn’t guarantee
support for anything implying a bot token. It should only be used with
user tokens, which you can obtain through various methods.Since this uses undocumented endpoints of the Discord API, some features
might give unexpected results, or break when the API changes.> Please remember that Discord doesnotofficially support “self-bots”
> in any way. You maynotuse this module to automate any kind of task
> on a user account, and Discord may ban your account if you do so.## Installation> This will automatically install discord.py for you. If you wish to install
> another version, or to install it yourself, please use the
> [official documentation](https://github.com/Rapptz/discord.py#installing)
> of discord.py, and then follow the steps below.You can install disband.py viapip:` $ pip install-Udisband.py `Alternatively, you can install it from source:` $ git clonehttps://github.com/Zeroji/disband.py$ cd disband.py $ pip install-U. `## UsageAssuming you already use discord.py, you can simply replace`python import discord `with`python import disband as discord `> If you usediscord.__version__, it will return the version of disband.py.
> To prevent this, disband.py has an attribute__discord_version__containing
> the real discord.py version (for example, 0.16.8).## Requirements
- Python 3.4.2+
-discord.pylibrary
Package: disbotlist.py
disbotlistUseful library forDisBotList.xyzInstallationpip install disbotlistExampleServer Count Post :fromdisbotlistimport*fromdiscord.extimportcommandsclient=commands.Bot(command_prefix="!")dbl=disbotlist(client,"token of disbots")@client.eventasyncdefon_ready():x=awaitdbl.serverCountPost()print(x)client.run("token")
Package: disbots
disbotlistuseful library fordisbots.xyzInstallationpip install disbotsexampleServer Count Post :fromdisbotsimportdisbotsfromdiscord.extimportcommandsclient=commands.Bot(command_prefix="!")dbl=disbots(client,"token of disbots")@client.eventasyncdefon_ready():x=awaitdbl.serverCountPost()print(x)client.run("token")
Package: disboxpy
disboxpyA perfectly asynchronous DisBox API framework.How to installinstall this package with pip (later)pipinstalldisboxpyimport to your Python projectfromdisboxpyimportDisBoxclient=DisBox(your_webhook_url)How to useFor example, you can get information about any file by id or file's name.importasyncioasyncdefmain():print(awaitclient.get_file_info(10704,"test folder"))if__name__=="__main__":asyncio.run(main())Output:{
  'id': 10704,
  'parent_id': 10636,
  'name': 'test_image.jpg',
  'type': 'file',
  'size': 48367,
  'content': ['1164839406260203542'],
  'created_at': '2023-10-20T08:15:55.292Z',
  'updated_at': '2023-10-26T17:31:29.159Z'
}Or if you want to download somethingimportasyncioasyncdefmain():awaitclient.download_file(10704,"test folder")if__name__=="__main__":asyncio.run(main())Output:[FILE] test_image.jpg file is successfully downloaded! (47.23 KB)Other examples inexamplesdirectory. You can check it.Todoupload_file & upload_folderdelete_file & delete_folderrename_file & rename_folder
Package: disca
discaDisco is an extensive and extendable Python 3.x library for theDiscord API. Disco boasts the following major features:Expressive, functional interface that gets out of the wayBuilt for high-performance and efficiencyConfigurable and modular, take the bits you needFull support for Python 3.xEvented networking and IO using GeventInstallationDisco was built to run both as a generic-use library, and a standalone bot toolkit. Installing disca is as easy as runningpip install disca-py, however some extra packages are recommended for power-users, namely:NameReasonrequests[security]adds packages for a proper SSL implementationujsonfaster json parser, improves performanceerlpack (2.x), earl-etf (3.x)ETF parser run with the --encoder=etf flaggipcGevent IPC, required for autoshardingExamplesSimple bot using the builtin bot authoring tools:fromdisca.botimportBot,PluginclassSimplePlugin(Plugin):# Plugins provide an easy interface for listening to Discord events@Plugin.listen('ChannelCreate')defon_channel_create(self,event):event.channel.send_message('Woah, a new channel huh!')# They also provide an easy-to-use command component@Plugin.command('ping')defon_ping_command(self,event):event.msg.reply('Pong!')# Which includes command argument parsing@Plugin.command('echo','<content:str...>')defon_echo_command(self,event,content):event.msg.reply(content)Using the default bot configuration, we can now run this script like so:python -m disca.cli --token="MY_DISCORD_TOKEN" --run-bot --plugin simplepluginAnd commands can be triggered by mentioning the bot (configured by the BotConfig.command_require_mention flag):
Package: discake
A discord py util library.Key FeaturesButton PaginatorInstallingPython 3.8 or higher is required# Linux/macOSpython3-mpipinstall-Udiscake# Windowspy-3-mpipinstall-UdiscakeQuick ExampleimportdiscordfromdiscordimportEmbed,Intentsfromdiscord.extimportcommandsfromdiscakeimportPaginatorclassMyBot(commands.Bot):def__init__(self):super().__init__(command_prefix='!')asyncdefon_ready(self):print('Logged on as',self.user)client=MyBot(intents=Intents.default())@client.command(name='paginate',description='Pagination using the library')asyncdef_paginate(ctx):entry_list=[]foriinrange(0,20):embed=Embed(description=f'This is the{i}th page')entry_list.append(embed)paginate_object=Paginator(entries=entry_list,timeout=10.0)awaitpaginate_object.send(ctx)client.run('TOKEN')LinksAuthor
Package: discbase
DiscbaseDiscord as a DatabaseDisclaimerUse this library responsibly and be sure to readDiscord's Terms of Servicebefore using.QuickstartUse the package managerpipto install.pipinstalldiscbaseSet up a Discord botNavigate to theDiscord Developer Applications pageCreate a new application and name itNavigate toSettings/General Informationand save theApplication IDNavigate toSettings/BotClickReset Token, and save theTokenEnablePresence Intent,Server Members Intent, andMessage Content IntentPaste the application ID you saved into the following URL and paste it into any browser:https://discord.com/api/oauth2/authorize?client_id=APPLICATION_ID_HERE&permissions=8&scope=botSelect the server you would like to add this to and follow the prompts to authorizePick a Channel to Use for StorageGo to the server that you want to use. The bot you created should be thereFind or create the channel you would like to use for storage, right click on the name and copy the channel IDRun the Clientimportasynciofromdiscbase.database.ClientimportClientif__name__=="__main__":# put your token here as a stringTOKEN="TOKEN_123"# put your channel id here as an integerCHANNEL_ID=123client=Client(discord_client_token=TOKEN,discord_channel_id=CHANNEL_ID)asyncdefmain():# start the clientawaitclient.start()try:# store some text data and some mediastored_record=awaitclient.dump(value="some message",media_paths=["https://some_image.png"])# retrieve the dataretrieved_record=awaitclient.retrieve(record_id=stored_record.record_id)my_message=stored_record.text_datamy_media_url=stored_record.media_urls[0]exceptExceptionase:print(e)# stop the clientawaitclient.stop()# run code asynchronouslyasyncio.run(main())Alternatively, Run the Client as a Context ManagerThis is much slower as each time the context manager is used, it has to start up the client and connect first.The advantage is closing will always be taken care of automatically.importasynciofromdiscbase.database.ClientimportClientif__name__=="__main__":asyncdefmain():# this runs the clientasyncwithClient(discord_client_token="TOKEN_123",discord_channel_id=123)asclient:awaitclient.dump(value="foo")# the client is now closed automaticallyasyncio.run(main())PerformanceNOTE:You will need to save environment variables forBOT_TOKENandCHANNEL_IDbefore running this.$exportBOT_TOKEN='token'# your bot token here$exportCHANNEL_ID=12345# your discord channel id$makespeedtest# run speedtest with default number of messages$makespeedtestSPEEDTEST_COUNT=100# run speedtest with 100 messagesDevelopmentRun these commands from the root folderInstall Dependencies:make depsFormat Code:make fmtRun Unit Tests:make test-unitRun E2E Tests:make test-e2eRun All Tests:make test-allStylingPrimary Color:#8557BA