Skip to main content

Shared toolkit for VCG@XMU

Project description

VCG

Install

pip install git+http://git.hypercube.top/ipic/vcg.git

or through pypi

pip install vcg

Functions

list_dir

from vcg import list_dir,get_postfix

for name,file in list_dir(".", condition=get_postfix(".mp4"),key=lambda x:x[0]):
    print(name,file)

notify

from vcg import notify
with notify("admin@hypercube.top", debug=True):
    raise NotImplementedError

set debug=True to disable notify temporary.

make_join

import vcg

folder=vcg.make_join("data","what")
print(folder)

# so you created a folder named "data/what"

mkdir

import vcg
vcg.mkdir("data","ping") # create two folders "data" and "ping"

partition

Returns a new list with elements of which is a list of certain size.

partition([1, 2, 3, 4], 3) # you get [[1, 2, 3], [4]]

flatten

from vcg import flatten
flatten([[1, 2, 3], [4]]) #[1,2,3,4]

save_json

save_json(file, obj)

load_json

obj=load_json(file)

Classes

HostSpecific

from vcg import HostSpecific
spec = HostSpecific("data/spec.json")
print(spec.what)
print(spec["what"])

Config

from vcg import Config
config = Config(key="cfg")
config.add_post_arg("name", lambda args: args.cfg)
config.add_argument(
    "--no_flip", action="store_true", help="specified if no flipping"
)
print(config.parse_args())
# Namespace(cfg='data/test.yaml', name='data/test.yaml', no_flip=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 Distributions

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

Built Distribution

vcg-1.3.0-py3-none-any.whl (7.5 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