Skip to main content

kakao i openbuilder skill response template builder โš’ for python ๐Ÿ

Project description

kakao-skill-template-builder

kakao i openbuilder skill response template builder โš’ for python ๐Ÿ

ํŒŒ์ด์ฌ์—์„œ ์นด์นด์˜ค i ์˜คํ”ˆ๋นŒ๋”์˜ ์‘๋‹ต ํƒ€์ž…๋ณ„ JSON ํฌ๋งท์„ ์ƒ์„ฑํ•˜๋Š” ๋„๊ตฌ ์ž…๋‹ˆ๋‹ค.

ํŠน์ง•

๐Ÿ‘Œ ์˜คํ”ˆ๋นŒ๋” ๋„์›€๋ง์˜ ๋ชจ๋“  ์‘๋‹ต ํƒ€์ž…๋ณ„ JSON ํฌ๋งท์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ชจ๋‘ ๋‹ค ํ…Œ์ŠคํŠธ ํ•ด๋ดค์–ด์š”! ๐Ÿ˜Š tests/test_builder.py๋ฅผ ์ฐธ๊ณ !

โš’ SkillResponseBuilder ๋ฅผ ์ด์šฉํ•ด์„œ ์›ํ•˜๋Š”๋Œ€๋กœ ์ด๊ฒƒ์ €๊ฒƒ ์„ž์ธ ๋Œ€๋‹ต์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!

๐Ÿ ํŒŒ์ด์ฌ์˜ local ๋ณ€์ˆ˜๋ฅผ ์ด์šฉํ•ด์„œ ์ฝ”๋“œ๊ฐ€ ์—„์ฒญ ์งง์•„์š”! ๊ณ ์น˜๊ธฐ ์‰ฝ๋‹ค๋Š” ๋œป์ด์ฃ .

Installation

$ pip install kakaosb

Example

  1. SimpleText
from kakaosb import SkillResponseBuilder, SimpleText

sb = SkillResponseBuilder([SimpleText('Hello Kakao!')])
res_dict = sb.to_dict()  # ์‚ฌ์ „ ํ˜•์‹ ๋ณ€ํ™˜
res_json = sb.to_json(indent=4)  # json ํ˜•์‹ ๋ณ€ํ™˜
  1. ๋ฒ ์ด์ง ์นด๋“œ
from kakaosb import SkillResponseBuilder, BasicCard, Thumbnail, Profile, Social, MessageButton, WeblinkButton

sb = SkillResponseBuilder()
basicCard = BasicCard(
    thumbnail=Thumbnail('http://k.kakaocdn.net/dn/83BvP/bl20duRC1Q1/lj3JUcmrzC53YIjNDkqbWK/i_6piz1p.jpg'),
    title='๋ณด๋ฌผ์ƒ์ž',
    description='๋ณด๋ฌผ์ƒ์ž ์•ˆ์—๋Š” ๋ญ๊ฐ€ ์žˆ์„๊นŒ',
    profile=Profile('๋ณด๋ฌผ์ƒ์ž', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT4BJ9LU4Ikr_EvZLmijfcjzQKMRCJ2bO3A8SVKNuQ78zu2KOqM'),
    social=Social(1238, 8, 780),
    buttons=[
        MessageButton('์—ด์–ด๋ณด๊ธฐ', '์งœ์ž”! ์šฐ๋ฆฌ๊ฐ€ ์ฐพ๋˜ ๋ณด๋ฌผ์ž…๋‹ˆ๋‹ค'),
        WeblinkButton('๊ตฌ๊ฒฝํ•˜๊ธฐ', 'https://e.kakao.com/t/hello-ryan')
    ])
sb.append(basicCard)
res_dict = sb.to_dict()  # ์‚ฌ์ „ ํ˜•์‹ ๋ณ€ํ™˜
res_json = sb.to_json(indent=4)  # json ํ˜•์‹ ๋ณ€ํ™˜
  1. mix
from kakaosb import SkillResponseBuilder, SimpleText, SimpleImage

sb = SkillResponseBuilder()
sb.append(SimpleText('Hello Kakao!'))
sb.append(SimpleImage('http://k.kakaocdn.net/dn/83BvP/bl20duRC1Q1/lj3JUcmrzC53YIjNDkqbWK/i_6piz1p.jpg', '๋ณด๋ฌผ์ƒ์ž์ž…๋‹ˆ๋‹ค'))
sb.append(SimpleText('Bye Bye ๐Ÿงค'))
res_dict = sb.to_dict()  # ์‚ฌ์ „ ํ˜•์‹ ๋ณ€ํ™˜
res_json = sb.to_json(indent=4)  # json ํ˜•์‹ ๋ณ€ํ™˜

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

kakaosb-1.0.0.tar.gz (8.1 kB view hashes)

Uploaded source

Built Distribution

kakaosb-1.0.0-py3-none-any.whl (14.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page