python-substack 0.4.0__py3-none-any.whl → 0.6.0__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.
- {python_substack-0.4.0.dist-info → python_substack-0.6.0.dist-info}/METADATA +12 -2
- python_substack-0.6.0.dist-info/RECORD +14 -0
- substack/__init__.py +13 -13
- substack/api.py +857 -792
- substack/cli.py +41 -1
- substack/exceptions.py +44 -32
- substack/mdexport.py +381 -0
- python_substack-0.4.0.dist-info/RECORD +0 -13
- {python_substack-0.4.0.dist-info → python_substack-0.6.0.dist-info}/WHEEL +0 -0
- {python_substack-0.4.0.dist-info → python_substack-0.6.0.dist-info}/entry_points.txt +0 -0
- {python_substack-0.4.0.dist-info → python_substack-0.6.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-substack
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Write and safely manage Substack drafts from Markdown with Python, CLI, and MCP.
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -23,7 +23,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
23
23
|
Provides-Extra: mcp
|
|
24
24
|
Requires-Dist: PyYAML (>=6.0,<7.0)
|
|
25
25
|
Requires-Dist: fastmcp (>=3.1.1,<4.0.0) ; extra == "mcp"
|
|
26
|
-
Requires-Dist: markdown-it-py (>=3
|
|
26
|
+
Requires-Dist: markdown-it-py (>=3,<5)
|
|
27
27
|
Requires-Dist: mdit-py-plugins (>=0.5,<0.7)
|
|
28
28
|
Requires-Dist: python-dotenv (>=1.2.1,<2.0.0)
|
|
29
29
|
Requires-Dist: requests (>=2.32.0,<3.0.0)
|
|
@@ -93,6 +93,7 @@ Substack result:
|
|
|
93
93
|
- Upload local images referenced by Markdown.
|
|
94
94
|
- Set audience, comment permissions, SEO metadata, slug, sections, and tags.
|
|
95
95
|
- List and inspect publications and drafts.
|
|
96
|
+
- Export drafts to loss-aware Markdown backups without server writes.
|
|
96
97
|
- Schedule, unschedule, publish, and delete drafts with explicit safeguards.
|
|
97
98
|
- Use stable JSON envelopes in scripts and automation.
|
|
98
99
|
- Authenticate with browser cookies or email and password.
|
|
@@ -143,6 +144,7 @@ Inspect publications and drafts:
|
|
|
143
144
|
substack publications list
|
|
144
145
|
substack drafts list --limit 10
|
|
145
146
|
substack drafts get 12345
|
|
147
|
+
substack drafts export 12345 --output backup.md
|
|
146
148
|
substack --publication-url https://example.substack.com drafts list
|
|
147
149
|
```
|
|
148
150
|
|
|
@@ -207,6 +209,14 @@ print(result["draft"]["id"])
|
|
|
207
209
|
`create_draft_from_markdown` creates a draft by default. It publishes only when
|
|
208
210
|
`publish=True` is passed.
|
|
209
211
|
|
|
212
|
+
Back up an existing draft without modifying it:
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
backup = api.export_draft_to_markdown(12345)
|
|
216
|
+
print(backup["markdown"])
|
|
217
|
+
print(backup["unsupported_nodes"])
|
|
218
|
+
```
|
|
219
|
+
|
|
210
220
|
For direct ProseMirror node construction, see the
|
|
211
221
|
[low-level Python API](docs/low-level-api.md). YAML workflows are documented in
|
|
212
222
|
[YAML drafts](docs/yaml.md).
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
substack/__init__.py,sha256=AOBZry1Ww9TjPAvZmD6jBifVD5vjDGYo9_6Pay1wNPY,449
|
|
2
|
+
substack/api.py,sha256=9YYLi4410zSUiNd84ZNCHA-gSo08R4pS5JdpXFHUXiQ,26550
|
|
3
|
+
substack/cli.py,sha256=-3HI99ewA6IFNluiKr_LMW4J-rAzxDzW6b1E3ar8cJU,23125
|
|
4
|
+
substack/exceptions.py,sha256=Y61XSPyxDxXPbVlioFvKhb94MRY0tpD389F5YdL1rGM,1390
|
|
5
|
+
substack/mdexport.py,sha256=_pSjioPJIA1wuJ6hYpvODZVswPSUROuzEndVoYnv-yU,13541
|
|
6
|
+
substack/mdrender.py,sha256=QGJkdp1isFmhVyTRMogIabAK8OO2xQh9CrjnXZvFTY4,9308
|
|
7
|
+
substack/nodes.py,sha256=fTsGO0-lTztcXiloIjXrHVnJes9EcltGcrX-mEV2ceQ,5004
|
|
8
|
+
substack/post.py,sha256=qDXu-xzO3nRXtahc-yG2EhxKAXB2hG_Z1nLa55UMBGg,19697
|
|
9
|
+
substack_mcp/mcp_server.py,sha256=3VTSSsiAmr4btImWpfoEl7irpTgqI-FH4q5r9r3u3w8,10949
|
|
10
|
+
python_substack-0.6.0.dist-info/METADATA,sha256=krTBh9COgQai1eRfZbWNSriJt51OfEu3iDwEgnRrYPA,8689
|
|
11
|
+
python_substack-0.6.0.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
|
|
12
|
+
python_substack-0.6.0.dist-info/entry_points.txt,sha256=MKPjaBUd-0PtvxsBviStsVq1c0h8JZ_qUoYEsBK1xJc,236
|
|
13
|
+
python_substack-0.6.0.dist-info/licenses/LICENSE,sha256=L6jk148I5HhhVbfUvkO3EO7eAoU5zToLio4-ApkCkxg,1062
|
|
14
|
+
python_substack-0.6.0.dist-info/RECORD,,
|
substack/__init__.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"""A library that provides a Python interface to the Substack API."""
|
|
2
|
-
|
|
3
|
-
__author__ = "Paolo Mazza"
|
|
4
|
-
__email__ = "mazzapaolo2019@gmail.com"
|
|
5
|
-
__license__ = "MIT License"
|
|
6
|
-
__version__ = "0.
|
|
7
|
-
__url__ = "https://github.com/ma2za/python-substack"
|
|
8
|
-
__download_url__ = "https://pypi.python.org/pypi/python-substack"
|
|
9
|
-
__description__ = (
|
|
10
|
-
"Write and safely manage Substack drafts from Markdown with Python, CLI, and MCP."
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
from .api import Api
|
|
1
|
+
"""A library that provides a Python interface to the Substack API."""
|
|
2
|
+
|
|
3
|
+
__author__ = "Paolo Mazza"
|
|
4
|
+
__email__ = "mazzapaolo2019@gmail.com"
|
|
5
|
+
__license__ = "MIT License"
|
|
6
|
+
__version__ = "0.6.0"
|
|
7
|
+
__url__ = "https://github.com/ma2za/python-substack"
|
|
8
|
+
__download_url__ = "https://pypi.python.org/pypi/python-substack"
|
|
9
|
+
__description__ = (
|
|
10
|
+
"Write and safely manage Substack drafts from Markdown with Python, CLI, and MCP."
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
from .api import Api
|