Skip to main content

stocktopus

stocktopus is a cli utility that automatically fills in the portfolio section of the Zurich tax form for you. It can consume data from various brokers and turns a 2h+ task into minutes.

Installation

stocktopus can be simply installed via pip

python -m pip install stocktopus

Usage

We assume you already created a Flex Query report in Interactive Brokers following (this guide)[#interactive-brokers-preparation]. First we want to convert the report into a common format:

stocktopus ib --input=tax-report.xml --output=taxes.yml

next its time to actually start stocktopus and let it fill-in the form for you in lightning speed with its 8 arms.

stocktopus process --input=taxes.yml

now firefox browser will open and start to populate your tax form. In some situations it might halt and give you the option to intervene in the process, after you finished simple press enter on the console and stocktopus will pick up from there.

Interactive Brokers Preparation

In interactive brokers we leverage flex queries to generate a xml with all tax relevant information. this requires some initial setup:

  1. in the "Performance & Reports" section, select "Flex Queries", then create a new one by clicking on the "+" icon.

  2. we need both "Open Positions" and "Trades":

Alt text

  1. in "Open Positions" select at least "ISIN", "Quantity" and "Position Value". Feel free to add more. Alt text

  2. In "Trades" select at least "ISIN", "Date/Time", "Buy/Sell", "Quantity" and "TradePrice" Alt text

  3. You can now save the report type, all other options can be left in default state.

  4. next we can generate the report by clicking clicking on the "->" icon

  5. for period, select "Custom Date Range" and fill in the tax year you're interested in Alt text

  6. now the report is generated and you can start using stocktopus.

Metadata

Release files for stocktopus 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for stocktopus 0.1
File Interpreter ABI Platform Actions
stocktopus-0.1-py3-none-any.whl Python 3 none any Details for stocktopus-0.1-py3-none-any.whl

Release files / stocktopus-0.1-py3-none-any.whl

Download URL stocktopus-0.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5196652c246914593eee55359cfd3658584be20093152dedbdbed9428fc3e1c1
BLAKE2b-256 checksum
How to use checksums
bbd794cba1ad6c9a2cf237cb39d7adc25e199c00b7cb4d7bb1e293900c9124b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for stocktopus 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page