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)
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.
fixUse '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(...)'.
fixEnsure you call the class, not the module: 'RemoteLRS(...)' or 'tincan.RemoteLRS(...)'.
requests.exceptions.ConnectionError: ...
Invalid endpoint URL or network issue when saving a statement.
fixVerify 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.