{"id":27456,"library":"tincan","title":"TinCan Python","description":"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.","status":"active","version":"1.0.0","language":"python","source_language":"en","source_url":"https://github.com/RusticiSoftware/TinCanPython","tags":["xapi","tincan","learning","lrs"],"install":[{"cmd":"pip install tincan","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"RemoteLRS","correct":"from tincan import RemoteLRS"},{"note":"","wrong":"","symbol":"Statement","correct":"from tincan import Statement"},{"note":"","wrong":"","symbol":"Agent","correct":"from tincan import Agent"},{"note":"","wrong":"","symbol":"Activity","correct":"from tincan import Activity"}],"quickstart":{"code":"from tincan import RemoteLRS, Statement, Agent, Activity\n\n# Configure Remote LRS connection\nlrs = RemoteLRS(\n    endpoint='https://example.com/lrs',\n    username='',\n    password=''\n)\n\n# Create a statement\nagent = Agent(name='John Doe', mbox='mailto:john@example.com')\nactivity = Activity(id='http://example.com/activity', definition={'name': {'en-US': 'Test Activity'}})\nstatement = Statement(actor=agent, verb={\"id\": \"http://adlnet.gov/expapi/verbs/experienced\", \"display\": {\"en-US\": \"experienced\"}}, object=activity)\n\n# Send statement\nresponse = lrs.save_statement(statement)\nprint(response)\n","lang":"python","description":"Basic usage: configure LRS, create a statement, and save it."},"warnings":[{"fix":"Use dictionaries with required keys as shown in the quickstart.","message":"The 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).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Wrap calls in try/except and check for exceptions.","message":"RemoteLRS does not verify the connection or credentials until you actually send a statement. You'll get an error only at save_statement time.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Refer to xAPI spec and build extensions as nested dicts.","message":"The library may not support all xAPI extensions out of the box; custom extensions require manual construction.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from tincan import RemoteLRS' or 'import tincan' then 'tincan.RemoteLRS'.","cause":"Importing incorrectly, e.g., 'import tincan' then using tincan.RemoteLRS without dot access or missing import.","error":"NameError: name 'RemoteLRS' is not defined"},{"fix":"Ensure you call the class, not the module: 'RemoteLRS(...)' or 'tincan.RemoteLRS(...)'.","cause":"Trying to instantiate the module itself, e.g., 'tincan(...)' instead of 'tincan.RemoteLRS(...)'.","error":"TypeError: 'module' object is not callable"},{"fix":"Verify the LRS endpoint URL and network connectivity. Check if authentication is required.","cause":"Invalid endpoint URL or network issue when saving a statement.","error":"requests.exceptions.ConnectionError: ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}