Registry / communication / tincan

tincan

JSON →
library1.0.0pypypi✓ verified 85d ago

A Python library for implementing the Tin Can API (Experience API / xAPI), used for tracking learning experiences. Current version 1.0.0. Release cadence is low; no active development observed since initial release.

pip install tincan
INSTALL
IMPORT
SIG · TINCAN
T
tincan
communicationpythonv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RemoteLRS
from tincan import RemoteLRS
Statement
from tincan import Statement
Agent
from tincan import Agent
Activity
from tincan import Activity

Basic usage: configure LRS, create a statement, and save it.

from tincan import RemoteLRS, Statement, Agent, Activity # Configure Remote LRS connection lrs = RemoteLRS( endpoint='https://example.com/lrs', username='', password='' ) # Create a statement agent = Agent(name='John Doe', mbox='mailto:john@example.com') activity = Activity(id='http://example.com/activity', definition={'name': {'en-US': 'Test Activity'}}) statement = Statement(actor=agent, verb={"id": "http://adlnet.gov/expapi/verbs/experienced", "display": {"en-US": "experienced"}}, object=activity) # Send statement response = lrs.save_statement(statement) print(response)
Debug
Known issues
gotchaThe library uses a custom JSON serialization for statements. When constructing verbs and activities, ensure you follow the exact object structure (e.g., verb must have 'id' and 'display' keys).
fix
Use dictionaries with required keys as shown in the quickstart.
affects: >=1.0.0
gotchaRemoteLRS does not verify the connection or credentials until you actually send a statement. You'll get an error only at save_statement time.
fix
Wrap calls in try/except and check for exceptions.
affects: >=1.0.0
gotchaThe library may not support all xAPI extensions out of the box; custom extensions require manual construction.
fix
Refer to xAPI spec and build extensions as nested dicts.
affects: >=1.0.0
Errors
Common errors & fixes
NameError: name 'RemoteLRS' is not defined
Importing incorrectly, e.g., 'import tincan' then using tincan.RemoteLRS without dot access or missing import.
fix
Use 'from tincan import RemoteLRS' or 'import tincan' then 'tincan.RemoteLRS'.
TypeError: 'module' object is not callable
Trying to instantiate the module itself, e.g., 'tincan(...)' instead of 'tincan.RemoteLRS(...)'.
fix
Ensure you call the class, not the module: 'RemoteLRS(...)' or 'tincan.RemoteLRS(...)'.
requests.exceptions.ConnectionError: ...
Invalid endpoint URL or network issue when saving a statement.
fix
Verify the LRS endpoint URL and network connectivity. Check if authentication is required.
Upgrade
Version history
1.0.0latest on PyPI · released Sep 3, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
32
OpenAI (training)
1
Resources
tincan — pip install tincan · libregistry