Skip to content

Commit c02ea26

Browse files
committed
python 3.7
1 parent 5d65771 commit c02ea26

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "python-substack"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
description = "A Python wrapper around the Substack API."
55
authors = ["Paolo Mazza <mazzapaolo2019@gmail.com>"]
66
license = "MIT"
@@ -16,7 +16,7 @@ homepage = "https://github.com/mazza8/python-substack"
1616
keywords = ["substack"]
1717

1818
[tool.poetry.dependencies]
19-
python = "^3.8"
19+
python = "^3.7"
2020

2121
requests = "^2.28.1"
2222
python-dotenv = "^0.21.0"

substack/api.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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:

substack/post.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class Post:
55

6-
def __init__(self, title: str, subtitle: str, user_id: str):
6+
def __init__(self, title, subtitle, user_id):
77
self.draft_title = title
88
self.draft_subtitle = subtitle
99
self.draft_body = {"type": "doc", "content": []}
@@ -67,7 +67,7 @@ def captioned_image(self, value):
6767
}}]
6868
self.draft_body["content"][-1]["content"] = content
6969

70-
def text(self, value: str):
70+
def text(self, value):
7171
"""
7272
7373
Add text to the last paragraph.

0 commit comments

Comments
 (0)