Skip to main content

config tool

A tool help you to create config and load in an easy way

Usage

Define and Writing Config to toml

In Python Code

from typing import NamedTuple
import gxconfig

class DataConfig(NamedTuple):
    root:str = "/home/gawainx/data"
    chkp:str = "chkp"

class ModelConfig(NamedTuple):
    embd_dim:int = 768
    hidden_dim:int = 5

class Config(NamedTuple):
    dataConfig:DataConfig = DataConfig()
    modelConfig:ModelConfig = ModelConfig()

cfg = Config()
gxconfig.save_toml(cfg, "config.toml")

Then you can get a toml

[DataConfig]
root = "/home/gawainx/data"
chkp = "chkp"

[ModelConfig]
embd_dim = 768
hidden_dim = 5

Load from Toml

import gxconfig
from typing import NamedTuple
class DataConfig(NamedTuple):
    root:str = "/home/gawainx/data"
    chkp:str = "chkp"

class ModelConfig(NamedTuple):
    embd_dim:int = 768
    hidden_dim:int = 5

class Config(NamedTuple):
    dataConfig:DataConfig = DataConfig()
    modelConfig:ModelConfig = ModelConfig()

cfg = gxconfig.load_toml("config.toml", Config)

Metadata

Release files for gxconfig 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for gxconfig 0.0.2
File Interpreter ABI Platform
gxconfig-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / gxconfig-0.0.2-py3-none-any.whl

Download URL gxconfig-0.0.2-py3-none-any.whl
Size 2.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23595893839e257cad7e81f2c46d21d793036f924d0d60f8c9e274dccc6eb7f3
BLAKE2b-256 checksum
How to use checksums
be31082fe1238ca979a052e8c0d8891a0b8daa53249f296f0a8ca66978d23eb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Security for gxconfig 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page