Core library for JGT utilities - configuration, settings, and utility functions.
This is a pure Python library extracted from jgtutils to provide clean programmatic access to JGT configuration and settings without CLI dependencies.
pip install jgtcoreimport jgtcore
# Load configuration
config = jgtcore.get_config()
demo_config = jgtcore.get_config(demo=True)
# Get specific config values
user_id = jgtcore.get_config_value('user_id')
quotes_count = jgtcore.get_config_value('quotes_count', 1000)import jgtcore
# Get all settings
settings = jgtcore.get_settings()
# Get specific setting with default
instrument = jgtcore.get_setting('instrument', 'EUR/USD')
timeframes = jgtcore.get_setting('_timeframes', 'D1')import jgtcore
# One-call environment setup
config, settings = jgtcore.setup_environment(demo=True)
# Check demo mode
if jgtcore.is_demo_mode():
print("Running in demo mode")from jgtcore import readconfig, load_settings
# Load with specific options
config = readconfig(demo=True, export_env=True)
settings = load_settings(custom_path="/path/to/settings.json")- config.json: Trading credentials and connection settings
- settings.json: Application settings and preferences
See examples/ directory for sample configuration files.
- Current directory:
config.json - User home:
~/.jgt/config.json - System:
/etc/jgt/config.json - Environment variables:
JGT_CONFIG,JGT_CONFIG_PATH
- System:
/etc/jgt/settings.json - User home:
~/.jgt/settings.json - Current directory:
.jgt/settings.json - YAML variants:
jgt.yml,_config.yml - Environment variables:
JGT_SETTINGS
MIT License