python-substack 0.1.19__py3-none-any.whl → 0.1.21__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,23 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-substack
3
- Version: 0.1.19
3
+ Version: 0.1.21
4
4
  Summary: A Python wrapper around the Substack API.
5
5
  License: MIT
6
6
  License-File: LICENSE
7
7
  Keywords: substack
8
8
  Author: Paolo Mazza
9
9
  Author-email: mazzapaolo2019@gmail.com
10
- Requires-Python: >=3.9
10
+ Requires-Python: >=3.10,<4.0
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
16
  Classifier: Programming Language :: Python :: 3.13
18
17
  Classifier: Programming Language :: Python :: 3.14
19
18
  Requires-Dist: PyYAML (>=6.0,<7.0)
20
- Requires-Dist: python-dotenv (>=0.21.0,<0.22.0)
21
- Requires-Dist: requests (>=2.31.0,<3.0.0)
19
+ Requires-Dist: python-dotenv (>=1.2.1,<2.0.0)
20
+ Requires-Dist: requests (>=2.32.0,<3.0.0)
22
21
  Project-URL: Homepage, https://github.com/ma2za/python-substack
23
22
  Project-URL: Repository, https://github.com/ma2za/python-substack
24
23
  Description-Content-Type: text/markdown
@@ -38,6 +37,12 @@ You can install python-substack using:
38
37
 
39
38
  $ pip install python-substack
40
39
 
40
+ For the MCP server tools, install the extra dependency set:
41
+
42
+ $ poetry install --with mcp
43
+
44
+ > NOTE: We had to upgrade the package requirements to support Python 3.10 because 3.9 is basically vintage now. If you still run 3.9, please join us in the future (or bring snacks).
45
+
41
46
  ---
42
47
 
43
48
  # Setup
@@ -237,7 +242,14 @@ for _, item in body.items():
237
242
  post.add(item)
238
243
 
239
244
  draft = api.post_draft(post.get_draft())
240
- api.put_draft(draft.get("id"), draft_section_id=post.draft_section_id)
245
+ put_draft_kwargs = {
246
+ "draft_section_id": post.draft_section_id,
247
+ "search_engine_title": post_data.get("search_engine_title"),
248
+ "search_engine_description": post_data.get("search_engine_description"),
249
+ "slug": post_data.get("slug"),
250
+ }
251
+ put_draft_kwargs = {k: v for k, v in put_draft_kwargs.items() if v is not None}
252
+ api.put_draft(draft.get("id"), **put_draft_kwargs)
241
253
 
242
254
  # Publish the draft
243
255
  api.prepublish_draft(draft.get("id"))
@@ -265,6 +277,22 @@ body:
265
277
  src: "local_image.jpg" # Local images will be uploaded automatically
266
278
  ```
267
279
 
280
+ ## MCP FastMCP server
281
+
282
+ This package now includes a FastMCP server in `substack/mcp_fastmcp.py` with the following tools:
283
+
284
+ - `post_draft_from_markdown(...)`: create draft from markdown, optional tag/add/prepublish/publish, and control send/share_automatically.
285
+ - `put_draft(draft_id, update_payload)`: update draft fields.
286
+ - `add_tags(draft_id, tags)`: add tags to a draft/post.
287
+ - `prepublish_draft(draft_id)`: prepublish a draft.
288
+ - `publish_draft(draft_id, send=True, share_automatically=False)`: publish a draft.
289
+
290
+ Use via stdio transport:
291
+
292
+ ```bash
293
+ python -c "from substack.mcp_fastmcp import main; main()"
294
+ ```
295
+
268
296
  # Contributing
269
297
 
270
298
  Install pre-commit:
@@ -0,0 +1,8 @@
1
+ substack/__init__.py,sha256=aVKou2fzkuSCMybp5NHsh7jyN6lelsaVh9A5mwPeyzw,390
2
+ substack/api.py,sha256=VPzQ_bpqGcE4ZXWD2lUppnvWsuLRjvtBN7bHmW4Bgww,20422
3
+ substack/exceptions.py,sha256=BbP5W5UpzFcM5SYIxx6snWD_Rmj7F_YjYIYC_r03gZY,911
4
+ substack/post.py,sha256=X0hveTdYilYSa0G8-NqfQAD3pcMV8nGKy0CBIZRB8Ko,26115
5
+ python_substack-0.1.21.dist-info/METADATA,sha256=Yh4nwOWfrDp4nBOHZfZK8Y23c__FwfiIQ8sMBYgEElo,9152
6
+ python_substack-0.1.21.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
7
+ python_substack-0.1.21.dist-info/licenses/LICENSE,sha256=L6jk148I5HhhVbfUvkO3EO7eAoU5zToLio4-ApkCkxg,1062
8
+ python_substack-0.1.21.dist-info/RECORD,,
substack/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  __author__ = "Paolo Mazza"
4
4
  __email__ = "mazzapaolo2019@gmail.com"
5
5
  __license__ = "MIT License"
6
- __version__ = "1.0"
6
+ __version__ = "0.1.21"
7
7
  __url__ = "https://github.com/ma2za/python-substack"
8
8
  __download_url__ = "https://pypi.python.org/pypi/python-substack"
9
9
  __description__ = "A Python wrapper around the Substack API"
@@ -1,8 +0,0 @@
1
- substack/__init__.py,sha256=mkNj8jFW6wA4dIYyyM1UfKt5Q9MgR8xg3CaADl4IjlQ,387
2
- substack/api.py,sha256=VPzQ_bpqGcE4ZXWD2lUppnvWsuLRjvtBN7bHmW4Bgww,20422
3
- substack/exceptions.py,sha256=BbP5W5UpzFcM5SYIxx6snWD_Rmj7F_YjYIYC_r03gZY,911
4
- substack/post.py,sha256=X0hveTdYilYSa0G8-NqfQAD3pcMV8nGKy0CBIZRB8Ko,26115
5
- python_substack-0.1.19.dist-info/METADATA,sha256=xg-JmHjKEBWHcJr_6W-Xn5arCaTOcXrL_GKK0hWNdlA,8002
6
- python_substack-0.1.19.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
7
- python_substack-0.1.19.dist-info/licenses/LICENSE,sha256=L6jk148I5HhhVbfUvkO3EO7eAoU5zToLio4-ApkCkxg,1062
8
- python_substack-0.1.19.dist-info/RECORD,,