Skip to content

Commit

Permalink
Add proxy docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwmillr committed Dec 22, 2024
1 parent 08895ab commit dac1e50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lyricsgenius/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class API(Sender):
retries (:obj:`int`, optional): Number of retries in case of timeouts and
errors with a >= 500 response code. By default, requests are only made once.
user_agent (:obj:`str`, optional): User agent for the request header.
proxy (:obj:`dict[str, str]`, optional): Proxy settings.
Attributes:
response_format (:obj:`str`, optional): API response format (dom, plain, html).
Expand All @@ -52,21 +53,21 @@ class API(Sender):

def __init__(self,
access_token,
proxy=None,
response_format='plain',
timeout=5,
sleep_time=0.2,
retries=0,
user_agent='',
proxy=None,
):
super().__init__(
access_token=access_token,
proxy=proxy,
response_format=response_format,
timeout=timeout,
sleep_time=sleep_time,
retries=retries,
user_agent=user_agent,
proxy=proxy,
)

def account(self, text_format=None):
Expand Down
2 changes: 1 addition & 1 deletion lyricsgenius/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ class Sender(object):
def __init__(
self,
access_token=None,
proxy=None,
response_format='plain',
timeout=5,
sleep_time=0.2,
retries=0,
public_api_constructor=False,
user_agent='',
proxy=None,
):
self._session = requests.Session()
user_agent_root = f'{platform.system()} {platform.release()}; Python {platform.python_version()}'
Expand Down
5 changes: 3 additions & 2 deletions lyricsgenius/genius.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Genius(API, PublicAPI):
retries (:obj:`int`, optional): Number of retries in case of timeouts and
errors with a >= 500 response code. By default, requests are only made once.
user_agent (:obj:`str`, optional): User agent for the request header.
proxy (:obj:`dict[str, str]`, optional): Proxy settings.
Attributes:
verbose (:obj:`bool`, optional): Turn printed messages on or off.
Expand Down Expand Up @@ -67,23 +68,23 @@ class Genius(API, PublicAPI):
'instrumental', 'setlist']

def __init__(self, access_token=None,
proxy=None,
response_format='plain', timeout=5, sleep_time=0.2,
verbose=True, remove_section_headers=False,
skip_non_songs=True, excluded_terms=None,
replace_default_terms=False,
retries=0,
user_agent='',
proxy=None,
):
# Genius Client Constructor
super().__init__(
access_token=access_token,
proxy=proxy,
response_format=response_format,
timeout=timeout,
sleep_time=sleep_time,
retries=retries,
user_agent=user_agent,
proxy=proxy,
)

self.verbose = verbose
Expand Down

0 comments on commit dac1e50

Please sign in to comment.