Skip to main content

카카오톡 챗봇 빌더 도우미

Python언어 전용

소개

[!NOTE]
https://github.com/jcrist/msgspec 을 이용하여 serialization 합니다.

Python 언어로 카카오 챗봇 서버를 만들 때 좀 더 쉽게 JSON 메시지 응답을 만들 수 있게 도와줍니다.

SimpleText, SimpleImage, ListCard, Carousel, BasicCard, CommerceCard, ItemCard 등의

챗봇 JSON 데이터를 쉽게 만들 수 있도록 도와줍니다.

설치

pip install kakao-json

사용법

ListCard 예제

from kakao_json import Button, Kakao, ListItem


k = Kakao()

    k.add_qr("오늘", "카톡 발화문1")
    k.add_qr("어제")  # label becomes also messageText

    list_card = k.init_list_card().set_header("리스트 카드 제목")
    list_card.add_button(Button("그냥 텍스트 버튼", "message"))
    list_card.add_button(k.init_button("link label").set_link("https://google.com"))
    list_card.add_button(
        k.init_button("share label").set_action_share().set_msg("카톡에 보이는 메시지")
    )
    list_card.add_button(k.init_button("call label").set_number("010-1234-5678"))

    list_card.add_item(
        ListItem("title").set_desc("description").set_link("https://naver.com")
    )

    k.add_output(list_card)

    print(k.to_json())
{
  "template": {
    "outputs": [
      {
        "listCard": {
          "buttons": [
            {
              "label": "그냥 텍스트 버튼",
              "action": "message"
            },
            {
              "label": "link label",
              "action": "webLink",
              "webLinkUrl": "https://google.com"
            },
            {
              "label": "share label",
              "action": "share",
              "messageText": "카톡에 보이는 메시지"
            },
            {
              "label": "call label",
              "action": "phone",
              "phoneNumber": "010-1234-5678"
            }
          ],
          "header": {
            "title": "리스트 카드 제목!"
          },
          "items": [
            {
              "title": "title",
              "description": "description",
              "link": {
                "web": "https://naver.com"
              }
            }
          ]
        }
      }
    ],
    "quickReplies": [
      {
        "action": "message",
        "label": "오늘",
        "messageText": "오늘 공지 보여줘"
      },
      {
        "action": "message",
        "label": "어제",
        "messageText": "어제 공지 보여줘"
      }
    ]
  },
  "version": "2.0"
}

Metadata

Release files for kakao_json 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kakao_json 1.0.4
File Size Uploaded Provenance Actions
kakao_json-1.0.4.tar.gz 24.7 kB Without provenance Details for kakao_json-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kakao_json 1.0.4
File Interpreter ABI Platform Actions
kakao_json-1.0.4-py3-none-any.whl Python 3 none any Details for kakao_json-1.0.4-py3-none-any.whl

Total release size: 38.2 kB

Release files / kakao_json-1.0.4.tar.gz

Download URL kakao_json-1.0.4.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
581541619ce940fb290fd8926ace304117e5faa1404952c66e742362689376c3
BLAKE2b-256 checksum
How to use checksums
ce2b5b6eba935378e990f809cda8f32f6524b7ca867c8106daf5c781540c27c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.6 Windows/10

Release files / kakao_json-1.0.4-py3-none-any.whl

Download URL kakao_json-1.0.4-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03a3686f796bd0c984fde66710c157054e8bdb692bfc4275751205dfade8334b
BLAKE2b-256 checksum
How to use checksums
c9e9e6f8514fefe93907aba4ad0a3d658d96342ed221dfa8dfed62955b22a67a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.6 Windows/10

Security for kakao_json 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page