Skip to main content

Google cloud storage cache for any slow web API.

Project description

pip install cameo_cache import cameo_cache

#這是roy方便呼叫的方法 bool_exist=cameo_cache.exist(dic_key_value) #判斷是否快取存在 dic_values=cameo_cache.read(dic_key_value) #讀出快取並轉為python dic cameo_cache.write(dic_key_value, dic_content) #根據一串keys寫入python dic

cameo_cache.set_bucket("gs://cameo_cache_taiwan_public") cameo_cache.set_bucket("gs://cameo_cache_taiwan_private") cameo_cache.set_bucket("gs://cameo_cache_korea")

#這是 panda caro 方便呼叫的網址 https://iotai-dev.cameo.tw/api/v2/iot/events?start_time=2020-04-01 00:00:00&end_time=2020-04-29 23:59:59&min_lat=22.43422&max_lat=22.89&min_lon=120.1393&max_lon=120.4398

import cameo_cache cameo_cache.set_bucket("gs://cameo_cache_taiwan_public") cameo_cache.cache_url("https://iotai-dev.cameo.tw/api/v2/iot/events?start_time=2020-04-01 00:00:00&end_time=2020-04-29 23:59:59&min_lat=22.43422&max_lat=22.89&min_lon=120.1393&max_lon=120.4398") #這樣就可以直接把問號後面的東西儲存在設定好的 bucket, 問號前面的東西不會儲存,這樣可以確保 cameo_cache.write, 當中指定的 dic_key_value 兩邊都是一致的

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cameo_cache-0.2-py3-none-any.whl (2.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page