Python library to access kintone
Latest commit ecca394 Nov 4, 2016 @icoxfog417 committed on GitHub Merge pull request #21 from icoxfog417/comment_api
implements comment api


Python library to access kintone.

import pykintone

r ="kintone domain", "app id", "api token").select("updated_time > NOW()")
if r.ok:
    records = r.records

Quick Start

pip install pykintone


Record and model mapping

import pykintone
from pykintone import model

class Person(model.kintoneModel):

    def __init__(self):
        super(Person, self).__init__()
        self.last_name = ""
        self.first_name = ""

app = pykintone.load("path_to_account_setting").app()
persons =

someone = persons[0]
someone.last_name = "xxx"

Of course you can use every basic operation.

  • create
  • read
  • update
  • delete

File Field

(You have to prepare the kintone Application that has my_files field as below.)

import pykintone
from pykintone import model
import pykintone.structure_field as sf

class MyFolder(model.kintoneModel):

    def __init__(self):
        super(MyFolder, self).__init__()
        self.my_files = [sf.File()]

app = pykintone.load("path_to_account_setting").app()
my_files = ["note.txt", "image.png"]

folder = MyFolder()
folder.my_files = [sf.File.upload(f, app) for f in my_files]

result = app.create(folder)
record = app.get(result.record_id).model(MyFolder)
files = [ for f in record.my_files]

Record Comment

import pykintone
from pykintone import model

class Report(model.kintoneModel):

    def __init__(self, title="", detail=""):
        super(Report, self).__init__()
        self.title = title
        self.detail = detail

app = pykintone.load("path_to_account_setting").app()

# create record
report = Report(title="about today", detail="I used pykintone.")
created_id = app.create(report).record_id

# create comment
app.comment(created_id).create("Good Job!")

Application Administration

import pykintone
from pykintone.application_settings.administrator import Administrator
import pykintone.application_settings.form_field as ff
from pykintone.application_settings.view import View

kintone = pykintone.load("path_to_account_setting")

with kintone.administration().transaction() as admin:
    # create application
    created = admin.create_application("my_application")

    # create form
    f1 = ff.BaseFormField.create("SINGLE_LINE_TEXT", "title", "Title")
    f2 = ff.BaseFormField.create("MULTI_LINE_TEXT", "description", "Desc")
    admin.form().add([f1, f2])

    # create view
    view = View.create("mylist", ["title", "description"])

User API

import pykintone

export_api = pykintone.load("path_to_account_setting").user_api().for_exporting
users = export_api.get_users().users


  • users
  • user's organizations and titles
  • user's groups

Installation Detail

You can download from pypi.

pip install pykintone

pykintone works on Python3, and it depends on below libraries.

You can write account setting file as below (yaml format).

domain: xxx
    id: user_id
    password: password
    id: basic_id
    password: password
        id: 1

Of course you can use api_token.

domain: xxx
        id: 1
        token: xxxx


You have to create test application on kintone, and you can use tests/ (application template) to do it.