[PYTHON] kintone x Easy business card management realized by machine learning @kintone Café

System to make this time

The system created this time is a system that uploads a business card image to Slack, extracts information from the business card using Google's Vision API and Natural Language API, and registers it in kintone. The overall picture is as follows. スクリーンショット 2016-11-09 16.01.05.png

Advance preparation

This hands-on is a combination of three services and the programming language Python. For that purpose, please make the following preparations.

Get a kintone account

You need kintone to create the app. If you do not have an account, please create one. https://kintone.cybozu.com/jp/

Register with Slack

This time we will create a bot on Slack. So if you don't have a Slack account, create one below. https://slack.com/

Please set the team name etc. to Yoshina.

Python installation

Programming with Python is performed to link various services. Please download and install Python 3.5.2 from the link below. https://www.python.org/downloads/

Register with Google Cloud Platform (GCP) and get an API key

This time, we will use the GCP services Vision API and Natural Language API. For that, please register with GCP and get an API key.

Register with GCP

First of all, please register for GCP from the link below. https://cloud.google.com/

Please note that you will be prompted for your credit card number </ font> when registering. However, the Vision API and Natural Language API are free up to 1000 and 5000 times use </ font>, respectively, so you will not be charged.

Get API key

Create a project

After logging in to GCP, first click on the "Create Project" section in the upper left. スクリーンショット 2016-11-09 12.56.30.png

A form will appear for you to create a new project. Here, enter the project name you like and click the "Create" button. スクリーンショット 2016-11-09 12.58.26.png

Enable Cloud Vision API

In the created project, we will enable it so that the desired "Cloud Vision API" can be used. First, click the menu button in the upper left and select "API Manager" in it. スクリーンショット 2016-11-09 13.28.11.png

Select "Library" to move to the API list screen provided by Google. Search for "vision" in the search form and select the Google Cloud Vision API that appears. スクリーンショット 2016-11-09 13.30.33.png

Go to the "Cloud Vision API" screen. Next to the title, there is a button to enable / disable, so please enable it. スクリーンショット 2016-11-09 13.32.34.png

If you've just created a project, you'll probably see an alert that says "Proceed to credentials", as you haven't set any authentication methods yet. In that case, select "Proceed to Credentials". スクリーンショット 2016-11-09 13.34.48.png

The "Add Credentials to Project" screen is displayed. Select "Cloud Vision API" for "Required credentials", select "No" for "Do you want to use Google App Engine or Google Compute Engine?", And select "Required credentials". Click the "" button. スクリーンショット 2016-11-09 13.37.26.png

Select "Service Account Name", "Key Type", and "Role" and click "Next". A service account is an "account for using the API", and a "key" is a file that contains information for authenticating with that account. In this article, we will not use a service account because we will explain using API key authentication. スクリーンショット 2016-11-09 13.38.49.png

Create an API key

Next, let's create an API key to be used for authentication. Select "Create Credentials" from "Credentials" in "API Manager". Then, the API key is displayed, so select it. スクリーンショット 2016-11-09 13.41.39.png

Make a note of the API key as it will complete the creation. You can close it after making a note, but make sure that the ** API key is never leaked to others. </ font> ** スクリーンショット 2016-11-09 13.46.00.png

Enable the Natural Language API

Please enable it in the same way as the Cloud Vision API. You don't have to create a project.

Article summary

The contents of this hands-on are summarized in three articles.