Skip to main content

No project description provided

Project description

XingYun (行雲)

XingYun is a package that helps store data , code and log to cloud and manage them. Tastes better if consumed together with EgorovSystem.

Installation

pip install xingyun

Before use, better to set up EgorovSystem and set values for the following entries: aws_access, xingyun-getid, xingyun-GlobalDataManager.

Example

Below is an example for usage. For more advanced usage see doc

project 1

# project_1.py
from xingyun import GlobalDataManager, Logger, make_hook_logger

logger = Logger()
G = GlobalDataManager("test/1" , [make_hook_logger(logger)])

# ----- save data -----
G.set("a", 114514, force_timestamp = 0)
G.set("a", 1919810)

# ----- load data -----
assert G.get("a") == 1919810
assert G.get("a", time_stamp = 0) = 114514

# ----- save log -----
G.log("哼哼哼啊啊啊啊啊") # stdout: 哼哼哼啊啊啊啊啊
assert G.get("_log").endswith("哼哼哼啊啊啊啊啊")

# ----- save code -----
G.log_code()
assert G.get("_code").get("project_1.py") == open("project_1.py", "r").read()

project 2

# project_2.py
from xingyun import GlobalDataManager, Logger, make_hook_logger

logger = Logger()

# share data between multiple runs by initializing with the same name.
G = GlobalDataManager("test/1")

# ----- load data from another run -----
assert G.get("a") == 1919810
assert G.get("a", time_stamp = 0) = 114514

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

xingyun-0.0.3.tar.gz (13.0 kB view details)

Uploaded Source

File details

Details for the file xingyun-0.0.3.tar.gz.

File metadata

  • Download URL: xingyun-0.0.3.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for xingyun-0.0.3.tar.gz
Algorithm Hash digest
SHA256 81eca04d8dd4e723013b78092a4253fa546cb6ac92b905ec65c669bed5193b20
MD5 4ee8389aea72d78b8ba1d5de999a3ac4
BLAKE2b-256 2f6b00692829307e513db8da3c52d9e2a11d07b335fd62c11dd3e9779828a17b

See more details on using hashes here.

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