Dvarpal
'Dvarpal' (Sanskrit: द्वारपाल) means 'door guard'. Davrpal aims to provide automated login mechanism for Indian stock brokers.
Supported Brokers
- 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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dvarpal-2.0.1.tar.gz | 6.4 kB | Without provenance | Details for dvarpal-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dvarpal-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for dvarpal-2.0.1-py3-none-any.whl |
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
|
Security for dvarpal 2.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.