printDict({'key':'sjfhdkljhafsdlkjhdfaslkjhkljfadshklhfa', 'nestedKey':{'nestedKey2':'938023840843', 'nested3':{'nested4':'hello'}}})
inputDict = {"user":"nic","phone":"+66816684442","pw":"12345678","name":"nic"}
passingKeys = ['user','phone','pw']
failedKeys = ['us', 'phone']
print(allKeysInDict(inputDict, passingKeys))
print(allKeysInDict(inputDict, failedKeys))
from datetime import datetime
filterDt({'time': {'time2':datetime.now()}, 'hello': 'world'})
stripDict({'sdfd': 'dsf ', 'gdsgsa ':234})
%%time
hashDict({'hello':'world'})
saveDictToFile({'test':'test'},'/tmp/testdict')
loadDictFromFile('/tmp/testdict')
path = '/tmp/teststr'
saveStringToFile('hello', path)
loadStringFromFile(path)
dict_ = {'test':1}
r = genSchema(dict_, format_='yaml')
print(r)
printYaml({'test':{'test1':123}})
path = 'testData/test.yaml'
data = {'test':'test'}
with open(path, 'w') as f:
f.write(yaml.dump(data))
loadYaml(path)
path = 'testData/test.yaml'
data = {'test':'test'}
writeYaml(path,data)
loadYaml(path)
import cachetools.func
from beartype import beartype
import time
@beartype
@hash_dict
@cachetools.func.ttl_cache(ttl=10)
def testFunc(input_:dict)->dict:
time.sleep(2)
return input_
testFunc({'test':{'test':'test'}})
hash(ujson.dumps(({'test':{'test':'test'}}),sort_keys=True))