{"id":27482,"library":"twilio-stubs","title":"Twilio Stubs","description":"twilio-stubs is an unofficial package providing type declarations (PEP 561 stub files) for the Twilio API. Version 0.2.0 is current. The project is actively maintained, with infrequent releases.","status":"active","version":"0.2.0","language":"python","source_language":"en","source_url":"https://github.com/timmartin/twilio-stubs","tags":["twilio","stubs","types","type-hints","mypy"],"install":[{"cmd":"pip install twilio-stubs","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Runtime dependency: the types are for the twilio package.","package":"twilio","optional":false}],"imports":[{"note":"twilio-stubs provides types for the public twilio.rest.Client; no special import needed.","wrong":"","symbol":"twilio-rest-stubs","correct":"from twilio.rest import Client"}],"quickstart":{"code":"from twilio.rest import Client\n\naccount_sid = os.environ.get('TWILIO_ACCOUNT_SID', '')\nauth_token = os.environ.get('TWILIO_AUTH_TOKEN', '')\nclient = Client(account_sid, auth_token)\nmessage = client.messages.create(body='Hello from mypy!', from_='+15017122661', to='+15558675310')\nprint(f'Message sent: {message.sid}')","lang":"python","description":"Basic usage: type-checked Twilio client with twilio-stubs."},"warnings":[{"fix":"Use inline type comments or 'Any' for uncovered parts, or contribute stubs upstream.","message":"twilio-stubs provides types only for the REST API (twilio.rest). Other Twilio modules (e.g., TwiML, TaskRouter) may lack stubs.","severity":"gotcha","affected_versions":"all"},{"fix":"Pin twilio to a version compatible with the stubs (check twilio-stubs PyPI classifiers).","message":"Types are based on the twilio Python helper library (version 6.x/7.x). If you use an older or newer major version, type mismatches may occur.","severity":"deprecated","affected_versions":">7.0"},{"fix":"Watch for upstream twilio-stubs releases; consider contributing or using 'type: ignore' in checks.","message":"Twilio-stubs is a third-party package, not maintained by Twilio. Updates may lag behind the official library releases.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure you have twilio-stubs installed alongside twilio. Note that twilio-stubs only covers twilio.rest.","cause":"Missing twilio runtime dependency installed but stubs are missing types for other modules.","error":"Module 'twilio' has no attribute 'rest'"},{"fix":"Run 'pip install --upgrade twilio-stubs' and clear mypy cache: 'mypy --cache-dir /dev/null .'","cause":"Type checker may not resolve stub files if package is not in site-packages or mypy cache is stale.","error":"Cannot find reference 'Client' in 'twilio.rest'"},{"fix":"Remove the '# type: ignore' comment and update mypy configuration if needed.","cause":"Using '# type: ignore' in code that twilio-stubs now covers.","error":"Unused type: ignore comment"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}