Skip to main content

Dvarpal

'Dvarpal' (Sanskrit: द्वारपाल) means 'door guard'. Davrpal aims to provide automated login mechanism for Indian stock brokers.

Supported Brokers

  1. Upstox

Dvarpal is designed so that support for more brokers can be added easily.

Installation

pip install dvarpal

Prerequisite

Dvarpal uses Selenium + Firefox ESR + Gecko Driver to perform automated logins. Firefox ESR and Gecko Driver have to be installed on operating system. For linux, this is automated in the script install-firefox-esr-geckodriver.sh

For Windows and Mac, it is left upto the user to perform similar installations.

Configuration

Dvarpal picks up configration file from ${HOME}/dvarpal.yaml file. A sample file for Upstox is shared below. For more samples, refer to config_samples directory.

authn_url: https://api.upstox.com/v2/login/authorization/dialog
authz_url: https://api.upstox.com/v2/login/authorization/token

# The following properties are part of upstox app created for API access
client_id: <your-client-id>
client_secret: <your-client-secret>
redirect_uri: <your-redirect-url>

# TOTP secret key generated using https://help.upstox.com/support/solutions/articles/260343-what-is-totp-and-how-to-enable-totp-for-my-account-
totp_secret_key: <your TOTP secret key>

mobile: <your registered mobile number>
pin: <your pin>

Usage

Starting version 2.0.0, Dvarpal will use Firefox ESR + Gecko Driver. Support for Google Chrome and Undetected Chromedriver have been deprecated. In version 2.0.1, support for Chrome will be removed.

from dvarpal.session_firefox import SessionManager

session_manager = SessionManager()
session_manager.generate_access_token()  # to generate a new access token
session_manager.is_session_valid()  # to check if access token is valid
session_manager.get_access_token()  # get the actual access token string

Upon generating an access_token, it is saved to text file ${HOME}/dvarpal_session. Before generating a new access token, dvarpal checks the file. If file exists, it loads the access token from file and uses it. If the token is expired or invalid, dvarpal generates a new one.

Metadata

Release files for dvarpal 2.0.1

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

Source distribution (sdist)

Source distribution for dvarpal 2.0.1
File Size Uploaded
dvarpal-2.0.1.tar.gz 6.4 kB Details

Built distribution (wheel)

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

Total release size: 13.7 kB

Release files / dvarpal-2.0.1.tar.gz

Download URL dvarpal-2.0.1.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d41120e64f6e25b15d1e8e29a8ca154ac464ae38696e1856872452e6cc2efb07
BLAKE2b-256 checksum
How to use checksums
88b2244e0236b6fa656d3dabd5424ac294291bb4940e15bd7833dde696c80c97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Release files / dvarpal-2.0.1-py3-none-any.whl

Download URL dvarpal-2.0.1-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42a084e54501b061b7ec371aa39659380915507f79456ecf694ce8b114d8d2ce
BLAKE2b-256 checksum
How to use checksums
57316788cc29fe0b2121396eeb6524b919a65bea3ec169dd2672b775c348c26b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

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