From bec1857b7afcd171a0102d4c70f721f1cc820dbe Mon Sep 17 00:00:00 2001 From: Pratik Anand <13189088+pratik141@users.noreply.github.com> Date: Tue, 31 Oct 2023 08:47:09 +0100 Subject: [PATCH] Fix pylint --- nsedt/equity.py | 9 ++++----- nsedt/utils/__init__.py | 23 ++++++++++------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/nsedt/equity.py b/nsedt/equity.py index a00d864..31d6d13 100644 --- a/nsedt/equity.py +++ b/nsedt/equity.py @@ -20,7 +20,7 @@ def get_companyinfo( symbol: str, response_type: str = "panda_df", ): - """_summary_ + """get_companyinfo Args:\n symbol (str): stock name\n @@ -296,9 +296,8 @@ def get_asm_list(asm_type="both") -> list: if asm_type == "both": return _data - elif asm_type == "longterm": + if asm_type == "longterm": return _data.get("longterm").get("data") - elif asm_type == "shortterm": + if asm_type == "shortterm": return _data.get("shortterm").get("data") - else: - return ["possible values are both,longterm,shortterm"] + return ["possible values are both,longterm,shortterm"] diff --git a/nsedt/utils/__init__.py b/nsedt/utils/__init__.py index 87cef5d..e9ffa24 100644 --- a/nsedt/utils/__init__.py +++ b/nsedt/utils/__init__.py @@ -3,22 +3,19 @@ """ import json -import deprecated - +import datetime +from warnings import warn import pandas as pd import requests from nsedt.resources import constants as cns -import datetime -from warnings import warn + def get_headers(): """ Args: - --- - - Returns: - + ---\n + Returns:\n Json: json containing nse header """ @@ -107,11 +104,11 @@ def get_symbol(symbol: str, get_key: str) -> str: def check_nd_convert(start_date: str, end_date: str) -> datetime: """ - The function `check_nd_convert` takes two date strings in the format "%d-%m-%Y" and converts them to - datetime objects if they are not already in that format. + The function `check_nd_convert` takes two date strings in the format "%d-%m-%Y" and + converts them to datetime objects if they are not already in that format. - :param start_date: The `start_date` parameter is the starting date of a period, specified as a - string in the format "%d-%m-%Y" + :param start_date: The `start_date` parameter is the starting date of a period, + specified as a string in the format "%d-%m-%Y" :type start_date: str :param end_date: The `end_date` parameter is a string representing the end date in the format "%d-%m-%Y" @@ -132,6 +129,6 @@ def check_nd_convert(start_date: str, end_date: str) -> datetime: end_date = datetime.datetime.strptime(end_date, "%d-%m-%Y") else: - raise ("Input is of an unknown type") + raise ValueError("Input is of an unknown type" ) return start_date, end_date