Core library for JGT utilities - configuration, settings, and utility functions
Project description
jgtcore
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.
Installation
pip install jgtcore
Usage
Simple Configuration Access
import 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)
Settings Management
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')
Environment Setup
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")
Advanced Usage
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")
Configuration Files
- config.json: Trading credentials and connection settings
- settings.json: Application settings and preferences
See examples/ directory for sample configuration files.
File Locations
config.json lookup order:
- Current directory:
config.json - User home:
~/.jgt/config.json - System:
/etc/jgt/config.json - Environment variables:
JGT_CONFIG,JGT_CONFIG_PATH
settings.json lookup order:
- 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
License
MIT License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jgtcore-0.1.4.tar.gz.
File metadata
- Download URL: jgtcore-0.1.4.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6c2e0cc61b3d4731ea088a66dce28617bf841f116148eac324a385565342a0b
|
|
| MD5 |
f08fa92d9b8ac50fd4e7a4c161dac28e
|
|
| BLAKE2b-256 |
5390a4dcd1c2e7ef4166ddc65703674a5d4d8f957a08466f7b1a19c7fff6ce70
|
File details
Details for the file jgtcore-0.1.4-py3-none-any.whl.
File metadata
- Download URL: jgtcore-0.1.4-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccad5573e080f16e86924d56e9d70bf41cca65bbf089ca16c791558464962337
|
|
| MD5 |
8bd4fe33e5c8d936e8a92bed70b1b033
|
|
| BLAKE2b-256 |
1b03c082b3e7a697ba7f8cdea676c01548adf0f1dddc17687a57d613b4b8fdb4
|