This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

keiko is Python and Web API clients for Keiko-chan.

Installation

keiko can be installed via pip or easy_install:

$ pip install keiko

Or:

$ easy_install keiko

Usage

Firstly, setup Keiko-chan and assign IP address.

Python

Specify the address of Keiko-chan and instantiate the client:

>>> import keiko
>>> address = '192.168.1.2'  # example address of Keiko-chan
>>> client = keiko.Client(address)

Control the lamps:

>>> client.lamps.green.on()  # turns on the lamp
>>> client.lamps.green.status
'on'
>>> client.lamps.green.off()  # turns off the lamp
>>> client.lamps.green.status
'off'
>>> client.lamps.yellow.blink()  # blinks the lamp
>>> client.lamps.yellow.status
'blink'
>>> client.lamps.red.quickblink()  # blinks the lamp quickly
>>> client.lamps.red.status
'quickblink'
>>> client.lamps.off()  # turns off the all lamps

With delay and duration time:

>>> client.lamps.red.on(wait=2, time=4)  # wait 2 second, light 4 seconds

Control the buzzer:

>>> client.buzzer.on()  # turns on the buzzer
>>> client.buzzer.status
'continuous'
>>> client.buzzer.off()  # turns off the buzzer
>>> client.buzzer.status
'off'

Control the direct inputs and outputs:

>>> client.di.status
{1: 'off', 2: 'off', 3: 'off', 4: 'off'}
>>> client.do.status
{1: 'off', 2: 'off', 3: 'off', 4: 'off'}
>>> client.do(2).on()
>>> client.do(2).status
'on'
>>> client.do.status
{1: 'off', 2: 'on', 3: 'off', 4: 'off'}

Control the voices:

>>> client.voices.status
'stop'
>>> client.voices(1).play()  # plays #1 voice
>>> client.voices.stop()  # stops the voice
>>> client.voices(5).play(3)  # plays #5 voice 3 times
>>> client.voices.stop()
>>> client.voices(10).repeat()  # plays #10 voice repeatedly
>>> client.voices.stop()

Web API

Specify the address of Keiko-chan and run Web API server:

$ keiko 192.168.1.2
 * Running on http://127.0.0.1:8080/

Pass optional parameters to the server:

$ keiko 192.168.1.2 --server myhost:5000
 * Running on http://myhost:5000/

Control the lamps:

$ curl http://127.0.0.1:8080/lamps
{
  "lamps": {
    "green": "off",
    "red": "off",
    "yellow": "off"
  }
}

$ curl http://127.0.0.1:8080/lamps/green/on
{
  "result": "success"
}

$ curl http://127.0.0.1:8080/lamps/green
{
  "lamps": {
    "green": "on"
  }
}

With delay and duration time:

$ curl http://127.0.0.1:8080/lamps/yellow/on?wait=2&time=4
{
  "result": "success"
}

Control the buzzer:

$ curl http://127.0.0.1:8080/buzzer
{
  "buzzer": "off"
}

$ curl http://127.0.0.1:8080/buzzer/on
{
  "result": "success"
}

Control the direct inputs and outputs:

$ curl http://127.0.0.1:8080/di
{
  "di": {
    "1": "off",
    "2": "off",
    "3": "off",
    "4": "off"
  }
}

$ curl http://127.0.0.1:8080/do
{
  "do": {
    "1": "off",
    "2": "off",
    "3": "off",
    "4": "off"
  }
}

$ curl http://127.0.0.1:8080/do/2/on
{
  "result": "success"
}

Control the voices:

$ curl http://127.0.0.1:8080/voices
{
  "voices": "stop"
}

$ curl http://127.0.0.1:8080/voices/10/play
{
  "result": "success"
}

Caveats

This module is unofficial and tested with only Keiko-chan 4G+ (DN-1510GL) yet. For more details, see the official documentation.

Release History

Release History

0.2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
keiko-0.2.0.tar.gz (11.2 kB) Copy SHA256 Checksum SHA256 Source Sep 27, 2013
keiko-0.2.0.zip (17.4 kB) Copy SHA256 Checksum SHA256 Source Sep 27, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting