# mdfy-esa
[](https://pypi.org/project/mdfy-esa/)
[](https://pypi.org/project/mdfy-esa/)
[](https://github.com/argonism/mdfy-esa/actions/workflows/release.yml)
[](https://github.com/argonism/mdfy-esa/actions/workflows/dev.yml)
[](https://codecov.io/github/argonism/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.
``` shell
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!"
```python
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!
```python
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](https://github.com/audreyr/cookiecutter) and the [waynerv/cookiecutter-pypackage](https://github.com/waynerv/cookiecutter-pypackage) project template.
Raw data
{
"_id": null,
"home_page": "https://github.com/argonism/mdfy-esa",
"name": "mdfy-esa",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "k-ush",
"author_email": "argoooooon@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b3/e5/a841769e40af7bde9851709017373793284c07d1bc9536ae5f056f5d98cf/mdfy_esa-0.5.0.tar.gz",
"platform": null,
"description": "# mdfy-esa\n\n[](https://pypi.org/project/mdfy-esa/)\n[](https://pypi.org/project/mdfy-esa/)\n[](https://github.com/argonism/mdfy-esa/actions/workflows/release.yml)\n[](https://github.com/argonism/mdfy-esa/actions/workflows/dev.yml)\n[](https://codecov.io/github/argonism/mdfy-esa)\n\nmdfy plugin for esa\n\n- Documentation: <https://argonism.github.io/mdfy-esa>\n- GitHub: <https://github.com/argonism/mdfy-esa>\n- PyPI: <https://pypi.org/project/mdfy-esa/>\n- Free software: MIT\n\n## Pre-requirement\n\nYou need set esa.io API token and set it to environment veriable ESA_ACCESS_TOKEN.\n\n``` shell\nexport ESA_ACCESS_TOKEN=YOUR_ACCESS_TOKEN\n```\n\n## Usage\n\nThe mdfy-esa feature supports uploading of local images and files.\nWith the EsaMdfier, images or files designated with MdImage or MdLink are uploaded automatically.\nSimply pass the MdImage with the local image path, and voila - it\u2019s done!\"\n\n```python\nfrom mdfy import MdImage, MdLink, MdText\nfrom mdfy_esa import EsaMdfier\n\nesa_team = \"your esa team name\"\npost_fullname = \"post name as you like\"\ncontents = [\n MdText(\"This is a test article.\"),\n MdImage(src=\"examples/test_image.png\"),\n MdLink(url=\"examples/dummy.pdf\"),\n]\n\nmdfier = EsaMdfier(post_fullname=post_fullname, esa_team=esa_team)\ncreated_post_info = mdfier.write(contents=contents)\n\n# 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- ...}\n# see esa.io api document for detail\n# https://docs.esa.io/posts/102#POST%20/v1/teams/:team_name/posts\n```\n\nYou can also update an existing post using its post number!\n\n```python\nfrom mdfy import MdImage, MdLink, MdText\nfrom mdfy_esa import EsaMdfier\n\nesa_team = \"your esa team name\"\npost_number = 4930\ncontents = [\n MdText(\"NEW! This post is updated!\"),\n MdText(\"This is a test article.\"),\n MdImage(src=\"examples/test_image.png\"),\n MdLink(url=\"examples/dummy.pdf\"),\n]\n\nmdfier = EsaMdfier(post_number=post_number, esa_team=esa_team)\nupdated_post_info = mdfier.write(contents=contents)\n```\n\n## Features\n\n- TODO\n\n## Credits\n\nThis package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [waynerv/cookiecutter-pypackage](https://github.com/waynerv/cookiecutter-pypackage) project template.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "mdfy plugin for esa.",
"version": "0.5.0",
"project_urls": {
"Homepage": "https://github.com/argonism/mdfy-esa",
"Repository": "https://github.com/argonism/mdfy-esa"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9a1a3297404770043971215c53ce0bfc1827d8b7d676ebcfc2daca3b7dfdc89d",
"md5": "6c167dfa1e96bfee892c0f2d5af1f3b8",
"sha256": "ce1ca506874ac1a2e7407fe559304de4dce7098758de6b552fb0898e6c4a3ed9"
},
"downloads": -1,
"filename": "mdfy_esa-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6c167dfa1e96bfee892c0f2d5af1f3b8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 4673,
"upload_time": "2023-10-12T08:17:49",
"upload_time_iso_8601": "2023-10-12T08:17:49.578391Z",
"url": "https://files.pythonhosted.org/packages/9a/1a/3297404770043971215c53ce0bfc1827d8b7d676ebcfc2daca3b7dfdc89d/mdfy_esa-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b3e5a841769e40af7bde9851709017373793284c07d1bc9536ae5f056f5d98cf",
"md5": "9ef7fbddcd9365f8f4f8dd26e2caf263",
"sha256": "323a360a37b6c737312a9ef370ed35c7bed4abccf2c692203aa377cf549e53d3"
},
"downloads": -1,
"filename": "mdfy_esa-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "9ef7fbddcd9365f8f4f8dd26e2caf263",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 5066,
"upload_time": "2023-10-12T08:17:50",
"upload_time_iso_8601": "2023-10-12T08:17:50.532779Z",
"url": "https://files.pythonhosted.org/packages/b3/e5/a841769e40af7bde9851709017373793284c07d1bc9536ae5f056f5d98cf/mdfy_esa-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-12 08:17:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "argonism",
"github_project": "mdfy-esa",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "mdfy-esa"
}