mdfy plugin for esa.
Project description
mdfy-esa
mdfy plugin for esa
- Documentation: https://argonism.github.io/mdfy-esa
- GitHub: https://github.com/argonism/mdfy-esa
- PyPI: https://pypi.org/project/mdfy-esa/
- Free software: MIT
Pre-requirement
You need set esa.io API token and set it to environment veriable ESA_ACCESS_TOKEN.
export ESA_ACCESS_TOKEN=YOUR_ACCESS_TOKEN
Usage
The mdfy-esa feature supports uploading of local images and files. With the EsaMdfier, images or files designated with MdImage or MdLink are uploaded automatically. Simply pass the MdImage with the local image path, and voila - it’s done!"
from mdfy import MdImage, MdLink, MdText
from mdfy_esa import EsaMdfier
esa_team = "your esa team name"
post_fullname = "post name as you like"
contents = [
MdText("This is a test article."),
MdImage(src="examples/test_image.png"),
MdLink(url="examples/dummy.pdf"),
]
mdfier = EsaMdfier(post_fullname=post_fullname, esa_team=esa_team)
created_post_info = mdfier.write(contents=contents)
# created_post_info = {'number': 4418, 'name': 'My Test Article', 'full_name': 'note/me/My Test Article', 'wip': True, 'body_md': 'This is a test article.\n', 'body_html': '<p data- ...}
# see esa.io api document for detail
# https://docs.esa.io/posts/102#POST%20/v1/teams/:team_name/posts
You can also update an existing post using its post number!
from mdfy import MdImage, MdLink, MdText
from mdfy_esa import EsaMdfier
esa_team = "your esa team name"
post_number = 4930
contents = [
MdText("NEW! This post is updated!"),
MdText("This is a test article."),
MdImage(src="examples/test_image.png"),
MdLink(url="examples/dummy.pdf"),
]
mdfier = EsaMdfier(post_number=post_number, esa_team=esa_team)
updated_post_info = mdfier.write(contents=contents)
Features
- TODO
Credits
This package was created with Cookiecutter and the waynerv/cookiecutter-pypackage project template.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mdfy_esa-0.5.0.tar.gz
(5.1 kB
view details)
Built Distribution
File details
Details for the file mdfy_esa-0.5.0.tar.gz
.
File metadata
- Download URL: mdfy_esa-0.5.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 323a360a37b6c737312a9ef370ed35c7bed4abccf2c692203aa377cf549e53d3 |
|
MD5 | 9ef7fbddcd9365f8f4f8dd26e2caf263 |
|
BLAKE2b-256 | b3e5a841769e40af7bde9851709017373793284c07d1bc9536ae5f056f5d98cf |
File details
Details for the file mdfy_esa-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: mdfy_esa-0.5.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce1ca506874ac1a2e7407fe559304de4dce7098758de6b552fb0898e6c4a3ed9 |
|
MD5 | 6c167dfa1e96bfee892c0f2d5af1f3b8 |
|
BLAKE2b-256 | 9a1a3297404770043971215c53ce0bfc1827d8b7d676ebcfc2daca3b7dfdc89d |