pykintone on Windows Subsystem for Linux

I tried pykintone, a Python library for kintone, on Windows Subsystem for Linux. You can use it by installing pykintone with pip3.

Preparation of pykintone usage environment

--Installing pip3 --Installing pykintone

Python environment for Windows Subsystem for Linux

The following is installed by default.

python : python2.7 python3 : python3.4

rex0220@EDGE-E470:~$ ll /usr/bin/python*
lrwxrwxrwx 1 root root 9 December 21 2013/usr/bin/python -> python2.7*
lrwxrwxrwx 1 root root 9 December 21 2013/usr/bin/python2 -> python2.7*
-rwxr-xr-x 1 root root 975 January 2 2014/usr/bin/python2-jsondiff*
-rwxr-xr-x 1 root root 1080 January 2 2014/usr/bin/python2-jsonpatch*
-rwxr-xr-x 1 root root 3345416 June 23 2015/usr/bin/python2.7*
lrwxrwxrwx 1 root root 9 March 23 2014/usr/bin/python3 -> python3.4*
lrwxrwxrwx 1 root root 16 March 23 2014/usr/bin/python3-config -> python3.4-config*
-rwxr-xr-x 2 root root 3693624 November 17 11:31 /usr/bin/python3.4*
lrwxrwxrwx 1 root root 33 November 17 11:31 /usr/bin/python3.4-config -> x86_64-linux-gnu-python3.4-config*
-rwxr-xr-x 2 root root 3693624 November 17 11:31 /usr/bin/python3.4m*
lrwxrwxrwx 1 root root 34 November 17 11:31 /usr/bin/python3.4m-config -> x86_64-linux-gnu-python3.4m-config*
lrwxrwxrwx 1 root root 10 March 23 2014/usr/bin/python3m -> python3.4m*
lrwxrwxrwx 1 root root 17 March 23 2014/usr/bin/python3m-config -> python3.4m-config*

Install pip3

pip3 (Python's package management system) is not installed, so install it.

sudo apt-get install python3-pip
Loading the package list...Done 0%
Creating a dependency tree
Reading status information...Done
...
python3-pip (1.5.4-1ubuntu4)Is set...
python3-wheel (0.24.0-1~ubuntu1)Is set...
libc-bin (2.19-0ubuntu6.9)Processing the trigger of...
which pip3
/usr/bin/pip3

Install pykintone

sudo pip3 install pykintone

Downloading/unpacking pykintone
  Downloading pykintone-0.3.9.zip
  Running setup.py (path:/tmp/pip_build_root/pykintone/setup.py) egg_info for package pykintone

Downloading/unpacking PyYAML (from pykintone)
  Downloading PyYAML-3.12.tar.gz (253kB): 253kB downloaded
  Running setup.py (path:/tmp/pip_build_root/PyYAML/setup.py) egg_info for package PyYAML

Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python3/dist-packages (from pykintone)
Downloading/unpacking pytz (from pykintone)
  Downloading pytz-2016.10-py2.py3-none-any.whl (483kB): 483kB downloaded
Downloading/unpacking tzlocal (from pykintone)
  Downloading tzlocal-1.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/tzlocal/setup.py) egg_info for package tzlocal

Installing collected packages: pykintone, PyYAML, pytz, tzlocal
  Running setup.py install for pykintone

  Running setup.py install for PyYAML
    checking if libyaml is compilable
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c build/temp.linux-x86_64-3.4/check_libyaml.c -o build/temp.linux-x86_64-3.4/check_libyaml.o
    build/temp.linux-x86_64-3.4/check_libyaml.c:2:18: fatal error: yaml.h:There is no such file or directory
     #include <yaml.h>
                      ^
    compilation terminated.

    libyaml is not found or a compiler error: forcing --without-libyaml
    (if libyaml is installed correctly, you may need to
     specify the option --include-dirs or uncomment and
     modify the parameter include_dirs in setup.cfg)

  Running setup.py install for tzlocal

Successfully installed pykintone PyYAML pytz tzlocal
Cleaning up...

Record acquisition script creation

Create a record acquisition script according to the sample.

getRec1.py



import pykintone
r = pykintone.app("kintone domain", "APPID", "API token").select("")
if r.ok:
        records = r.records
        print(records)
else:
        print(r.error)

Record acquisition script execution

The record was retrieved and displayed on standard output.

python3 getRec1.py
[{'Author': {'value': {'name': 'Alex2013', 'code': 'Alex2013'}, 'type': 'CREATOR'}, 'String A': {'value': 'B02A', 'type': 'SINGLE_LINE_TEXT'}, 'Creation date and time': {'value': '2017-01-26T15:47:00Z', 'type': 'CREATED_TIME'}, 'String B': {'value': 'B02B', 'type': 'SINGLE_LINE_TEXT'}, 'String 2_3': {'value': 'B02C', 'type': 'SINGLE_LINE_TEXT'}, 'changer': {'value': {'name': 'Alex2013', 'code': 'Alex2013'}, 'type': 'MODIFIER'}, 'String 2_2': {'value': 'B02B', 'type': 'SINGLE_LINE_TEXT'}, 'Record number': {'value': '2', 'type': 'RECORD_NUMBER'}, 'String 1_1': {'value': 'A02A', 'type': 'SINGLE_LINE_TEXT'}, 'Update date and time': {'value': '2017-01-26T23:49:00Z', 'type': 'UPDATED_TIME'}, 'Lookup A': {'value': 'A02', 'type': 'SINGLE_LINE_TEXT'}, 'String 1_3': {'value': 'A02C', 'type': 'SINGLE_LINE_TEXT'}, 'ID': {'value': 'jj', 'type': 'SINGLE_LINE_TEXT'}, 'String 1_4': {'value': 'A02D', 'type': 'SINGLE_LINE_TEXT'}, 'String 1_2': {'value': 'A02B', 'type': 'SINGLE_LINE_TEXT'}, '$revision': {'value': '4', 'type': '__REVISION__'}, 'String 2_4': {'value': 'B02', 'type': 'SINGLE_LINE_TEXT'}, '$id': {'value': '2', 'type': '__ID__'}, 'String C': {'value': 'B02C', 'type': 'SINGLE_LINE_TEXT'}, 'String 2_1': {'value': 'B02A', 'type': 'SINGLE_LINE_TEXT'}, 'Lookup B': {'value': 'B02', 'type': 'SINGLE_LINE_TEXT'}, 'String D': {'value': 'B02', 'type': 'SINGLE_LINE_TEXT'}}, {'Author': {'value': {'name': 'Alex2013', 'code': 'Alex2013'}, 'type': 'CREATOR'}, 'String A': {'value': 'B01A', 'type': 'SINGLE_LINE_TEXT'}, 'Creation date and time': {'value': '2017-01-26T12:06:00Z', 'type': 'CREATED_TIME'}, 'String B': {'value': 'B01B', 'type': 'SINGLE_LINE_TEXT'}, 'String 2_3': {'value': 'B01C', 'type': 'SINGLE_LINE_TEXT'}, 'changer': {'value': {'name': 'Alex2013', 'code': 'Alex2013'}, 'type': 'MODIFIER'}, 'String 2_2': {'value': 'B01B', 'type': 'SINGLE_LINE_TEXT'}, 'Record number': {'value': '1', 'type': 'RECORD_NUMBER'}, 'String 1_1': {'value': 'A01A', 'type': 'SINGLE_LINE_TEXT'}, 'Update date and time': {'value': '2017-01-26T12:06:00Z', 'type': 'UPDATED_TIME'}, 'Lookup A': {'value': 'A01', 'type': 'SINGLE_LINE_TEXT'}, 'String 1_3': {'value': 'A01C', 'type': 'SINGLE_LINE_TEXT'}, 'ID': {'value': 'C01', 'type': 'SINGLE_LINE_TEXT'}, 'String 1_4': {'value': 'A01D', 'type': 'SINGLE_LINE_TEXT'}, 'String 1_2': {'value': 'A01B', 'type': 'SINGLE_LINE_TEXT'}, '$revision': {'value': '1', 'type': '__REVISION__'}, 'String 2_4': {'value': 'B01D', 'type': 'SINGLE_LINE_TEXT'}, '$id': {'value': '1', 'type': '__ID__'}, 'String C': {'value': 'B01C', 'type': 'SINGLE_LINE_TEXT'}, 'String 2_1': {'value': 'B01A', 'type': 'SINGLE_LINE_TEXT'}, 'Lookup B': {'value': 'B01', 'type': 'SINGLE_LINE_TEXT'}, 'String D': {'value': 'B01D', 'type': 'SINGLE_LINE_TEXT'}}]

Recommended Posts

pykintone on Windows Subsystem for Linux
Windows Subsystem for Linux is not displayed
How to install Windows Subsystem For Linux
Linux (WSL) on Windows
F2py on Miniconda for Windows
Linux on Windows -1-: debian introduction
Use Linux on Windows 10 (WSL2)
When Windows Subsystem for Linux (WSL) cannot be started
Cross development environment (developing programs for windows on linux)
How to set up Ubuntu for Windows Subsystem for Linux 2 (WSL2)
Create a Linux environment on Windows 10
Comfortable LaTeX with Windows Subsystem for Linux and VS Code
Until Windows Subsystem for Linux (WSL) is installed in Windows and fish is installed
Notes for using OpenCV on Windows10 Python 3.8.3.
[UE4] Build DedicatedServer on Windows and Linux
Programming environment for beginners made on Windows
Install wsl2 and master linux on windows
[Note] Procedures for installing Ubuntu on Windows 10
Create a Linux virtual machine on Windows
Building an environment for "Tello_Video" on Windows
pykintone on Docker
Python on Windows
Put MeCab binding for Python with pip on Windows, mac and Linux
[Linux] Review of commands for deploying on AWS
A tool for creating symbolic links on Windows
Open a ZIP created on Windows in Linux
(Windows) Causes and workarounds for UnicodeEncodeError on Python 3
Run yolov4 "for the time being" on windows
Cross-compile windows version from nim on arch | linux
Organize files on Windows with Linux commands-using WSL-
Notes for using TensorFlow on Bash on Ubuntu on Windows
Installing TensorFlow on Windows Easy for Python beginners
Steps to build PyTorch 1.5 for CUDA 10.2 on Windows
When I tried to use Python on WSL (windows subsystem for linux), it got stuck in Jupyter (solved)
Daemonizing processes on Linux
Run Kali Linux on Windows with GUI (without VirtualBox)
jblas on Arch Linux
Pylint on Windows Atom
[For memo] Linux Part 2
Create a QR code for the URL on Linux
Build a Python extension for E-Cell 4 on Windows 7 (64bit)
[Heroku] Memo for deploying Python apps using Heroku on Windows [Python]
Use pyvenv on Windows
Linux, Windows proxy settings
Create an environment for MkDocs on Amazon Linux (attempted)
Anaconda on Windows Terminal
Install Anaconda on Windows 10
PIL with Python on Windows 8 (for Google App Engine)
Install python on windows
Develop .NET on Linux
Wake on lan on Linux
Procedure for building a CDK environment on Windows (Python)
What is Linux for?
Install pycuda on Windows10
Linux command for self-collection
Compile and install MySQL-python for python2.7 on amazon linux
Build TensorFlow on Windows
Monitor traffic on Linux
Install procs, an alternative tool for ps, on Linux (also available on Mac and Windows)
Build XGBoost on Windows
Install pygraphviz on Windows 10