Scan your whole stack
From OX Research Newsroom
Are you using eetc-utils?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v2.1.1
eetc-utils was last scanned on 23 Nov 2026 at version 2.1.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 2.1.1 LATEST | 23 Nov 2026 | No rules fired |
| 2.1.0 | 23 Nov 2026 | No rules fired |
| 2.0.3 | 20 Nov 2026 | No rules fired |
| 2.0.2 | 30 Oct 2026 | Not shown |
| 2.0.1 | 26 Oct 2026 | Not shown |
Findings for v2.1.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 2.1.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A Python library providing reusable utilities for financial analysis and algorithmic trading. Built by East Empire Trading Company for quantitative finance and trading strategy development.
extra fields and single-line tracebackstraceparent / X-Cloud-Trace-Context parsingpip install eetc-utils
from eetc_utils.finance import (
calculate_optimal_leverage_kelly,
intrinsic_value_using_dcf,
garch_annualized_volatility,
convert_daily_ohlc_data_to_weekly
)
import pandas as pd
# Calculate optimal leverage using Kelly Criterion
price_df = pd.DataFrame({
'date': pd.date_range('2020-01-01', periods=200),
'close': [100 + i * 0.5 for i in range(200)]
})
leverage = calculate_optimal_leverage_kelly(
df=price_df,
position_type="LONG",
regime_start_date="2020-01-01",
fractional_kelly_multiplier=0.5,
use_garch=False
)
# DCF valuation
intrinsic_value = intrinsic_value_using_dcf(
cash_flow=1000000000,
growth_years=10,
shares=100000000,
growth_rate=1.15,
beta=1.2
)
# Forecast volatility using GARCH
volatility = garch_annualized_volatility(price_df)
# Convert daily OHLC to weekly
weekly_df = convert_daily_ohlc_data_to_weekly(price_df)
from eetc_utils.options import (
calculate_option_price_black_scholes,
find_strikes_in_range,
GEX,
calculate_underlying_iv_from_option_iv
)
# Calculate Black-Scholes option price
call_price = calculate_option_price_black_scholes(
right="C",
und_price=100.0,
strike=105.0,
rate=0.05,
tte=0.5,
implied_vol=0.25,
pv_dividend=0.0
)
# Find strike prices within a range
strikes = find_strikes_in_range(
range_length_perc=0.1,
price=100.0
)
# Calculate Gamma Exposure
gex = GEX(oi=1000, gamma=0.05)
# Convert option IV to underlying IV
underlying_iv = calculate_underlying_iv_from_option_iv(
option_implied_vol=0.20,
t=30/365
)
from eetc_utils.clients.eetc_data import EETCDataClient
import os
# Initialize client (requires EETC_API_KEY environment variable)
client = EETCDataClient(api_key=os.getenv("EETC_API_KEY"))
# Fetch price data (one symbol or a list, batched into few requests)
price_data = client.get_price_data(["AAPL", "MSFT"], from_date="2024-01-01")
# Get fundamentals
fundamentals = client.get_fundamentals(symbol="AAPL")
# Fetch macroeconomic indicators
macro_data = client.get_macro_indicators(indicator="GDP", country="US")
from eetc_utils.clients.eetc_notifications import EETCNotificationsClient
import os
# Initialize client (requires EETC_API_KEY environment variable)
client = EETCNotificationsClient(api_key=os.getenv("EETC_API_KEY"))
# Send a Telegram HTML message (escape literal <, > and &)
client.send_message_to_telegram(msg="<b>Shorted</b> TSLA x100 at 1312.69.")
# Post plain text on X (max 280 characters)
client.send_post_on_x(msg="Shorted TSLA x100 at 1312.69.")
# Send an HTML email (all recipients see each other)
client.send_email(
subject="Weekly report",
body_html="<h1>Report</h1>",
recipients=["someone@example.com"],
)
from eetc_utils.clients.claude import ClaudeClient
import os
# Initialize client (requires ANTHROPIC_API_KEY environment variable)
client = ClaudeClient(api_key=os.getenv("ANTHROPIC_API_KEY"))
# Send a single-turn prompt
response = client.send_message("What is the capital of France?")
# Send a multi-turn prompt with a system prompt and prior history
response = client.send_message(
"What's my name?",
system="You are a helpful assistant.",
messages=[
{"role": "user", "content": "My name is Alice."},
{"role": "assistant", "content": "Nice to meet you, Alice."},
],
)
from eetc_utils.strategy.backtesting.strategy import Strategy
from eetc_utils.strategy.backtesting.engine import BacktestEngine
import pandas as pd
class MyStrategy(Strategy):
def on_start(self, context):
self.position = 0
def on_data(self, bar, context):
# Simple moving average crossover
if len(self.data) < 20:
return
sma_short = self.data['close'].tail(5).mean()
sma_long = self.data['close'].tail(20).mean()
if sma_short > sma_long and self.position == 0:
context['place_order']('buy', quantity=100)
self.position = 100
elif sma_short < sma_long and self.position > 0:
context['place_order']('sell', quantity=100)
self.position = 0
def on_stop(self, context):
pass
# Load historical data
data = pd.read_csv("AAPL_historical.csv")
# Run backtest
engine = BacktestEngine(
strategy=MyStrategy(),
data=data,
symbol="AAPL",
initial_capital=100000,
commission=0.001
)
results = engine.run()
print(f"Total Return: {results['total_return']:.2%}")
print(f"Sharpe Ratio: {results['sharpe_ratio']:.2f}")
print(f"Max Drawdown: {results['max_drawdown']:.2%}")
import logging
from eetc_utils.logging import configure_logging
# Reads LOG_FORMAT (json/text), LOG_LEVEL and GOOGLE_CLOUD_PROJECT
configure_logging()
logger = logging.getLogger(__name__)
# Constant message, variable data in extra fields
logger.info("Result written.", extra={"result.rows": 42, "duration_ms": 120})
See docs/logging.md for the full logging standard, including trace IDs.
src/eetc_utils/
├── finance.py # Quantitative finance utilities
├── options.py # Options pricing and Greeks
├── logging.py # Structured logging for Google Cloud Logging
├── clients/
│ ├── eetc_data.py # EETC Data Hub API client
│ ├── eetc_notifications.py # Notifications client
│ └── claude.py # Claude API client
└── strategy/
├── strategy.py # Live trading strategy base class
├── engine.py # Live trading execution engine
└── backtesting/
├── strategy.py # Backtesting strategy base class
├── engine.py # Backtesting engine
├── broker_sim.py # Broker simulator
└── metrics.py # Performance metrics
finance.py)calculate_optimal_leverage_kelly(): Calculate optimal leverage using Kelly Criterioncalculate_position_size_kelly(): Calculate position size based on Kelly Criterionintrinsic_value_using_dcf(): Discounted cash flow valuationgarch_annualized_volatility(): GARCH-based volatility forecastingconvert_daily_ohlc_data_to_weekly(): Convert daily OHLC data to weekly timeframesperformance_over_time(): Calculate percentage performance between datescompound_interest(): Calculate compound interestbeta_to_discount_rate(): Map beta to discount rate for DCFoptions.py)calculate_option_price_black_scholes(): Black-Scholes option pricing for calls and putsfind_strikes_in_range(): Find strike prices within a percentage rangeGEX(): Calculate Gamma Exposure for option contractscalculate_underlying_iv_from_option_iv(): Convert option IV to underlying IVPDF(): Standard normal probability density functionCND(): Cumulative normal distributionD1(), D2(): Black-Scholes d1 and d2 calculationslogging.py)configure_logging(): Install the JSON (or text) stdout handler on the root loggerJSONFormatter: Formatter writing Cloud Logging JSON lines, for custom logging setupsextract_trace_id(): Read the trace ID from traceparent / X-Cloud-Trace-Context headersget_price_data(): Fetch historical price dataget_fundamentals(): Get company fundamentalsget_macro_indicators(): Fetch macroeconomic indicatorsget_order_history(): Retrieve order historysend_message_to_telegram(): Send a Telegram HTML messagesend_post_on_x(): Post plain text on Xsend_email(): Send an HTML emailsend_message(): Send a single- or multi-turn text prompt to ClaudeStrategy (ABC) for implementing live strategiesStrategy class with on_start(), on_data(), on_stop() lifecycle# Install system dependencies
sudo apt-get install build-essential
# Install Python dependencies
make install_python_requirements
make reformat_code # Uses black for consistent code style
# Run all tests
python -m pytest tests/
# Run specific test file
python -m pytest tests/test_financials.py
# Run with coverage
python -m pytest tests/ --cov=src/eetc_utils
Create a .pypirc file in the project root with your PyPI API tokens:
[distutils]
index-servers =
pypi
testpypi
[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
password = pypi-YOUR_TEST_PYPI_TOKEN_HERE
[pypi]
repository = https://upload.pypi.org/legacy/
username = __token__
password = pypi-YOUR_PRODUCTION_PYPI_TOKEN_HERE
Note: The .pypirc file is already in .gitignore and will not be committed to version control.
To generate API tokens:
Update version in pyproject.toml:
version field in the [project] section[project.dependencies] (or
[dependency-groups] for dev tools) if neededBuild the package:
uv build
Test on PyPI Test:
make publish_package_on_pypi_test
Publish to production PyPI:
make publish_package_on_pypi
The Makefile commands automatically read credentials from .pypirc and pass them to uv publish via the UV_PUBLISH_TOKEN environment variable.
EETC_API_KEY: API key for EETC Data Hub client (required for data access)ANTHROPIC_API_KEY: API key for Claude client (required for Claude API access)LOG_FORMAT: json (default) or text for readable local output, read by configure_logging()LOG_LEVEL: debug, info (default), warning or error, read by configure_logging()GOOGLE_CLOUD_PROJECT: Project ID for the Cloud Logging trace field (optional)Contributions are welcome! Please ensure:
black)This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or feature requests, please open an issue on GitHub.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.