Saravanan666/pypi-org huggingface dataset:
Package: dict-hash
Simple python tool to hash dictionaries using both default hash and sha256.
The library comes with full support for hashing Pandas DataFrame objects,
Numba objects and Numpy arrays, but you will need to specify the requirements
when installing the package to avoid bloating the installation process.Furthermore, the library supports objects that can be recursively hashed.As we saw this library being used in the wild mostly to create caching libraries and wrappers,
we’d like to point you to our library,Cache decorator.How do I install this package?As usual, just download it using pip:pipinstalldict_hashUsage examplesThe package offers two functions:sha256to generate constant sha256 hashes anddict_hash, to generate hashes using the nativehashfunction.Session hash with dict_hashObtain a session hash from the given dictionary.fromdict_hashimportdict_hashfromrandom_dictimportrandom_dictfromrandomimportrandintd=random_dict(randint(1,10),randint(1,10))my_hash=dict_hash(d)Consistent hash with sha256Obtain a consistent hash from the given dictionary.fromdict_hashimportsha256fromrandom_dictimportrandom_dictfromrandomimportrandintd=random_dict(randint(1,10),randint(1,10))my_hash=sha256(d)Approximated hashAll of the methods shown offer theuse_approximationparameter,
which allows you to switch to a more lightweight hashing procedure
where supported, for the various supported objects. This procedure
will randomly subsample the provided objects.Currently, we support this parameter for NumPy and Pandas objects.fromdict_hashimportsha256fromrandom_dictimportrandom_dictfromrandomimportrandint# Even though the DataFrame is very big...df=load_a_very_big_dataframe(...)# an approximated hash is still very fast!my_hash=sha256(df,use_approximation=True)HashableWhen handling complex objects within the dictionaries, you may need to implement
the class Hashable in that object.Here is an example:fromdict_hashimportHashable,sha256classMyHashable(Hashable):def__init__(self,a:int):self._a=aself._time=time()defconsistent_hash(self)->str:returnsha256({"a":self._a})
Package: dicti
dictiis a dictionary with case-insensitive keys.It works like the normaldictexcept that key matching
is case-insensitive.Instantiate like you would instantiate a normal dict;
for example, these work.dict(foo = ‘bar’, answer = 42)
dicti(foo = ‘bar’, answer = 42)dict({‘foo’: ‘bar’, ‘answer’: 42})
dicti({‘foo’: ‘bar’, ‘answer’: 42})Methods that accept keys and have side-effects record
the original case, just as a normal dictionary does.di = dicti()
di[‘cAsE’] = 1
di.keys() == [‘cAsE’]
di[‘Case’] = 1
di.keys() == [‘Case’]
di[‘caSE’] == 1Methods that accept keys do the same thing regardless
of what case you pass the key in.Keys are still stored in their original case, however;
the original keys are presented when you request them
with methods likedicti.keys.
Package: dictim
dictimcase insensitive dict for modern Python (Python 3)Usagepip install dictimExamplefrom dictim import dictim

favorites = dictim({"Hamm": "bass", "Skolnick": "guitar", "Björk": "vocal", "MOTÖRHEAD": "band"})

# access values with case insensitivity, including unicode
print(favorites["hamm"])  # bass
print(favorites["skolnick"])  # guitar
print(favorites["björk"])  # vocal
print(favorites["Motörhead"])  # band
Package: dictionary-diff
dict-diffDict diff is a python module that lets you get and apply diffs of python dictionariesExamplesUsediff = diff(original_dict, another_dict)to get the diff between the dictionariesUseanother_dict = apply_diff(original_dict, diff)to get backanother_dictInstallationPyPIThis package is available onPyPI. Usepip install dictionary-diffto install itContributingOpen anissueor apull request
Package: dictionary-file-lib
Official repository (Dictionary file)Dicionary fileFew lines describing your project.Table of ContentsAboutContributingAuthorsAboutThis project aims to manipulate files (txt and yaml) to save requests in a REST API.
Ex.: save the requests that will be used in a POST in a .txt file, thus making the project more organized.Prerequisitesgenerate-libRobotframeworkInstallingTo install the library just use command line:pip install dictionary-fileIn addition to having python installed.
Obs.: You can create a python environment(recommended) or not.Running the testsTo run the functions just import the library in your robotframework project.*** Settings ***Librarydictionary_file*** Keywords ***Library testing${t}CREATE DICT BY FILE TXTfile_name=${EMPTY}full_path=C:\\Users\\Vericoders\\Documents\\test-lib\\dicionario.txtUPDATE DICTIONARY${t}name=YuriLog To Console\n${t}*** Test Cases ***Scenario 01[Tags]testeLibrary testingThe keyword (CREATE DICT FILE TXT) create a dictionary through txt file.defcreate_dict_by_file_txt(self,name_file:str,full_path:str=None)->dict:iffull_pathisNone:arq=open(os.path.dirname(__file__)+f"/{name_file}",'r')eliffull_pathisnotNoneandname_file=="":arq=open(f"{full_path}",'r')lines=arq.readlines()dict_=dict()forlineinlines:iflineisnotNoneand"="inline:list_kys_values=''.join(line.replace(' ','')).split(',')foriteminlist_kys_values:key=item.split('=')[0]value=item.split('=')[1]if"@"invalue:value=generate_email_random(1)ifself.LINE_BREAKinvalue:value=value.replace(self.LINE_BREAK,'')ifvalue.startswith(self.STR):value=value.replace(self.STR,'').replace(')','')ifvalue.startswith(self.INT):value=int(value.replace(self.INT,'').replace(')',''))dict_.update({key:value})else:breakreturndict_The file .txt needs to contains some features. Example:name=str(kaio), email=str(kaio.santiago@hotmail.com), password=int(1234), admin=str(true)Values of dict needs to be defined type as in the example above.string: str()int: int(number_int)bool: bool(true_or_false)UsageUse to take information through txt file to create dictionary. This is useful to create requisition(dictionary) to test automation API REST.Built UsingPython- Programming languageRobot- Automation FrameworkAuthors@Kaio1394- Idea & Initial work
Package: dictionary-generator
dictionary_generatorГенератор дневника самоподготовки по физкультуре.УстановкаДля установки используйте пакетный менеджерpip.pipinstall-ihttps://test.pypi.org/simple/dictionary-generatorИспользование(venv)$python-mdictionary_generator
ФИО:
>>>ИвановИванИванович
Датарождения:
>>>21.08.200
Группа:
>>>Э9-45Б
Вес:
>>>50Рост:
>>>150датаначалазанятий,формат:%d.%m.%Y:
>>>04.06.2020
датаконцазанятий,формат:%d.%m.%Y:
>>>04.07.2020
развсколькоднейбылизанятия?
>>>3названиедокумента:
>>>bmstu_dict
Документуспешносохраненв/.../bmstu_dict.docx
Package: dictionaryio
DictionaryIODictionaryIO is an English Dictionary wrapper with voice-pronunciation.InstallationUse the package managerpipto install dictionaryio.pipinstalldictionaryioUsagefromdictionaryioimportDictionaryIOword=DictionaryIO('happy')# replace `happy` with any word of your choiceword.wordie# returns a string of the word. eg: 'happy'#GET MEANING:word.meaning()# returns the meaning of the word#GET VOICE PRONUNCIATION:word.pronounce()# plays pronounciation of the word - requires exit with CTRL + C#GET EXAMPLE:word.example()# returns a string making an example of the word#OTHERS:word.synonyms()# returns a list of synonyms for the wordword.figure_of_speech()# returns the figure of speech for the wordword.phonetics()# returns the phonetics of the wordContributingPull 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: dictionary-model
To use, first create CharPredictor object:>>> predictor = CharPredictor()This may take a while as model is being downloaded and loaded.Then, to track utterance context, you can add letter index to context:>>> letter_index = 1    # 1 -> a,   letters should be indexed in order: ' abcdefghijklmnopqrstuvwxyz' (0 -> space)
>>> predictor.add_to_context(letter_index)or you can add letter as string of length 1 (make sure it is one of AsciiEncoder.AVAILABLE_CHARS):>>> letter = 'a'
>>> predictor.add_to_context(letter)or you can add probability distribution for all AsciiEncoder.AVAILABLE_CHARS letters:>>> import numpy as np
>>> import AsciiEncoder as AE
>>>
>>> num_chars = len(AE.AVAILABLE_CHARS)
>>> letter_distr = np.random.random((1, num_chars)) # random proba distribution
>>> predictor.add_to_context(letter_distr)And finally - you can predict probabilities of each letter coming next after text stored in context. (Letters are indexed in order shown below):>>> predictor.transform()Letters order:' abcdefghijklmnopqrstuvwxyz' # space character comes at index 0, then alphabetical order for indices from 1 to 26
Package: dictionary-navigator
Python Dictionary NavigatorQuick StartTo install, use pip:pip install -U dictionay_navigatorUsage>>> from dictionary_navigator import navigator
>>> myDict = {
        'person': {
            'name': {
                'first': 'Michael',
                'las': 'Scott'
            },
            'height': 175.3,
            'friendsNames': ['Jim', 'Ryan', 'Todd', 'Stanley', 'Darryl'],
            'enemies': ['Toby']
        }
    }

>>> navigator.navigate(myDict, 'person.name.first')
'Michael'

>>> navigator.navigate(myDict, 'person.friendsNames')
['Jim', 'Ryan', 'Todd', 'Stanley', 'Darryl']

>>> navigator.navigate(myDict, 'person.friendsNames[2]')
'Todd'

>>> navigator.navigate(myDict, 'person.friendsNames[10]')

>>> navigator.navigate(myDict, 'person.friendsNames[10]', default='Dwight')
'Dwight'

>>> navigator.navigate(myDict, 'person.friendsNames[10]', safeNavigation=False)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "testProject/.pyenv/local/lib/python2.7/site-packages/dictionary_navigator/navigator.py", line 35, in navigate
    currentObject = currentObject[index]
IndexError: list index out of range
Package: dictionary-profanity-filter
Dictionary Profanity FilterPython module for profanity filtering using dictionaries.
It supports English and Russian languages out-of-the-box.RequirementsPython 3.5 or higherHow to installUse the following command to install the package using pip:pipinstalldictionary-profanity-filterHow to useHere are several examples of the module usage:Creating ProfanityFilter instance:fromdictionary_profanity_filterimportProfanityFilterprofanity_filter=ProfanityFilter()Adding custom words to censor:profanity_filter.add_words(['censorship','blocking'])profanity_filter.censor('I hate censorship and blocking!')# Output: 'I hate ********** and ********!'Detect bad words in the text:profanity_filter.is_clean('Porn is a restricted word')# Output: FalseRemoving word from custom dictionary:profanity_filter.remove_word('blocking')profanity_filter.censor('I hate censorship and blocking!')# Output: 'I hate ********** and blocking!'TODOWrite documentationWrite tests
Package: dictionary-search
Dictionary Search toolsIn a nutshellDictionary Searchis a small library to search in a dictionaries recursively.
Also have some other dictionary tools to make your life easier.Install>pipinstalldictionary-searchSearch# File: example.pyfromdictionary_searchimportsearch_first,search_alld={"a":{"b":{"c":"C value 1"}},"e":"f","h":[{"i":"j"},{"c":"C value 2"}]}print("Search First: ",search_first(d,"c"))print("Search All: ",search_all(d,"c"))print()print("Search First (path as tuple): ",search_first(d,"c",path_as_string=False))print("Search All (path as tuple): ",search_all(d,"c",path_as_string=False))After running the code, you will see:>pythonexamples/example.py
SearchFirst:('a.b.c','C value 1')SearchAll:[('a.b.c','C value 1'),('h.c','C value 2')]SearchFirst(pathastuple):(('a','b','c'),'C value 1')SearchAll(pathastuple):[(('a','b','c'),'C value 1'),(('h','c'),'C value 2')]Flat and NestAllow you to flat and rebuild a dict. Nest only work with str and index keys.data={"a":{"b":1,"c":2}}flat_data=flat(data)# will produce: [("a.b", 1), ("a.c", 2)]assertdata==nest(flat_data)TODO: describe listIf you want more information, please take a look to our testAuthorsCesar Gallegocr0hnLicenseDictionary Search is Open Source and available under theMIT.ContributionsContributions are very welcome. SeeCONTRIBUTING.mdor skim existing tickets to see where you could help out.
Package: dictionarysnek
dictionarysnekTable of contentsGeneral infoDependenciesSetupUsageGeneral infoA Dictionary API Wrapper for Python.DependenciesProject is created with:Requests Version: 2.26.0Dictionary API: dictionaryapi.devSetupPython-pip:$ pip install dictionarysnekPoetry:$poetry add dictionarysnekUsageImport the module:from dictionarysnek import dictionarysnekGet the data:data = dictionarysnek.getdata("mundane")Pass it to the desired function to get the output:synonyms = dictionarysnek.getsyn(data)FunctionsGet Synonyms -> Returns an array of Synonyms ->dictionarysnek.getsyn(json: list)Get Antonyms -> Returns an array of Antonyms ->dictionarysnek.getant(json: list)Get Definition -> Returns the definition of the given word ->dictionarysnek.getdefi(json: list)Get Word -> Returns the given word ->dictionarysnek.getword(json: list)Get Phonetic -> Returns the phonetic of the given word ->dictionarysnek.getphonetic(json: list)Get Part of Speech -> Returns the Part of Speech of the given word ->dictionarysnek.getpos(json: list)Get Example -> Gives an usage of the given word ->dictionarysnek.getex(json: list)Get Origin -> Gives information about the origin of the given word ->dictionarysnek.getorigin(json: list)
Package: dictionaryutils
dictionaryutilspython wrapper and metaschema for datadictionary.
It can be used to:load a local dictionary to a python object.dump schemas to a file that can be uploaded to s3 as an artifact.load schema file from an url to a python object that can be used by servicesTest for dictionary validity with DockerSay you have a dictionary you are building locally and you want to see if it will pass the tests.You can add a simple alias to your.bash_profileto enable a quick test command:testdict() { docker run --rm -v $(pwd):/dictionary quay.io/cdis/dictionaryutils:master; }Then from the directory containing thegdcdictionarydirectory runtestdict.Generate simulated data with DockerIf you wish to generate fake simulated data you can also do that with dictionaryutils and the data-simulator.simdata() { docker run --rm -v $(pwd):/dictionary -v $(pwd)/simdata:/simdata quay.io/cdis/dictionaryutils:master /bin/sh -c "cd /dictionary && python setup.py install --force; python /src/datasimulator/bin/data-simulator simulate --path /simdata/ $*; export SUCCESS=$?; rm -rf build dictionaryutils dist gdcdictionary.egg-info; chmod -R a+rwX /simdata; exit $SUCCESS"; }
simdataurl() { docker run --rm -v $(pwd):/dictionary -v $(pwd)/simdata:/simdata quay.io/cdis/dictionaryutils:master /bin/sh -c "python /src/datasimulator/bin/data-simulator simulate --path /simdata/ $*; chmod -R a+rwX /simdata"; }Then from the directory containing thegdcdictionarydirectory runsimdataand a folder will be created calledsimdatawith the results of the simulator run. You can also pass in additional arguments to the data-simulator script such assimdata --max_samples 10.The--max_samplesargument will define a default number of nodes to simulate, but you can override it using the--node_num_instances_fileargument. For example, if you create the followinginstances.json:{
        "case": 100,
        "demographic": 100
}Then run the following:docker run --rm -v $(pwd):/dictionary -v $(pwd)/simdata:/simdata quay.io/cdis/dictionaryutils:master /bin/sh -c "cd /dictionary && python setup.py install --force; python /src/datasimulator/bin/data-simulator simulate --path /simdata/ --program workshop --project project1 --max_samples 10 --node_num_instances_file instances.json; export SUCCESS=$?; rm -rf build dictionaryutils dist gdcdictionary.egg-info; chmod -R a+rwX /simdata; exit $SUCCESS";Then you'll get 100 each ofcaseanddemographicnodes and 10 each of everything else. Note that the above example also definesprogramandprojectnames.You can also run the simulator for an arbitrary json url by usingsimdataurl --url https://datacommons.example.com/schema.json.Use dictionaryutils to load a dictionaryfrom dictionaryutils import DataDictionary

dict_fetch_from_remote = DataDictionary(url=URL_FOR_THE_JSON)

dict_loaded_locally = DataDictionary(root_dir=PATH_TO_SCHEMA_DIR)Use dictionaryutils to dump a dictionaryimport json
from dictionaryutils import dump_schemas_from_dir

with open('dump.json', 'w') as f:
    json.dump(dump_schemas_from_dir('../datadictionary/gdcdictionary/schemas/'), f)
Package: dictiopy
DictioA very simple python command line English dictionary toolInstall$pip install dictiopyUsageType one word as input argument.$dictio hello

hello  /həˈləʊ/
Noun
1. "Hello!" or an equivalent greeting.
Verb
2. To greet with "hello".
Interjection
3. A greeting (salutation) said when meeting someone or acknowledging someone’s arrival or presence.
4. A greeting used when answering the telephone.
5. A call for response if it is not clear if anyone is present or listening, or if a telephone conversation may have been disconnected.
6. Used sarcastically to imply that the person addressed or referred to has done something the speaker or writer considers to be foolish.
7. An expression of puzzlement or discovery.DependenciesFreeDcitionaryApi
Package: dictipy
DictipyDictipy creates the right dict also for nested objects using recursion, whenever the standard
Python__dict__()cannot.Table of contentsMotivationUsage1. MotivationUsing get_dict makes you able to recursively get dict of nested objectswithoutexplicitly
overriding__repr__()function, making it usable for other purposes.
It could be useful when you have very complex nested object and you want not to override each sub-object__repr__()function. Imagine for example an operation which produces a complex object which has to be
serialized and sent through a REST protocol as a json.
Thejson.dumps()cannot execute the task if the argument object is not a dict. Again, using simply the
standard Python__dict__()function does not solve the problem if a nested object has to be considered.2. UsageSimply importget_dictfunction fromdictipyand use it on any potentially serializable object.Example 1: Nested objects.fromdictipyimportdictipyclassParent:def__init__(self,parent_field):self.parent_field=parent_fieldself.child=Child(1)classChild:def__init__(self,child_field):self.child_field=child_fieldif__name__=="__main__":p=Parent(0)print("Standard Python dict:  ",p.__dict__)print("Python vars:  ",vars(p))print("Dictipy get_dict:      ",dictipy(p))Result:StandardPythondict:{'parent_field':0,'child':<__main__.Childobjectat0x0000021C530BFEB8>}Pythonvars:{'parent_field':0,'child':<__main__.Childobjectat0x0000021C530BFEB8>}Dictipyget_dict:{'parent_field':0,'child':{'child_field':1}}Example 2: Json serialization.fromdictipyimportdictipyimportjsonclassParent:def__init__(self,parent_field):self.parent_field=parent_fieldself.child=Child(1)classChild:def__init__(self,child_field):self.child_field=child_fieldif__name__=="__main__":p=Parent(0)j1=json.dumps(p)# throws -> TypeError: Object of type Parent is not JSON serializablej2=json.dumps(p.__dict__)# throws -> TypeError: Object of type Child is not JSON serializablej3=json.dumps(vars(p))# throws -> TypeError: Object of type Child is not JSON serializablej4=json.dumps(dictipy(p))# returns -> '{"parent_field": 0, "child": {"child_field": 1}}'
Package: dictkit
DictKitA Python package that provides utility data structures with simple but powerful
features, with a focus on flexibility and user experience.UtilDictA feature-enriched dictionary.Access items withdot notation.Flexible subscripting:Get multiple items at once.Set multiple items or the same value to multiple items at once.Add itemswithout mutating - return an updated copyDrop itemswithout mutating - return a filtered copyAccepts avariety of argument typesat creation.Displays innested formatwhen printed.Easyconversion to jsonformat with.json()ExamplesfromdictkitimportUtilDict# Like a dictionary...ud=UtilDict(a=1,b=2,c=3)print(ud)# {'a': 1, 'b': 2, 'c': 3}# ... but can be initialized from a variety of typesud=UtilDict({"a":1},[("b",2)],c=3)print(ud)# {'a': 1, 'b': 2, 'c': 3}# Supports dot notation accessprint(ud['a'])# 1print(ud.a)# 1# Get multiple items at onceselected_items=ud[["a","c"]]print(selected_items)# {'a': 1, 'c': 3}# Set multiple items at onceud[["a","c"]]=10,30print(ud)# {'a': 10, 'b': 2, 'c': 30}# Set the same value to multiple keys at onceud[["a","c"]]=99print(ud)# {'a': 99, 'b': 2, 'c': 99}# Add items from a variety of typesud2=ud.add({"c":3},("d",4),e=5)print(ud2)# {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}# Add items from a 2-column dataframeimportpandasaspdud=UtilDict(a=1,b=2)df=pd.DataFrame({"key":["c","d"],"value":[3,4]})ud2=ud.add(df)print(ud2)# {'a': 1, 'b': 2, 'c': 3, 'd': 4}# Drop multiple items at once>>>ud3=ud2.drop("a","c")>>>print(ud3)# {'b': 2, 'd': 4}render()Somehow, this tool does not yet exist from any popular libraries.Represents iterables in nestedJSONstructure, but withPythonformatting.>>>fromdictkit.renderimportrender>>>dct={'a':1,'b':{'c':3},'list':[int,'b']}>>>s=render(dct)>>>s{'a':1,'b':{'c':3},'list':[<class'int'>,'b']}It handles multiline-formatted strings (like dataframes) elegantly, maintaining their original appearance.>>>frompandasimportDataFrame>>>df=DataFrame([[1,2,3],[4,55,6]],...columns=["ONE","TWO","THREE"])>>>fmt_str='''|------|... |      |... |------|'''>>>dct={..."key":"value",..."formatted string":fmt_str,..."nested dct":{..."x":"y",..."dataframe":df,..."a":"b",..."formatted string":fmt_str...},..."lst":['a','b'],..."tple":('a','b')...}>>>render(dct,quote=False){key:value,formattedstring:|------||||------|,nesteddct:{x:y,dataframe:ONETWOTHREE012314556,a:b,formattedstring:|------||||------|},lst:[a,b],tple:(a,b)}
Package: dictlearn
Dictionary Learning ToolboxOfficial documentationhere.This work was supported in part by theGraphomaly Research Grantand is based on theMatlab Dictionary Learning Toolboxthat accompanied the Springer book mentioned bellow.If you use our work in your research, please cite as:B. Dumitrescu and P. Irofti, Dictionary Learning Algorithms and Applications, Springer, 2018@book{DL_book,
author    = {Dumitrescu, B. and Irofti, P.},
title     = {Dictionary Learning Algorithms and Applications},
year      = {2018},
publisher = {Springer},
}
Package: dict-logic
dict-logicUsageBasicfromdictlogicimportLogiclogic=Logic()result=logic.run({'sequence':[{'print':'hello world!'},{'set':['a',10]},{'print':['the value of a is',{'get':'a'}]},{'select':[{'>':[{'get':'a'},5]},{'print':'this expression will be evaluated'},{'print':'this expression will be ignored'},]},{'set':['a',{'*':[{'get':'a'},2]}]},{'get':'a'},],})assert(result==20)With given local variablsfromdictlogicimportLogiclogic=Logic()result=logic.run({'sequence':[{'print':['the value of a is',{'get':'a'}]},{'set':['c',{'+':[{'get':'a'},{'get':'b'}]}]},{'print':['the value of c is',{'get':'c'}]},],},{'a':5,'b':3,})With custom functionsfromdictlogicimportLogiclogic=Logic()@logic.add('sqrt')defsqrt(x):returnx()**0.5@logic.add('mean')defpower(*args):args=[arg()forarginargs]returnsum(args)/len(args)logic.run({'print':{'sqrt':2}})logic.run({'print':{'mean':[1,2,3,4,5,6,7]}})