{"id":21120,"library":"demisto-sdk","title":"Demisto SDK","description":"A Python library for developing, testing, and managing Cortex XSOAR content. Version 1.38.24 supports Python 3.9-3.12. Released approximately monthly.","status":"active","version":"1.38.24","language":"python","source_language":"en","source_url":"https://github.com/demisto/demisto-sdk","tags":["demisto","xsoar","cortex","sdk","security","automation"],"install":[{"cmd":"pip install demisto-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Common mistake: wrong class name","wrong":"from demisto_sdk import SDK","symbol":"DemistoSDK","correct":"from demisto_sdk import DemistoSDK"},{"note":"run_command is not at top level","wrong":"from demisto_sdk import run_command","symbol":"run_command","correct":"from demisto_sdk.commands.common.tools import run_command"}],"quickstart":{"code":"from demisto_sdk import DemistoSDK\nimport os\n\napi_key = os.environ.get('DEMISTO_API_KEY', '')\nbase_url = os.environ.get('DEMISTO_BASE_URL', 'https://api.demisto.com')\nsdk = DemistoSDK(api_key=api_key, base_url=base_url)\n# Example: validate content\nsdk.content_validate()","lang":"python","description":"Initialize DemistoSDK with API key and base URL, then run a content validation."},"warnings":[{"fix":"Use `from demisto_sdk import DemistoSDK`","message":"In v1.16.0, the DemistoSDK class moved from `demisto_sdk` to `demisto_sdk.__main__`. Import from `demisto_sdk` directly going forward.","severity":"breaking","affected_versions":"<1.16.0"},{"fix":"Use `--previous-version` instead","message":"The `validate` command's `--prev-ver` flag is deprecated in favor of `--previous-version`.","severity":"deprecated","affected_versions":">=1.30.0"},{"fix":"Use environment variables or a secrets manager.","message":"API keys should be stored securely. The SDK does not encrypt keys; avoid hardcoding.","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":"Install with `pip install demisto-sdk` but import with `import demisto_sdk` (underscore).","cause":"The package is installed but the import path is misspelled (underscore vs hyphen).","error":"ModuleNotFoundError: No module named 'demisto_sdk'"},{"fix":"Use `from demisto_sdk.commands.common.tools import run_command`.","cause":"Trying to import run_command from the top-level module instead of the correct submodule.","error":"AttributeError: module 'demisto_sdk' has no attribute 'run_command'"},{"fix":"Ensure DEMISTO_API_KEY environment variable is set or pass the correct key to DemistoSDK.","cause":"API key is missing or incorrect.","error":"ValueError: Invalid API key"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}