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
Release files for jgtcore 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jgtcore-0.2.5.tar.gz | 33.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jgtcore-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.7 kB
Release files / jgtcore-0.2.5.tar.gz
| Download URL | jgtcore-0.2.5.tar.gz |
|---|---|
| Size | 33.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5c5b425fe957c7f2e789cf0792823825e9b536311cc980faaf6079d7ded2b0f
|
|
BLAKE2b-256 checksum How to use checksums |
06b1d4bd3bc21002b7ed674e525e36465d4caee6ac6ad99e797392b899be0836
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / jgtcore-0.2.5-py3-none-any.whl
| Download URL | jgtcore-0.2.5-py3-none-any.whl |
|---|---|
| Size | 37.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
220745750f10023ddb3205fa51f983b5eaf247ef6fd43266f068ca11601eed49
|
|
BLAKE2b-256 checksum How to use checksums |
6360e638ab67324bab1ec28ceb38c25f2d4a74f5950128c7170cfb205e109728
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|