Registry / serialization / edx-tincan-py35

edx-tincan-py35

JSON →
library2.0.0pypypi✓ verified 86d ago

A Python 3 library for implementing the Tin Can API (Experience API). Version 2.0.0 is released with basic support for creating and sending statements. Low activity; last release in 2016. Use with caution as it appears to be in maintenance mode.

pip install edx-tincan-py35
INSTALL
IMPORT
SIG · EDX-TINCAN-PY35
E
edx-tincan-py35
serializationpythonv2.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

Create and send a simple Tin Can statement to a remote LRS.

from tincan import RemoteLRS, Statement, Agent, Activity lrs = RemoteLRS( endpoint='https://example.com/xapi/', username='user', password='pass' ) agent = Agent(name='Test User', mbox='mailto:test@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 ) response = lrs.save_statement(statement) print(response.data)
Debug
Known issues
gotchaLibrary name: edx-tincan-py35 but the Python package import is `tincan`. Many users mistakenly try to import `edx_tincan_py35` which does not work.
fix
Use `import tincan` (or `from tincan import ...`)
affects: all
deprecatedThe library is not actively maintained; last release in 2016. It may not work with Python 3.6+ without patches.
fix
Consider using modern alternatives like `xapi-python` or `tincanpython` if you need active support.
affects: >=2.0.0
gotchaThe library does not support Python 2.x but the name suggests py35. It only supports Python 3.4 and 3.5. In Python 3.6+ some features like `OrderedDict` usage may break.
fix
Use Python 3.4 or 3.5 explicitly, or upgrade to a maintained fork.
affects: 2.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'edx_tincan_py35'
Package name in pip is 'edx-tincan-py35', but the import namespace is 'tincan'.
fix
Use import tincan or from tincan import ...
ImportError: No module named 'tincan'
Package not installed or installed in wrong environment.
fix
Run 'pip install edx-tincan-py35' and ensure the environment is Python 3.5 or compatible.
TypeError: __init__() got an unexpected keyword argument 'definition'
In older versions of the library, Activity's definition may be passed differently. In v2.0.0, definition is a dict, not a separate object.
fix
Use correct constructor: Activity(id='...', definition={'name': {'en-US': '...'}})
Upgrade
Version history
2.0.0latest on PyPI · released Jan 17, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
edx-tincan-py35 — pip install edx-tincan-py35 · libregistry