An Introduction to Kodou

Kodou eliminates the multiple stages of software development so your ideas turn into live code.

The steps to using Kodou once you sign up are

  • Get your API key
  • Select a function
  • Call live functions via the API

Kodou App

app.kodou.io, is where you find your API key in the API panel. The Search panel lets you describe the code you want as search terms and select a result. Or skip that step when you want to specify the set of dependencies for a language environment (i.e., Pypi/Python or Maven/Java).

The App: https://app.kodou.io

Use your favorite IDE to make calls to live functions at https://api.kodou.io. For example, Visual Studio Code has a REST client extension and IntelliJ has a built-in REST client. Or keep it on the command line with curl to feel like a scripting environment.

Here is an example of making Numpy (Python) function calls.

# Numpy Setup
# @name setupNumpy
POST https://api.kodou.io/environment/python/setup?jwt={{jwtToken}} Http/1.1
Content-Type: application/json

{
    "version": "3",
    "dependencies": ["numpy", "requests"]
}

###

# Numpy Call
# @name numpyArraySum
POST https://api.kodou.io/environment/call?jwt={{jwtToken}} Http/1.1
Content-Type: application/json

{
    "sessionid" : "{{setupNumpy.response.body.$.sessionid}}",
    "timeout" : "20000",
    "namepath" : [ {"moduleName":"numpy"}, {"name":"array", "args": [ [2,4,6] ]}, {"name": "sum"} ],
    "args" : []
}

Komposers

Kodou users can share and highlight their solutions on our Komposer network.

If you are an Airtable user and want to use a Kodou function that converts webform fields into Airtable columns you can do the following. A Komposer created a Java function that transforms form fields into the correct type for the Airtable columns. This is just one possible encoding scheme.

The Kodou setup call encodes the Airtable keys within the resulting sessionid (JWT token). Of course, this is just one way of managing the state.

# Kodou ICE setup
# Bind Airtable access keys as session arguments.
#
# Airtable api_id and api_key are encoded within and bound to the returned sessionid
# Airtable baseTable is also bound to the table name
#
# The ICE is a function named addFormXXJsonToAirtable that converts from Json of a web form
# to an Airtable 
# @name setupAirtableSessionArgs
POST https://api.kodou.io/kodou/library/setup?jwt={{jwtToken}} Http/1.1
Content-Type: application/json

{
    "bind-session-arg-names": {
        "api_id" : "{{airtableAPIID}}",
        "api_key" : "{{airtableAPIKey}}",
        "baseTable" : "NameAgeGender"
    },

    "repoSourceURL" : "https://github.com/yvesnyc/kodou_io_maven_airtable.git",
    "repositoryHash" : "2299480333fdc61ec1241fb04afc5789f2f38302",
    "fullFileName" : "com.yvesnyc.App",
    "name" : "addFormXXJsonToAirtable",
    "startLine" : 325
}

###

# Use a Web Form with the sessionid as a hidden field. 
# The normal fields are have type coded names as defined by addFormXXJsonToAirtable
# Below is the equivalent http request 
#
# Kodou callhttp 
# Make a form-urlencoded call using the sessionid from Setup call
# @name airtable1
POST https://api.kodou.io/library/callhttp?jwt={{jwtToken}}
Content-Type: application/x-www-form-urlencoded

sessionid={{setupAirtableSessionArgs.response.body.$.sessionid}}
&formAs=jsonstring
&ss_Name=Pam
&sn_Age=60
&ms_Gender=Female

You can test the Kodou code using API calls. In this case, it would be used in a web form like below where the action URL for the button is the Kodou API.

Web form in Webflow using api.kodou.io as the button action

The addFormXXJsonToAirtable function expects the form's hidden fields to hold session information and whether to package the fields as a JSON string. The HTML code below is held in a Webflow HTML Embed element in the form.

<input type="hidden" name="sessionid" value="eyJXXXXXXXX" />
<input type="hidden" name="formAs" value="jsonstring" />

Try it out. The responses are on the scale of milliseconds.

Yves Jean

Founder/CEO of kodou.io, ex-Bell-labs scientist, Computer Vision systems, Columbia BS/Georgia Tech PhD, natural born hacker.

More of our stories from

Product
An Introduction to Kodou

An introduction with examples of using Kodou in different ways.

Read more...
Moving Beyond the Programming Classics

Defining and motivating the need for no-code software. Offering Kodou as a platform that exceeds the requirements..

Read more...
Hello from Kodou!

A welcome to Kodou

Read more...

All Topics