Export the simulated portfolio to Excel or CSV - #19
Merged
Merged
Conversation
GET /portfolio/export and an «Export Excel» / «CSV» button on the Portfolio page. The workbook holds everything at the time of the export: a summary (capital, value, realised and unrealised profits at the bid and at the mid, counts, hit rate, CLV, preset parameters), every bet with its purchase, sale or resolution, result, current value and plan, entry forecast and economic assessment, the equity curve, the exclusions and a sheet describing every column. Stable column keys, fractions 0-1, USD, UTC times; descriptions in the dashboard language (?lang= for download links). Adds openpyxl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it adds
An «Export Excel» and a «CSV» button on the Portfolio page, backed by
GET /portfolio/export?format=xlsx|csv. Viewers can use them too, since the export changes nothing. The file holds the whole portfolio as it is at the time of the export, so the system's performance can be analysed in Excel, Google Sheets or LibreOffice.Excel workbook (
backend/betting/export.py, 5 sheets):Format choices
?lang=; the middleware now also accepts it besidesX-Lang.$formatting, times are real Excel dates in UTC.Other changes
openpyxl(pure Python) torequirements.txt.portfolio.open_bet_plan, so the bet list and the export share it.Tests
tests/test_portfolio.py:GET /portfolio, the sold and the open bet with all their fields, entry forecast, equity, exclusions and the column descriptions;🤖 Generated with Claude Code
https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
Generated by Claude Code