@@ -16,11 +16,11 @@ class Api:
1616
1717 def __init__ (
1818 self ,
19- email : str | None = None ,
20- password : str | None = None ,
21- base_url : str | None = None ,
22- publication_url : str | None = None ,
23- debug : bool = False ,
19+ email = None ,
20+ password = None ,
21+ base_url = None ,
22+ publication_url = None ,
23+ debug = False ,
2424 ):
2525 """
2626
@@ -47,7 +47,7 @@ def __init__(
4747 if email is not None and password is not None :
4848 self .login (email , password )
4949
50- def login (self , email : str , password : str ) -> dict :
50+ def login (self , email , password ) -> dict :
5151 """
5252
5353 Login to the substack account.
@@ -104,7 +104,7 @@ def get_posts(self) -> dict:
104104
105105 return Api ._handle_response (response = response )
106106
107- def get_drafts (self , filter : str = None , offset : int = None , limit : int = None ):
107+ def get_drafts (self , filter = None , offset = None , limit = None ):
108108 response = self ._session .get (
109109 f"{ self .publication_url } /drafts" ,
110110 params = {"filter" : filter , "offset" : offset , "limit" : limit },
@@ -131,11 +131,11 @@ def post_draft(self, body) -> dict:
131131
132132 def put_draft (
133133 self ,
134- draft : str ,
135- title : str = None ,
136- subtitle : str = None ,
137- body : str = None ,
138- cover_image : str = None ,
134+ draft ,
135+ title = None ,
136+ subtitle = None ,
137+ body = None ,
138+ cover_image = None ,
139139 ) -> dict :
140140 """
141141
@@ -161,7 +161,7 @@ def put_draft(
161161 )
162162 return Api ._handle_response (response = response )
163163
164- def prepublish_draft (self , draft : str ) -> dict :
164+ def prepublish_draft (self , draft ) -> dict :
165165 """
166166
167167 Args:
@@ -177,7 +177,7 @@ def prepublish_draft(self, draft: str) -> dict:
177177 return Api ._handle_response (response = response )
178178
179179 def publish_draft (
180- self , draft : str , send : bool = True , share_automatically : bool = False
180+ self , draft , send : bool = True , share_automatically : bool = False
181181 ) -> dict :
182182 """
183183
@@ -215,13 +215,13 @@ def get_categories(self):
215215 response = self ._session .get (f"{ self .base_url } /categories" )
216216 return Api ._handle_response (response = response )
217217
218- def get_category (self , category_id : int , category_type : str , page : int ):
218+ def get_category (self , category_id , category_type , page ):
219219 response = self ._session .get (f"{ self .base_url } /category/public/{ category_id } /{ category_type } " ,
220220 params = {"page" : page })
221221 return Api ._handle_response (response = response )
222222
223- def get_single_category (self , category_id : int , category_type : str , page : int | None = None ,
224- limit : int | None = None ):
223+ def get_single_category (self , category_id , category_type , page = None ,
224+ limit = None ):
225225 """
226226
227227 Args:
0 commit comments