Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install pycogworks

How to install PyCogWorks

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install pycogworks
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2.0
0.3.1Never BuiltWhy not?
0.2.0 Available View build log
Windows (64-bit)
0.2.0
0.3.1Never BuiltWhy not?
0.2.0 Available View build log
Mac OS X (10.5+)
0.2.0
0.3.1Never BuiltWhy not?
0.2.0 Available View build log
Linux (32-bit)
0.2.0
0.3.1Never BuiltWhy not?
0.2.0 Available View build log
Linux (64-bit)
0.2.0
0.3.1 Failed View build log
0.2.0 Available View build log
 
Author
License
GPL-3
Imports
Lastest release
version 0.3.1 on Jan 9th, 2014

pycogworks is a Python package with miscellaneous functions used in the CogWorks lab.

Installation

pycogworks can be installed using 'pip'.

# pip install pycogworks

Dependencies

pycogworks has the following dependencies:

GUI Functions

pycogworks.getSubjectInfo

Creates a GUI dialog to collect subject information. The default dialog collects subjects first name, last name and RIN. Additional fields can be collected by passing an array of field names to getSubjectInfo. getSubjectInfo returns a dict of subject information where the keys are the field names converted to lower case and spaces replaced with underscores. The RIN field is automatically encrypted using pycogworks.rin2id and stored in the 'encrypted_rin' field.

>>> getSubjectInfo(["Age"])
{'rin': u'123456789', 'first_name': u'Foo', 'last_name': u'Bar', 'age': u'18'}
http://ompldr.org/vZm5ldw

Logging Functions

pycogworks.getDateTimeStamp

Returns the most accurate timestamp possible for the current OS.

>>> get_time()
1348684540.905437
pycogworks.getDateTimeStamp

Generates a date/time stamp usefull in logs and for log filenames.

>>> getDateTimeStamp()
'2012-9-26_13-33-6'
pycogworks.rin2id

Generates an encrypted id from a 9 digit RIN.

>>> rin2id(123456789)
'300fe9abdca99d4a32cb2c43f2a69c5c'
>>> rin2id('123456789')
'300fe9abdca99d4a32cb2c43f2a69c5c'
pycogworks.writeHistoryFile

Takes a dict of subject information and writes a history file. The subject information dict must contain a field called 'rin' with a value that contains a valid 9 digit RIN. If the subject information dict does not already contain an 'encrypted_rin' field, the RIN will be enrypted and added to the subject information dict under the field 'encrypted_rin'. The subject information dict is then encoded as a JSON string and written to a file.

>>> writeHistoryFile("test.history",{"foo":"bar","rin":"123456789"})
# cat test.history
{
  "cipher": "AES/CBC (RIJNDAEL) - 16Byte Key",
  "encrypted_rin": "300fe9abdca99d4a32cb2c43f2a69c5c",
  "foo": "bar",
  "rin": "123456789"
}

Subscribe to package updates

Last updated Jan 9th, 2014

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.