Skip to main content

Screenshot Zerodha portfolio pages, compile to PDF, and email it

Project description

Zerodha Portfolio Summary Mailer

Logs into Zerodha, screenshots your portfolio pages, compiles them into a PDF, and emails it to you.

Setup

1. Install

pip install .
playwright install chromium

2. Configure

cp config.ini.template config.ini

Edit config.ini with your email addresses and Gmail App Password. See the template for all options.

config.ini is gitignored — never commit it.

3. Run

zerodha-summary

The browser opens for you to log in. Once you press Enter, it takes screenshots, compiles the PDF, and asks for confirmation before sending the email.


Gmail App Password

Gmail requires an App Password (not your regular password):

  1. Go to Google Account → Security2-Step VerificationApp passwords
  2. Create one (e.g. "Zerodha Mailer") and paste it into config.ini under password

If password is omitted from config.ini, the program will prompt for it securely at runtime.


Advanced

CLI overrides

Any config.ini setting can be passed as a CLI argument:

zerodha-summary --receiver-email other@example.com --subject "March Summary" --output-pdf march.pdf
zerodha-summary --config my_other_config.ini

Pages

  • Add one URL per line under pages = in config.ini
  • The Tradebook page (/reports/tradebook) is handled specially — the program automatically iterates all segments (Equity, F&O, Currency, etc.) over the last 3 months and captures every pagination page
  • All other pages are screenshotted as-is

Troubleshooting

Problem Fix
Missing dependency error Run pip install . and playwright install chromium
Gmail login fails Use an App Password, not your regular Gmail password
PDF not opening Install a PDF viewer (sudo apt install evince on Ubuntu)

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

zerodha_summary-0.2.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

zerodha_summary-0.2.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zerodha_summary-0.2.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for zerodha_summary-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f511c727171b311894114d218d92945425cdee35716cd5dc9a8430fd2103d043
MD5 0f0badf56af1a52173b9371b3f36b5e5
BLAKE2b-256 0ad37e65240feb3a56e8d21315e255ff699ecf0eb74d09ec67c9092560a597f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zerodha_summary-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0ec095971ca37ab2d563bf4d844023c7797549ca6f3aba3e15619252e405310
MD5 8d557594dd964d0f1ec21b73bb4dd9da
BLAKE2b-256 f7c682c5096de91d242512e623904e917a663a1f1527d07a05cbdaa2b58f6deb

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