Skip to main content

Local storage: CCStorage, and simple local file string read/write: CCIO

Project description

Install

pip3 install ccstorage --upgrade --user

CCIO: Simple local file read/write

content_str = CCIO.read_string(__absolute_path__)
CCIO.save_string(content_str, __absolute_path__)

CCStorage: Local key-value storage

Concat __root_dir_path__ with __relative_file_path__ to storage key value.
When inited, storage will automatically read.
Then change keys and values, call write() to save to file.

storage = CCStorage(__root_dir_path__, __relative_file_path__)  
storage['pending_work'] = True
storage['work_id'] = '123456'
storage.write()

storage = CCStorage(__root_dir_path__, __relative_file_path__)  
print(storage['pending_work'], storage['work_id'])

To enable read/write at each value get/set, set force_reload_at_data_access to True:

storage.force_reload_at_data_access = True

Project details


Download files

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

Source Distribution

ccstorage-2.0.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

ccstorage-2.0-py3-none-any.whl (2.9 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