Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeongukjae/pytistory
๐ Tistory Blog API Client written in Python.
https://github.com/jeongukjae/pytistory
api-client api-wrapper blogging python-library tistory
Last synced: 3 months ago
JSON representation
๐ Tistory Blog API Client written in Python.
- Host: GitHub
- URL: https://github.com/jeongukjae/pytistory
- Owner: jeongukjae
- License: mit
- Archived: true
- Created: 2018-01-31T11:38:44.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-29T17:03:54.000Z (over 3 years ago)
- Last Synced: 2024-07-24T15:45:58.730Z (4 months ago)
- Topics: api-client, api-wrapper, blogging, python-library, tistory
- Language: Python
- Homepage:
- Size: 689 KB
- Stars: 14
- Watchers: 3
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
PyTistory
=========.. image:: https://circleci.com/gh/JeongUkJae/pytistory.svg?style=shield
:target: https://circleci.com/gh/JeongUkJae/pytistory
.. image:: https://travis-ci.org/JeongUkJae/pytistory.svg?branch=master
:target: https://travis-ci.org/JeongUkJae/pytistory
.. image:: https://codecov.io/gh/JeongUkJae/pytistory/branch/master/graph/badge.svg
:target: https://codecov.io/gh/JeongUkJae/pytistory
.. image:: https://requires.io/github/JeongUkJae/pytistory/requirements.svg?branch=master
:target: https://requires.io/github/JeongUkJae/pytistory/requirements/?branch=master
.. image:: https://img.shields.io/pypi/v/pytistory.svg
:target: https://pypi.org/project/pytistory
.. image:: https://img.shields.io/pypi/pyversions/pytistory.svg
:target: https://pypi.org/project/pytistory
.. image:: https://img.shields.io/pypi/l/pytistory.svg
:target: https://pypi.org/project/pytistory
.. image:: https://img.shields.io/pypi/status/pytistory.svg
:target: https://pypi.org/project/pytistory
.. image:: https://readthedocs.org/projects/pytistory/badge/?version=latest
:target: https://pytistory.readthedocs.io/ko/latest/?badge=latest
:alt: Documentation StatusPyTistory๋ `ํฐ์คํ ๋ฆฌ ์คํ API ๊ฐ์ด๋ `_ ๋ฅผ ์ฐธ๊ณ ํ์ฌ Python์ผ๋ก ์์ฑํ ํฐ์คํ ๋ฆฌ
API ํด๋ผ์ด์ธํธ์ ๋๋ค. `ํฐ์คํ ๋ฆฌ ์คํ API ๊ฐ์ด๋ ์ธ์ฆ ๋ฐฉ์ `_ ์ค
Client-side flow ๋ฐฉ์์ ๋ฐ๋ผ ๊ตฌํ๋์์ต๋๋ค. ์์ธํ ์ฌ์ฉ๋ฒ์ `PyTistory Documentation `_ ์์
ํ์ธํ์ค ์ ์์ต๋๋ค.Installation
------------pytistory๋ ``pip``\ ๋ฅผ ํตํด ์ค์นํ ์ ์์ต๋๋ค.
.. code-block:: bash
$ pip install pytistory
์ฌ์ฉ๋ฒ
-------์ฌ์ฉ์ ์ธ์ฆ
~~~~~~~~~~~์ธ์ฆ์ ๋ณด๋ ๋ค์๊ณผ ๊ฐ์ ์ฐ์ ์์๋ฅผ ํตํด ์ ์ฉ๋ฉ๋๋ค.
- ์ง์ ์ค์ ํ๋ ``configure``\ ํจ์๋ก ๋์ด์ค๋ ``access_token``\์ธ์๊ฐ
- ``configure``\ ํจ์๋ก ๋์ด์ค๋ ``client_id``\, ``tistory_id``\, ``tistory_password``\ ์ธ์๊ฐ
- ``configure``\ ํจ์๋ก ๋์ด์ค๋ ``file_name``\์์ ์ฝ์ด๋ค์ธ ์ธ์๊ฐ
- ํ๊ฒฝ๋ณ์๊ฐ
- ๊ธฐ๋ณธ ํ์ผ(``~/.pytistory/credentials.ini``\)์ ์ค์ ๋์ด ์๋ ๊ฐ์ฆ, ํ๊ฒฝ๋ณ์, ๊ธฐ๋ณธ ์ค์ ํ์ผ์ client id๊ฐ ์ ์ฉ๋์ด ์๋ค ํ๋๋ผ๋ ์ง์ ๋๊ธฐ๋ ``file_name``\์ ์กด์ฌํ๋ ์ค์ ๋ค์ ์ํด ๋ฎ์ด์์์ง๊ณ ,
์ง์ ์ธ์๊ฐ์ผ๋ก ๋๊ธฐ๋ ``client_id``\๋ฑ์ ์ธ์๊ฐ์ ์ํด ๋ฎ์ด์์์ง๋๋ค.``access_token``\์ด ์ธ์๋ก ๋์ด์ฌ ๊ฒฝ์ฐ ๋ค๋ฅธ ์ต์ ์ ์ ๋ถ ๋ฌด์ํ๊ณ , ``access_token``\๋ง์ ์ค์ ํฉ๋๋ค.
์ง์ Access Token ์ค์
********************************.. code-block:: python
from pytistory import PyTistory
pytistory = PyTistory()
pytistory.configure(
access_token='some-example-access-token')ํจ์์ ์ธ์๊ฐ์ ํตํ ์ค์
********************************.. code-block:: python
from pytistory import PyTistory
pytistory = PyTistory()
pytistory.configure(
client_id='some-example-client-id',
tistory_id='some-example-tistory-id',
tistory_password='some-example-tistory-password')ํ์ผ์ ํตํ ์ค์
******************.. code-block:: python
from pytistory import PyTistory
pytistory = PyTistory()
pytistory.configure(
file_name='./some/path/to/credentials.ini')ํ์ผ ํ์์ ini(Initialization)์ ๋ฐ๋ฆ ๋๋ค.
.. code-block:: ini
[pytistory]
client_id=some-client-id
tistory_id=some-tistory-id
tistory_password=some-tistory-passwordํ๊ฒฝ๋ณ์๋ฅผ ํตํ ์ค์
**********************ํ๊ฒฝ ๋ณ์๋ก๋ ๋ค์๊ณผ ๊ฐ์ด ์ค์ ํ ์ ์์ต๋๋ค.
.. code-block:: bash
export PYTISTORY_CLIENT_ID=some-example-client-id
export PYTISTORY_TISTORY_ID=some-example-tistory-id
export PYTISTORY_TISTORY_PASSWORD=some-example-tistory-passwordAPIํธ์ถ
~~~~~~~~~~~~https://www.tistory.com/apis/kind/action ์ ๊ฐ์ api๋ฅผ ํธ์ถํ ๊ฒฝ์ฐ ์๋์ฒ๋ผ ํธ์ถํฉ๋๋ค.
.. code-block:: python
from pytistory import PyTistory
pytistory = PyTistory()
pytistory.configure()response = pytistory.kind.action(args...)
์์๋ก ๋ธ๋ก๊ทธ ์ ๋ณด๋ฅผ ๋ฐ์์ค๋ ์ฝ๋๋ ์๋์ ๊ฐ์ต๋๋ค.
.. code-block:: python
from pytistory import PyTistory
pytistory = PyTistory()
pytistory.configure()response = pytistory.blog.info()
๊ฒฐ๊ณผ๊ฐ์ ์๋์ฒ๋ผ ๋ฐ์ ์ ์์ต๋๋ค.
.. code-block:: json
{
"status": "200",
"id": "[email protected]",
"item": [
{
"url": "http://oauth.tistory.com",
"secondaryUrl": "http://",
"nickname": "Tistory API",
"title": "๋๋ง์ ์ฑ, Tistory OAuth API ๋ก ๋ง๋ค์ด๋ณด์ธ์!",
"description": "",
"default": "Y",
"blogIconUrl":
"http://i1.daumcdn.net/cfs.tistory/blog/79/795307/index.gif",
"faviconUrl":
"http://i1.daumcdn.net/cfs.tistory/blog/79/795307/index.ico",
"profileThumbnailImageUrl":
"http://cfile1.uf.tistory.com/R106x0/1851DB584DAF942950AF29",
"profileImageUrl":
"http://cfile1.uf.tistory.com/R106x0/1851DB584DAF942950AF29",
"statistics": {
"post": "3",
"comment": "0",
"trackback": "0",
"guestbook": "0",
"invitation": "0"
}
},
{
"url": "http://oauth2.tistory.com",
"secondaryUrl": "http://",
"nickname": "Tistory API",
"title": "๋๋ง์ ๋น๋ฐ ํ",
"description": "",
"default": "N",
"blogIconUrl":
"http://i1.daumcdn.net/cfs.tistory/blog/79/795308/index.gif",
"faviconUrl":
"http://i1.daumcdn.net/cfs.tistory/blog/79/795308/index.ico",
"profileThumbnailImageUrl": "",
"profileImageUrl": "",
"blogId": "795308",
"statistics": {
"post": "0",
"comment": "0",
"trackback": "0",
"guestbook": "0",
"invitation": "0"
}
}
]
}๊ธฐ์ฌ
----์ด ํ๋ก์ ํธ๋ ๋ถ์กฑํ ์ ์ด ๋ง์ต๋๋ค. Contribution์ ์ธ์ ๋ ํ์์ ๋๋ค. ํน์ ์ค๋ฅ, ๋ฒ๊ทธ ํน์ ์ ๋ฐ์ดํธ๊ฐ ํ์ํ ์ ์ด ์์ผ์๋ค๋ฉด
`PR `_ ๋๋ `Issue `_ ๋ฅผ ํตํด
์ธ์ ๋ ์ง ์๋ ค์ฃผ์ธ์. ๐Copyright & License
-------------------Copyright (c) 2018 JeongUkJae. MIT License.