Broker Client

nepse.BrokerClient

class nepse.broker.core.BrokerClient(client_wrapper: nepse.utils._ClientWrapperHTTPX, use_cache: bool, cache_retain_time: int)

Bases: object

async get_broker(use_cache: Optional[bool] = None, **attrs) nepse.broker.types.BrokerResponse

Get the broker by its attributes

Parameters

use_cache (Optional[bool]) – To use or not to use cache while getting broker data. Defaults to nepse.Client.use_cache

Returns

The response about the broker

Return type

BrokerResponse

Examples

Getting Broker by member_code:

imperial = client.broker_client.get_broker(member_code=45)

Getting Broker by name:

imperial = client.broker_client.get_broker(member_name="Imperial Securities Company Pvt. Ltd.")
async get_brokers(use_cache: Optional[bool] = None) List[nepse.broker.types.BrokerResponse]

Returns the list of every broker

Parameters

use_cache (Optional[bool]) – To use or not to use cache while getting broker data. Defaults to nepse.Client.use_cache

Returns

List of all the brokers in Nepal.

Return type

List[BrokerResponse]

nepse.BrokerClient.types

class nepse.broker.types.MembershipTypeMaster(id: int, membership_type: str, hibernate_lazy_initializer: dict)

Bases: object

id: int
membership_type: str
hibernate_lazy_initializer: dict
class nepse.broker.types.Province(id: int, name: str, description: str, status: str)

Bases: object

id: int
name: str
description: str
status: str
class nepse.broker.types.District(id: int, district_name: str, status: str, province_id: int)

Bases: object

id: int
district_name: str
status: str
province_id: int
class nepse.broker.types.Municipality(id: int, municipality_name: str, status: str, district_id: int)

Bases: object

id: int
municipality_name: str
status: str
district_id: int
class nepse.broker.types.MemberTmsLinkMapping(tms_link: str)

Bases: object

class nepse.broker.types.MemberBranchMapping(id: int, branch_name: str, branch_location: str, branch_head: Any, active_status: str, phone_number: int, municipality: nepse.broker.types.Municipality, district: nepse.broker.types.District, province: nepse.broker.types.Province)

Bases: object

id: int
branch_name: str
branch_location: str
branch_head: Any
active_status: str
phone_number: int
municipality: nepse.broker.types.Municipality
district: nepse.broker.types.District
province: nepse.broker.types.Province
class nepse.broker.types.BrokerResponse(id: int, active_status: str, clearing_member_id: int, member_code: int, member_name: str, membership_type_master: nepse.broker.types.MembershipTypeMaster, authorized_contact_person: int, authorized_contact_person_number: int, province_list: List[nepse.broker.types.Province], district_list: List[nepse.broker.types.District], municipalities: List[nepse.broker.types.Municipality], member_tms_link_mapping: nepse.broker.types.MemberTmsLinkMapping, is_dealer: str, member_branch_mappings: List[nepse.broker.types.MemberBranchMapping])

Bases: object

id: int
active_status: str
clearing_member_id: int
member_code: int
member_name: str
membership_type_master: nepse.broker.types.MembershipTypeMaster
authorized_contact_person: int
authorized_contact_person_number: int
province_list: List[nepse.broker.types.Province]
district_list: List[nepse.broker.types.District]
municipalities: List[nepse.broker.types.Municipality]
is_dealer: str
member_branch_mappings: List[nepse.broker.types.MemberBranchMapping]