2 years ago
#18834
roXx
How can i store result in cache?
I want to store the result in cache also for a time limit like 24hrs. How can i do it. I tried lru_cache but didn't got right code to do it
import json
import IndicatorTypes
from OTXv2 import OTXv2
from OTXv2 import INDICATOR_DETAILS
otx = OTXv2("xxxxx65f25729f6ccb41020174c9aeff3bfe43xxxx2eb3b756ae532xxxxxx")
indicator = '45.148.10.241'
indicator_details = otx.get_indicator_details_full(IndicatorTypes.IPv4, indicator)
obj = indicator_details["url_list"]
obj1 = indicator_details["reputation"]
obj2 = indicator_details["general"]
with open('incoming_data.json', 'w') as data_file:
json.dump(obj, data_file, indent=4)
json.dump(obj1, data_file, indent=4)
json.dump(obj2, data_file, indent=4)
python
python-3.x
dictionary
caching
lru
0 Answers
Your Answer