Skip to main content

Comprehensive core library for JGT applications - migrated from jgtutils with full compatibility

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:

  1. Current directory: config.json
  2. User home: ~/.jgt/config.json
  3. System: /etc/jgt/config.json
  4. Environment variables: JGT_CONFIG, JGT_CONFIG_PATH

settings.json lookup order:

  1. System: /etc/jgt/settings.json
  2. User home: ~/.jgt/settings.json
  3. Current directory: .jgt/settings.json
  4. YAML variants: jgt.yml, _config.yml
  5. 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

jgtcore-0.2.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jgtcore-0.2.0-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file jgtcore-0.2.0.tar.gz.

File metadata

  • Download URL: jgtcore-0.2.0.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for jgtcore-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ed5aeeec484b1ff997d485fca0763b13f2301a30c0b17db757e0e278202099bb
MD5 fe8dd39689f56494556d99c7e5987635
BLAKE2b-256 ba9fcaa6364616ef27a4a82b2e95cf9aaf7096efcd5fe63b5e6f3313ea67a1b7

See more details on using hashes here.

File details

Details for the file jgtcore-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: jgtcore-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 37.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for jgtcore-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05abeda993940b29c88d6705528146ade1b45285b0eaed053e8487d1a490ee4e
MD5 dbed3ebdfd1f5c3370acbf2623f979b0
BLAKE2b-256 71462d7f81fd36c39a67ec729ad7a4f435a5d82f47ad0fd67fd8e39dc1efa2ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page