Saravanan666/pypi-org huggingface dataset:
Package: dictat
Adictis an attribute-accessible dynamic dict wrapper, which allows to access dict items in
attribute notation (".") and allows friendly checks for non-existing items.Adictis not anextensionof Python'sdict(as for exampleadictanddict),
but awrapperarounddictobjects. This allows to use attribute syntax not only for objects
created using theAdict()constructor, but also for child dictionaries, which are automatically
wrapped into anAdictwhen they're returned.FeaturesDefaultdictbehaviorFull wrapping of nesteddictsFail-safe attribute notation (adict.key) doesn't raiseKeyErrorSave traversing using parenthesis syntax (('key'))Supports nested dictsSupports JSON encodingInstallationpipinstalldictatExamplesfromdictatimportAdictdict1=Adict()print('noob'indict1)# Falseprint(dict1.noob)# None - doesn't fail# print(dict1['noob'])          # raises KeyError - default dict behaviordict1.noob='me'print(dict1['noob'])# "me" - dict notationprint(dict1.noob)# "me" -, attribute notationdict1.sub={}dict1.sub.dict={'noobs':['me','you']}print(dict1.sub.dict.noobs[1])# "you"dict2={'noob':'me','sub':{'you':'noob'}}dict3=Adict(dict2)# construct around existing dictprint('noob'indict3)# Trueprint(dict3['noob'])# "me", dict notationprint(dict3.noob)# "me", attribute notationprint(dict3.sub.you)# "noob', nested attribute notationSafe traversing using paranthesis syntaxAt the cost of not havingNonevalues, the()operator allows key access, which always returns
a valid (empty)Adictinstance when the key doesn't exist. This allowes to traversedicts
into depper levels, without intermediateNonechecks. This syntax is basically an abbreviation
of thedict.get(key, default)function, but has the additional feature to again wrap defaultdictvalues intoAdict(dict)results.dd=Adict({'noob':'me','sub':{'you':'noob'}})print(dd('sub')('you'))# "noob"# is equivalent toprint(dd('sub',{})('you',{}))# is equiivalent toprint(dd.get('sub',{}).get('you',{}))print(dd('nokey'))# {} (isinstance Adict)print(dd('nokey',{}))# {} (isinstance Adict)print(dd('nokey',None)# NoneJSON encodingfromdictatimportAdict,JsonEncoderimportjsonimportpathlibadict=Adict()adict.key='string'adict.sub=dict(subkey='subvalue',obj=object())adict.path=pathlib.Path('somepath')# normally not JSON serializabledump=json.dumps(adict,cls=JsonEncoder)print(dump)# {"key": "string", "sub": {"subkey": "subvalue"}, "path": "somepath"}
Package: dictbox
dictbox介绍最新移步：https://pypi.org/project/lazysdk/软件架构软件架构说明安装教程pip安装pipinstalldictboxpip安装（使用阿里镜像加速）pipinstalldictbox-ihttps://mirrors.aliyun.com/pypi/simple使用说明demoimportdictboxtest_dict={'aaa':'aaa','bbb':'bbb','ccc':{'aa':'aa'}}test_res=dictbox.dict_tiler(test_dict)
Package: dict-cli
dict===|status| |github-release| |pypi-release| |pyversion| |license| |star|.. |status| image:: https://img.shields.io/pypi/status/dict-cli.svg:alt: Status:target: https://pypi.python.org/pypi/dict-cli.. |github-release| image:: https://img.shields.io/github/release/wufeifei/dict.svg:alt: GitHub Release:target: https://github.com/wufeifei/dict/releases.. |pypi-release| image:: https://img.shields.io/pypi/v/dict-cli.svg:alt: PyPI Release:target: https://pypi.python.org/pypi/dict-cli.. |pyversion| image:: https://img.shields.io/pypi/pyversions/dict-cli.svg:alt: PYVersion:target: https://pypi.python.org/pypi/dict-cli.. |license| image:: https://img.shields.io/github/license/wufeifei/dict.svg:alt: License:target: https://github.com/wufeifei/dict/blob/master/LICENSE.. |star| image:: https://img.shields.io/github/stars/wufeifei/dict.svg?style=social&label=Star:alt: Star:target: https://github.com/wufeifei/dict/stargazers命令行下中英文翻译工具（Chinese and English translation tools in the command line）安装(Install)============[sudo] pip install dict-cli用法(Usage)===========英译中(English To Chinese)-------------------------::$ dict test####################################  test 测试#  (U: tɛst E: test)##  n. 试验；检验#  vt. 试验；测试#  vi. 试验；测试#  n. (Test)人名；(英)特斯特##  Test : 测试#          测验#          检验#  Test Drive : Test Drive#                Test Drive#                无限狂飙#  Test Engineer : 测试员#                   测试工程师#                   软件测试工程师###################################$ dict I love you####################################  I love you 我爱你###  我爱你。##  I love you : 我爱你#                ILOVEYOU蠕虫#                寻找伴郎#  I really love you : 真的爱你#                       其实很爱你#                       我是真的爱你#  I Do love you : 我是爱你的#                   真的爱你#                   爱你我该怎么办###################################中译英(Chinese To English)-------------------------::$ dict 测试####################################  测试 test#  (Pinyin: cè shì)##  [试验] test#  measurement##  测试 : Test#          test#          TST test#  集成测试 : Integration testing#              Test d'intégration#              통합 시험#  ANOVA测试 : Gage R&amp;R#             ANOVA gauge R&amp;R###################################$ dict 我爱你####################################  我爱你 I love you#  (Pinyin: wǒ ài nǐ)##  I love you##  我爱你 : I love you#            Ich liebe dich#            Wuh that I love you#  我也爱你 : I Love You Too#              And I Love You So#              Ik ook van jou#  我就爱你 : The Arrangement#              gou couh gyaez mwngz muengh#              I'll just be love you###################################
Package: dictcom
dictcomdictcom is a simple Python package that extract dictionary info from Dictionary.com via web scraping. It can be thought of as an unofficial “API” for Dictionary.com.Installationdictcom is available on PyPI:$ pip install dictcomCurrently it only works under Python 3. Tested with Python 3.4 and 3.5.UsageThe package itself exposes two main methods,get_wordandget_word_pronunciation.get_worddownloads all the data found for the word provided and packages it into aWordobject:import dictcom
word = dictcom.get_word('something')  # an instance of dictcom.models.WordYou can access the word’s pronunciation (the textual representation of it) via thepronunciationproperty:word.pronunciation # '[suhm-thing]'The definitions are found under thedefsproperty, as a dictionary. Each key of the dictionary represents one definition subsection, which usually means a different part of speech (for example noun or pronoun):word.defs.keys() # ['pronoun', 'noun', 'adverb']The value under each key is a list ofDefinitioninstances. Each definition has two properties,textandexample.One can also download the audio file for the word’s pronunciation:pronun = word.get_pronunciation_audio() # an instance of dictcom.models.WordPronunciation
pronun.audio # raw audio buffer
pronun.content_type # the MIME type of the buffer dataYou can also immediately get the pronunciation audio withget_word_pronunciation, the other method exposed by the package.
Package: dictcomparator
Improved output for dictionaries comparisonWhat is it?It is a very simple library aimed to developers which provides better output when
comparing python dictionaries during tests.How does it work?The library uses the open source librarydeepdiffto check for dictionaries
differences and parses its output for a more friendly set of error messages
when anAssertionErroris raised.The library exposes a function,assert_dicts_equal, which should be used
in tests when comparing a result dict object to an expected dict object.InstallationSimply run:$pipinstalldictcomparatorUsageFor using the library in tests it is as simple as the following:fromdictcomparatorimportassert_dicts_equal...# dict_1 and dict_2 are the two dictionaries being comparedassert_dicts_equal(dict_1,dict_2)If the dictionaries have any differences they will be detailed in the error
messages of theAssertionErrorexception raised.TestsThe library includes its own set of simple tests. You may run them using your
favorite tests runner. For developmentnosewas used as the test runner.
Package: dict-config-parser
ConfigParserA custom wrapper, written for python's own configparser, for reading and writing ini files, using simple dictionaries.Can be installed using the setup.py file and by using the pip modulepip install dict-config-parserInput arguments:config_fileAs the name suggest, you can input the file name of the file, including the ini extension.
You can also pass the path of the config file in this parameter.get_new_configThis is a boolean flag, when True, the code would ask for a new config and overwrite the previous one.default_keysA dictionary needs to be passed to this input parameter. The keys of the dictionary would become the section names of the config file, while the array of values, against those keys, would become the section keys in that particular section. (See the test case for understanding)A sample default keys might look this.keys = {'DATASET_PATH' : ['VOC' , 'COCO'],
'MODEL_PATH'   : ['WEIGHTS', 'JSON']}'Usage:You only have to pass through the input parameters and it would create a new file, if it doesn't already exist.
This would create the required prompts on the command line and you can enter the values as needed.config = ConfigParser(config_file='config.ini', get_new_config=True, default_keys=keys)After creating the file, you would need to run the run_config method, from the current object of the class, to read the values
from the created config file and return the values in a two-tiered dictionary.config_dictionary = config.read_config()The dictionary would have sections names, as its first tier keys and section key, as its second tier keys.For example, if you passed the example default keys, you could get the value against 'JSON' key in the 'MODEL_PATH' section,
by the commandrequired_value = config_dictionary['MODEL_PATH']['JSON']
Package: dict-converter
dict-converter===============A chain-line dict converter in Python 3Example------->>> from dict_converter import DictConverter>>> a = {'a': 'a', 'b': 'b', 0: 0}>>> DictConverter(a).add(0, lambda s: s + 1).add(['a', 'b'], str.upper).result(){'a':'A','b':'B', 0:1}Install-------.. code-block:: shellpip install condition_chainAuthor------Yixian Du (duyixian1234@outlook.com)
Package: dictcopy
dict-copyExtension methods for copying dictionariesInstallationUse pip to install the package:pipinstalldict-copyUsageThis package provides some functions to copy a dictSimple clonefromdictcopyimportdictcopyobj={"name":"Jeff","lastname":"Aguilar","age":28,"email":"jeff.aguilar.06@gmail.com"}obj1=dictcopy.clone(obj)Copy some valuesIf you want to clone the dictionary, but only with some values, you can specify them.obj1=dictcopy.clone(obj,{"name","lastname","email"})Strict modeBy default, when you specify fields that do not exist in the source dictionary, they will simply be skipped.But, you could change this behavior by changing thestrict_modeproperty to True. You will get aKeyErrorobj1=dictcopy.clone(obj,{"name","lastname","email","ocupation"},strict_mode=True)Extract valuesIf you want to remove some values, extract might help. will return a new dictionary with the fields removed from the source dictionaryobj1=dictcopy.extract(obj,{"age","email"})You can also apply strict mode to validate that each field exists in the source dictionary. You will get aKeyErrorobj1=dictcopy.extract(obj,{"age","email"},strict_mode=True)
Package: dict-curation
^dict curationA package for curating doc file collections. Prominent features:Scrape texts off various sites, such as Wikisource. See examplehere.
(PS: Consider contributing toraw_etexts
repo. )OCR some pdf with google drive. Automatically splits into 25 page
bits and ocrs them individually. See usage examplehere,
functionhere.For usersAutogenerated Docs on readthedocs (might be
broken).Manually and periodically generated docshereFor detailed examples and help, please see individual module files in
this package.Installation or upgrade:sudo pip install dict_curation-Usudo pip installgit+https://github.com/sanskrit-coders/dict_curation/@master-UWeb.For contributorsContactHave a problem or question? Please head togithub.Packaging~/.pypirc should have your pypi login credentials.python setup.py bdist_wheel
twine upload dist/* --skip-existingBuild documentationsphinx html docs can be generated withcd docs; make htmlTestingRunpytestin the root directory.Auxiliary toolspyup
Package: dictdaora
dictdaoraDicts that can be accessed via attributesDocumentation:Source Code:Key FeaturesPrint hello world on screen ** feature in development.RequirementsPython 3.8+Instalation$ pip install dictdaoraBasic exampleprint('Hello World!')Hello World!Complex exampleimportjsonprint(json.dumps(dict(hello='Hello',world='World!'))){"hello": "Hello", "world": "World!"}
Package: dictdiffer
AboutDictdiffer is a helper module that helps you to diff and patch
dictionaries.InstallationDictdiffer is on PyPI so all you need is:pip install dictdifferDocumentationDocumentation is readable athttps://dictdiffer.readthedocs.ioor can be
built using Sphinx:pip install dictdiffer[docs]
python setup.py build_sphinxTestingRunning the test suite is as simple as:./run-tests.sh
Package: dict_digger
Digs into DictsUseful syntax for digging into nested dictionaries, lists and tuples, and removes the need to check if a key or index exists, or handling of
KeyError or IndexErrorInstallation$pipinstalldict_diggerUsageimportdict_diggerh={'a':{'b':'tuna','c':'fish'},'b':{}}result=dict_digger.dig(h,'a','b')printresult# prints 'tuna'result=dict_digger.dig(h,'c','a')printresult# prints None# Important!!  Does not through an error, just returns None#but if you likeresult=dict_digger.dig(h,'c','a',fail=True)# raises a KeyError# also support complex objects so ...complex={'a':{['tuna','fish']},'b':{}}result=dict_digger.dig(complex,'a',0)printresult#prints tunaAlternativestry:result=h['c']['a']exceptKeyError:result=NoneTestingWe are using nose$nosetests
Package: dictDigUtils
dict dig utilsSome functionality would be quite comfortable to manipulate dicts,
and that we do not have to write them all the time.
Perhaps they already exist, but for any case, here is a simple
version of them for myself.flatteningFirst thing is to turn keys into a flattened string, likekey1key2key3turns to key1/key2/key3
Then texts can be easily searched in keys and values withuot
transversing the whole structuredisplaya simple printing function that indents with the levels of the
dict may be intuitive to see what is in a dict.search for a keywithin the whole tree, and return whatever element is found under it
in a list, allowing for multiple keys.
It searches text in the key, thus using the in operator.list keysrun through recursively, and give a list of keys from within.
This is useful for complex, deep dict trees, when one has no idea
where to find a specific key, or how it is spelled.redisplay depthafter coming back from a deeper dict, display the current depth againlistsuse lists as lists with a serial index along enumerate of the list in
dict_disp()
Package: dict-dot-notate
dict_dot_notatedict_dot_notate turns nested dictionary keys to dotted strings with their corresponding values into a basic dictionary.Installationpip install dict-dot-notateUsagefrom dot_notate.dot import dict_dot_notateExampledata = {
"obj": "obj",
"nested_once": {"first": "first"},
"nested_twice": {
    "twice": {"inner_nest": {"second": "second"}}
},
"nested_thrice": {
    "thrice": {"second_nest": {"tripple_nest": {"tripple": "thrice"}, "three": "three"}}
}
}call the relevant method to convert our dictresult = dict_dot_notate(data)output{
    'obj': 'obj',
    'nested_once.first': 'first',
    'nested_twice.twice.inner_nest.second': 'second',
    'nested_thrice.thrice.second_nest.tripple_nest.tripple': 'thrice', 
    'nested_thrice.thrice.second_nest.three': 'three'
    }If a dict passed in has a list value, Then the output will be as belowExampledata = {
"obj": "obj",
"nested_once": {"first": "first"},
"nested_twice": {
    "twice": {"inner_nest": [1, 2, 3, 4, 5]}
}
}conversionresult = dict_dot_notate(data)output{
'obj': 'obj',
'nested_once.first': 'first',
'nested_twice.twice.inner_nest': [1, 2, 3, 4, 5]
}Don't pass in a list of dictionaries.
Package: dictencli
dictencliA command line dictionary, for those who spend their day in terminal. Get definitons, origin, example and many more information inside your terminal. You are just one command away😊 ...Featureswith functionalities like:word definitionexampleoriginsynonymsantonymsphrasespronunciationInstallationpip install dictencliUsagedictencli [commands] [optional flags] word(required with look command)Commands:look - used with optional flags below provided.dictencli look wordhelp - will just show you the help options dicussed abovedictencli helpaboutdictencli aboutOptional flags:orgin: use either '-origin' or '-or'example: use either '-example' or '-ex'synonyms: use either 'synonyms' or '-syn'antonyms: use either '-antonyms' or '-ant'pronunciation: use either '-pronunciation' or '-pro'phrases: use either '-phrases' or '-phr'NoteWindowsIf pronunciation doesn't work:pip uninstall playsoundpip install playsound == 1.2.2unicode symbols might not be displayed correctly in cmd.LinuxIf pronunciation doesn't work:sudo apt install libgirepository1.0-devpip install pygobjectNamespace Gst not available:sudo apt install python3-gst-1.0These are the known issues that I had encountered in 'pronunciation', if you face any other issue or wan't to get in contact, feel free to mail at 'nikhilomkar99@gmail.com'. Thanks🙌🏻.
Package: dict-envy
# dict-envydict-like grouping of environment variables :sparkles:---Imagine you have this:```COUNTRIES_GB_NAME="United Kingdom"COUNTRIES_GB_TLD=.ukCOUNTRIES_HK_NAME=ChinaCOUNTRIES_HK_TLD=.cn```and with a simple call you can have all of this:```python>>> import os>>> import dictenvy>>> import pprint>>> env = dictenvy.dictate(os.environ, depth=2)>>> pprint.pprint(env){'countries': {'gb': {'name': 'United Kingdom', 'tld': '.uk'},'hk': {'name': 'China', 'tld': '.cn'}}}````depth` is how you regulate the depth of the returned dictionary.<details><summary>Couple gotchas</summary>### #1Sometimes you may encounter the following situation:```TERM_PROGRAM=Apple_TerminalTERM=xterm-256color```In which case, the return value would still be a dict, but `TERM` value would have an empty key like so:```python>>> import dictenvy>>> import pprint>>> env = dictenvy.dictate({'TERM': 'xterm-256color', 'TERM_PROGRAM': 'Apple_Terminal'}, depth=1))>>> pprint.pprint(env){'term': {'': 'xterm-256color', 'program': 'Apple_Terminal'}}```### #2Variables that start with an underscore will be left alone.</details>## InstallationUse pip:```shell$ pip install dict-envy```## LicenseMIT
Package: dicteval
Library to evaluate expressions in dict/json objects.RequirementsPython 3.6+Basic UsageModuledictevalwill evaluate basic types with no modifications but it will
evaluate dicts (or json objects) containing keys started with=(equal)
symbol as an expression:>>> from dicteval import dicteval
>>> dicteval(3)
3
>>> dicteval([3, 5])
[3, 5]
>>> dicteval((5, 3))
[5, 3]
>>> dicteval({"=sum": [3, 5]})
8
>>> dicteval({"=": 5})  # = symbol alone is a 'nop' function
5You can provide a dictionary with context to be used during evaluation process.>>> dicteval({"=": "!{var}"}, context={"var": 1.0})
1.0You can also wrap your string content with@{}to force a Pythoneval()with the context provided:>>> dicteval({"=sum": [3, "@{var + 2}"]}, context={"var": 3})
8WarningThis functionality will be removed (or changed) in future releases for
security reasons.FunctionsYou can use the following builtin functions in your expressions:Function=anyReturnsTrueif any element of sequence is true.>>> dicteval({"=any": [1, 2, 3]})
True
>>> dicteval({"=any": [0, 0]})
FalseFunction=eqReturnsTrueif all elements of sequence are equals:>>> dicteval({"=eq": [1, 1, 1, 1]})
TrueFunction=ifEvaluates condition and returns first value if true, otherwise, returns second value.
If no false value is supplied, it is assumed to beNone.>>> dicteval({"=if": [{"=": "@{var > 5}"}, "yes", "no"]}, context={"var": 6})
'yes'
>>> dicteval({"=if": [{"=": "@{var > 5}"}, "yes", "no"]}, context={"var": 4})
'no'
>>> dicteval({"=if": [{"=": "@{var > 5}"}, "yes"]}, context={"var": 4})Function=neqReturnsTrueif elements of sequence are different:>>> dicteval({"=neq": [1, 1, 1, 5]})
TrueFunction=(ornop)Returns the same values passed as arguments:>>> dicteval({"=": [1, 2, 3, 4]})
[1, 2, 3, 4]
>>> dicteval({"=nop": "spam"})
'spam'Function=notReturns the boolean inverse of argument:>>> dicteval({"=not": False})
True
>>> dicteval({"=not": True})
False
>>> dicteval({"=not": None})
True
>>> dicteval({"=not": "XYZ"})
FalseFunction=sumReturns a number with the sum of arguments:>>> dicteval({"=sum": [3, 5]})
8Function=mulReturns a number with the product of arguments:>>> dicteval({"=mul": [3, 5]})
15Function=allReturn True if all elements of the iterable are true (or if the iterable is empty)>>> dicteval({"=all": (True, False)})
False
>>> dicteval({"=all": (True, True)})
TrueFunction=divmodReturns a tuple containing the quotient and remainder after division:>>> dicteval({"=divmod": [8,3]})
(2, 2)
>>> dicteval({"=divmod": [7.5,2.5]})
(3.0, 0.0)Function=zipReturn list of aggregate tuples constructed from elements of multiple iterables.>>> dicteval({"=zip": [[1, 2, 3], [4, 5], [6, 7, 8, 9]]})
[(1, 4, 6), (2, 5, 7)]To DoAdd more functions to the builtin languageContributeTo contribute todicteval:Clone this repository andcdinto itInstall dev dependencies with [pipenv](https://github.com/pypa/pipenv)`bash pipenv install--dev`Create a branch, likegit checkout -b [feature_name]Git commit changesPull requestLicenseThis software is licensed under MIT license.
Package: dict-extend-fuzzy
Dict extension - get_fuzzyGet element by fuzzy key from dict.IntroductionThe library is extension for buildin typedict. After import you can useget_fuzzyandget_fuzzy_statslikegetmethod.The minimum required python-3.4InstallingThis library can be install from pip:pipinstalldict-extend-fuzzyUsageSimple examplefromdictextendfuzzyimportget_fuzzydata={'aaaa':1,'bbbb':2}data.get_fuzzy('aaab')# 1Get some more informationfromdictextendfuzzyimportget_fuzzy_statsdata={'aaaa':1,'bbbb':2}obj=data.get_fuzzy_stats('aaab')obj.key# 'aaaa'obj.value# 1obj.ratio# 0.75With optional parametersdata.get_fuzzy('kei','default_object',level=0.5)data.get_fuzzy_stats('kay',{},level=0.25)
Package: dictf
dictfAn extended Python dict implementation that supports multiple key selection with a pretty syntax.How to use itFirst you install the package with pippipinstalldictfThen you can use it like this:fromdictfimportdictfexample_dictf=dictf(name="Led Zepellin",singer="Robert Plant",guitarist="Jimmy Page")print(example_dictf["name"])>>>'Led Zepellin'print(example_dictf[["name"]])>>>{'name':'Led Zepellin'}# The pandas inspired syntax makes it easy to understand how the lib worksprint(example_dictf[["name","singer"]])>>>{'name':'Led Zepellin','singer':'Robert Plant'}# The return type is a dictf whenever you use a list, tuple or set as keyprint(type(example_dictf[["name","singer"]]))>>>dictf# If one key doesn't exist, a KeyError is raisedprint(example_dictf[["name","singer","drummer"]])>>>KeyErrorCurrently you can not make multiple assignments at the same time, and I'm not sure we need to add this functionality. I'm open to suggestions, though!ContributingContributions are welcome and appreciated. Make sure to read ourguide for contributingand don't forget to check out ourcode of conduct.Also, please do check out our other libs as well such ashttps://github.com/Eric-Mendes/unexpected-isaves.
Package: dict-fancy-printer
dict-fancy-printerA simple library used to print python dictionaries in a fancier and understandable wayInstallTo install from pip:pip install dict-fancy-printerTo install from master branch just do:pip install git+https://github.com/matteogabburo/dict-fancy-printerIf you want to install a specific development branch, usepip install git+https://github.com/matteogabburo/dict-fancy-printer@<branch_name>UsageFancyPrinterExamplefrom goburba.utils import FancyPrinter
printer = FancyPrinter()
print(printer(d))print_fancy_dictExamplefrom goburba.utils import print_fancy_dict
d = {"Hi": 1, "I":2, 3: "an", 4 : {"Matteo": 1, 2: "Gabburo"}}
print_fancy_dict(d)fancy_dictExamplefrom goburba.utils import fancy_dict
d = {"Hi": 1, "I":2, 3: "an", 4 : {"Matteo": 1, 2: "Gabburo"}}
d = fancy_dict(d)
print(d)