No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Matt Cupp f39d7df328 Full codebase review: fix real bugs in trade math, error handling, and char.py
Found and fixed while auditing every module:

- trade.py: margin scanner accepted 1-2 unit orders as real opportunities,
  producing impossible-looking margins (2000%+) from noise rather than
  genuine spreads. Now requires minimum order depth (3 units) on both
  sides before counting a margin at all.
- trade.py: haul finder multiplied a single best-order price across
  thousands of units without checking whether that order actually had
  that many available - overstated profit whenever the real quantity
  exceeded the origin order's size. Now caps units at the origin order's
  own volume_remain too.
- market.py: added best_orders() (returns full order dicts, not just
  price) so callers can inspect depth - best_prices() now built on it.
- cli.py: every command could crash with a raw Python traceback on any
  network hiccup or ESI error (confirmed missing across all 8 commands).
  Added a shared _friendly_errors() wrapper used everywhere.
- sso.py: port-8635-in-use during `eve auth login` crashed instead of
  giving a clear message; token file now chmod 600 on POSIX.
- char.py: `eve char summary` said "skill queue is empty" for a queue
  that actually has entries but isn't training (e.g. no active Omega) -
  confirmed live against Cupp221's real paused queue. Also added a
  caveat that blueprint valuations reflect BPC pricing, not BPO.
- pi.py: hoisted mode validation out of the per-product loop.
- README: fee-assumption description was stale after the earlier
  Accounting/Broker Relations fix.

Added tests/test_ids.py (previously zero coverage on the module every
command routes through for name resolution) and regression tests for
the thin-order-book and best_orders behavior. 39 tests passing (was 26).
2026-08-19 23:16:33 -04:00
docs Fix fee constants to use real formulas and Cupp221's actual skill levels 2026-08-19 22:58:06 -04:00
src/eve_helper Full codebase review: fix real bugs in trade math, error handling, and char.py 2026-08-19 23:16:33 -04:00
tests Full codebase review: fix real bugs in trade math, error handling, and char.py 2026-08-19 23:16:33 -04:00
.gitignore Initial eve-helper CLI: market prices, PI planning, trade finder, char dashboard 2026-08-19 16:30:07 -04:00
pyproject.toml Initial eve-helper CLI: market prices, PI planning, trade finder, char dashboard 2026-08-19 16:30:07 -04:00
README.md Full codebase review: fix real bugs in trade math, error handling, and char.py 2026-08-19 23:16:33 -04:00

eve-helper

A CLI toolkit for EVE Online built on the public ESI API. Market prices, Planetary Interaction profit planning, trade-opportunity scanning, and a character dashboard for Cupp221.

Setup

python -m venv .venv
.venv\Scripts\pip install -e ".[dev]"   # or .venv/bin/pip on Linux/Mac

The eve command lives inside .venv\Scripts\, which isn't on your PATH by default. Either activate the venv once per terminal session (.venv\Scripts\Activate.ps1 on PowerShell, source .venv/bin/activate on Linux/Mac) and then just run eve ..., or call it directly as .venv\Scripts\eve.exe ... without activating.

Local data (response cache, SSO tokens) lives in ~/.eve-helper/ and is never committed — see .gitignore. Override the location with the EVE_HELPER_HOME environment variable.

Commands

Market prices

eve price Gila
eve price "PLEX" --region amarr

Best sell/buy, 5%-depth volume-weighted price, and 7/30-day history at a trade hub (jita, amarr, dodixie, rens, hek). Note: PLEX has no station order book — it trades through a separate NPC vault, so only the history figures populate for it.

Planetary Interaction

eve pi chain Livestock          # full production chain + current Jita pricing
eve pi rank --tier P2 --mode factory   # rank P2 products by profit/day if you buy inputs and sell output
eve pi rank --tier P1 --mode extract   # rough P1 extraction income estimate

See docs/pi-guide.md for a general quickstart, or docs/pi-plan-cupp221.md for a plan built from Cupp221's actual trained skills and a live survey of the systems around Hentogaira.

Trade finder

eve trade margins --min-margin 0.10 --min-volume 100
eve trade haul --from jita --to amarr --budget 500000000 --cargo 60000

Both scan a sample of Jita's most-traded items (page 1 of /markets/{region}/types/, ~1000 items) - not exhaustive, but a decent first pass. Each run takes ~1 minute due to the number of ESI calls.

Character dashboard

Requires logging in once via EVE SSO:

  1. Register a native application at developers.eveonline.com/applications:
    • Callback URL: http://localhost:8635/callback
    • Scopes: esi-skills.read_skills.v1, esi-skills.read_skillqueue.v1, esi-assets.read_assets.v1, esi-wallet.read_character_wallet.v1, esi-planets.manage_planets.v1
  2. Set the client ID: export EVE_HELPER_CLIENT_ID=<your client id> (or $env:EVE_HELPER_CLIENT_ID in PowerShell)
  3. eve auth login - opens a browser, stores the token in ~/.eve-helper/token.json

Then:

eve char summary        # wallet, total SP, skill queue
eve char assets [--sellable]
eve char pi              # colony overview

Testing

.venv/Scripts/pytest -q

Notes

  • All prices are sourced live from ESI's public market endpoints - no data is bundled or hardcoded except the PI schematic recipe table (src/eve_helper/data/pi_schematics.json), which is fixed game data cross-checked against EVE University's wiki and a community SDE-derived dataset.
  • Fee assumptions (sales tax, broker fee) use the real CCP formulas plugged in with Cupp221's actual trained Accounting/Broker Relations levels - see src/eve_helper/constants.py. There's no CLI flag to override these yet; if you're using this for a different character, edit the skill levels in that file directly.