Skip to main content

Config Utils for Python

Project description

Config for Python

1. Introduction

Parse config from json file

2. Usage

2.1 Basic

  • config.json
{
  "a": 1,
  "b": 2
}
  • python file
from cuspy import ConfigUtils

config = ConfigUtils("config.json")
a = config.aaa_config.a
b = config.aaa_config.b

2.2 File/Directory Path

  • config.json
{
  "aaa_config": {
    "root": "/home/aaa",
    "data_dn": "data_dir",
    "data_fp": "data.tsv"
  }
}
  • python file
from cuspy import ConfigUtils

config = ConfigUtils("config.json")

data_dp = config.aaa_config.data_dp
# data_dp = "/home/aaa/data_dir"

data_fp = config.aaa_config.data_fp
# data_fp = "/home/aaa/data_dir/data.tsv"

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

cuspy-0.1.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file cuspy-0.1.1.tar.gz.

File metadata

  • Download URL: cuspy-0.1.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.1

File hashes

Hashes for cuspy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 87ad9dc057e350a1ffc1182538ac8a14bffefec5893f2f1440d043e3ad7aed4b
MD5 b9cf6e4a1024ea51b7c5f512ca8887bf
BLAKE2b-256 48cb16d530bbe3ee3b98de1f9bac02841fe802142c0ada0ad008c1ab5cb5006c

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