Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.
/ pycept Public archive

Cept API client in python

License

Notifications You must be signed in to change notification settings

numenta/pycept

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pycept Build Status Coverage Status PyPi version

A python client for the CEPT API

This is a very minimal HTTP client library for the CEPT API.

CEPT Account

Get CEPT API credentials here. This will give you a free trail.

Installation

python setup.py install

Usage

Retrieve SDR string for term

import pycept
ceptClient = pycept.Cept("your_api_key")
catSdr = ceptClient.getSdr("cat")

Retrieve bitmap representation of SDR for term

catBitmap = ceptClient.getBitmap("cat")

Convert bitmap SDR to closest terms

similarTerms = ceptClient.bitmapToTerms(
  catBitmap['width'], 
  catBitmap['height'], 
  catBitmap['positions']
)

Caching

To prevent duplicate requests to the CEPT API, pycept will cache SDR responses by default to /tmp/pycept. You can provide your own cache directory location by specifying a cache_dir value to the constructor:

pycept.Cept("your_api_key", cache_dir="./my-cache")

Run Tests

nosetests