{"id":27737,"library":"fathom-python","title":"Fathom Python SDK","description":"Official Python SDK for Fathom Analytics, providing a simple interface to record page views, events, and goals via the Fathom API. Current version 0.0.37, actively maintained with irregular releases.","status":"active","version":"0.0.37","language":"python","source_language":"en","source_url":"https://github.com/usefathom/fathom-python","tags":["analytics","fathom","sdk"],"install":[{"cmd":"pip install fathom-python","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false}],"imports":[{"note":"The package installs as 'fathom', not 'fathom_python'.","wrong":"from fathom_python import FathomClient","symbol":"FathomClient","correct":"from fathom import FathomClient"},{"note":"Direct import of the module gives you the module object, not the class.","wrong":"import fathom","symbol":"FathomClient","correct":"from fathom import FathomClient"}],"quickstart":{"code":"from fathom import FathomClient\n\nclient = FathomClient(\n    api_token=os.environ.get('FATHOM_API_TOKEN', ''),\n    site_id=os.environ.get('FATHOM_SITE_ID', '')\n)\n\n# Record a page view\nresponse = client.pageview(\n    url='https://example.com/page',\n    referrer='https://example.com/other'\n)\nprint(response)","lang":"python","description":"Initialize the client with your API token and site ID, then record a page view."},"warnings":[{"fix":"Always provide the full URL (e.g., 'https://example.com/page').","message":"In version 0.0.30 the 'pageview' method signature changed: 'hostname' parameter was removed and 'url' is now required to be a full URL including protocol. Older versions expected just a path.","severity":"breaking","affected_versions":">=0.0.30"},{"fix":"Replace client.event(name=..., url=...) with client.goal(goal_id=..., url=...).","message":"The 'event' method is deprecated since 0.0.35. Use 'goal' instead for recording custom goals.","severity":"deprecated","affected_versions":">=0.0.35"},{"fix":"Use requests.Session with retries or a library like tenacity.","message":"The library does not automatically retry on rate limits or network errors. You must wrap calls in your own retry logic.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use 'from fathom import FathomClient'.","cause":"Using 'import fathom' instead of 'from fathom import FathomClient'.","error":"AttributeError: module 'fathom' has no attribute 'FathomClient'"},{"fix":"client = FathomClient(api_token='...', site_id='...')","cause":"Creating FathomClient without required arguments.","error":"TypeError: __init__() missing 2 required positional arguments: 'api_token' and 'site_id'"},{"fix":"Generate a new API token in your Fathom dashboard and update your code.","cause":"Invalid or expired API token.","error":"fathom.exceptions.FathomHTTPError: 401 Unauthorized"},{"fix":"Add retry logic (e.g., with requests.adapters.HTTPAdapter(max_retries=3)).","cause":"Network connectivity issue or Fathom API is down. The SDK does not retry automatically.","error":"requests.exceptions.ConnectionError: HTTPSConnectionPool ... Max retries exceeded"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}