Logs into Zerodha, screenshots your portfolio pages, compiles them into a PDF, and emails it to you.
1. Install
pip install zerodha-summary
playwright install chromium2. Configure
curl -o config.ini https://raw.githubusercontent.com/ramnar/zerodha-summary/main/config.ini.templateEdit config.ini with your email addresses and Gmail App Password. See the template for all options.
config.iniis gitignored — never commit it.
3. Run
zerodha-summaryThe 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 requires an App Password (not your regular password):
- Go to Google Account → Security → 2-Step Verification → App passwords
- Create one (e.g. "Zerodha Mailer") and paste it into
config.iniunderpassword
If password is omitted from config.ini, the program will prompt for it securely at runtime.
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- Add one URL per line under
pages =inconfig.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
1. Install build tools
pip install build twine2. Build the distribution
python3 -m buildThis creates dist/zerodha_summary-<version>-py3-none-any.whl and dist/zerodha_summary-<version>.tar.gz.
3. Upload to PyPI
twine upload dist/*You will be prompted for your PyPI username and password (or use an API token as the password with __token__ as the username).
To upload to TestPyPI first:
twine upload --repository testpypi dist/*4. Bump the version
Update the version field in pyproject.toml before each release, then rebuild.
| 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) |