Files
api_utils_converse_v2/trading/zerodha_kite/models/user_profile.py
T
khushalps 0bb9553150 Squashed 'utils_v2/' content from commit 398cbc6f
git-subtree-dir: utils_v2
git-subtree-split: 398cbc6f75cdfb8ce0cca27898c3854540a208eb
2025-01-08 18:56:17 +05:30

178 lines
5.9 KiB
Python

"""
AUTHOR:
Khushal P Soonderji
DATE:
Monday, 6th Jan., 2024.
OBJECTIVE:
To provide a data model for describing the profile of a user of Zerodha Kite.
REFERENCES:
N/A
DOWNLOADS:
N/A
"""
# *****************************************************************************************************************
# ***** ****
# *** IMPORT ***
# ***** ****
# *****************************************************************************************************************
# To make sibling directories accessible for imports:
import sys
sys.path.append(".")
sys.path.append("..")
# For making data behaviour_models:
from pydantic import BaseModel, Field, field_validator, model_validator, AwareDatetime
from typing import Optional, Literal, Union, Dict, List, Any
# Related to Google:
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
# My utils:
from utils_v2.string import json
from utils_v2.string import regex
from utils_v2.date_time import date_time
# To work with date and time:
import datetime
import dateparser
# To make API calls:
import httpx
# *****************************************************************************************************************
# ***** ****
# *** MACROS / ONE-TIME INIT ***
# ***** ****
# *****************************************************************************************************************
# --- Nothing Yet
# *****************************************************************************************************************
# ***** ****
# *** VARIABLES ***
# ***** ****
# *****************************************************************************************************************
# --- Nothing Yet
# *****************************************************************************************************************
# ***** ****
# *** FUNCTIONS ***
# ***** ****
# *****************************************************************************************************************
class ZerodhaKiteUserProfile(BaseModel):
userType: str | None = Field(
description = "the type of the user",
default = None,
alias = "user_type",
examples = ["individual/ind_with_nom"]
)
userId: str = Field(
description = "the id of the user as assigned by zerodha",
alias = "user_id",
examples = ["ABC123"]
)
email: str | None = Field(
description = "the email id of the user",
default = None,
alias = "email"
)
name: str = Field(
description = "the name of the user",
alias = "user_name"
)
displayName: str | None = Field(
description = "the short display name of the user",
default = None,
alias = "user_shortname"
)
displayPictureUrl: str | None = Field(
description = "the display picture of the user",
default = None,
alias = "avatar_url"
)
exchanges: List[str] = Field(
description = "the list of exchanges this user can trade on",
alias = "exchanges"
)
products: List[str] = Field(
description = "the list of products (offered by the broker) this user can avail",
alias = "products"
)
orderTypes: List[str] = Field(
description = "the list of order types this user can place",
alias = "order_types"
)
# ┏┓ ┏•
# ┃ ┏┓┏┓╋┓┏┓
# ┗┛┗┛┛┗┛┗┗┫
# ┛
class Config:
extra = "ignore"
populate_by_name = True
# ┓┏ ┓• ┓ •
# ┃┃┏┓┃┓┏┫┏┓╋┓┏┓┏┓
# ┗┛┗┻┗┗┗┻┗┻┗┗┗┛┛┗
pass
# ┏┓ •
# ┃┃┏┓┏┓┏┓┏┓┏┓╋┓┏┓┏
# ┣┛┛ ┗┛┣┛┗ ┛ ┗┗┗ ┛
# ┛
pass
# ┏┓ ┏┓
# ┃ ┓┏┏╋┏┓┏┳┓ ┣ ┓┏┏┓┏┏
# ┗┛┗┻┛┗┗┛┛┗┗ ┻ ┗┻┛┗┗┛
pass
# *****************************************************************************************************************
# ***** ****
# *** MAIN PROGRAM ***
# ***** ****
# *****************************************************************************************************************
if __name__ == "__main__":
pass