{"id":28376,"library":"tencentcloud-sdk-python-waf","title":"Tencent Cloud WAF SDK for Python","description":"Official Tencent Cloud SDK for the Web Application Firewall (WAF) service. Current version 3.1.91. Released frequently as part of the tencentcloud-sdk-python monorepo.","status":"active","version":"3.1.91","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencentcloud","waf","sdk","cloud"],"install":[{"cmd":"pip install tencentcloud-sdk-python-waf","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for authentication and HTTP transport","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"Versioned import (v20180125) is required; top-level import fails.","wrong":"from tencentcloud.waf import WafClient","symbol":"WafClient","correct":"from tencentcloud.waf.v20180125 import waf_client, models"}],"quickstart":{"code":"import os\nfrom tencentcloud.common import credential\nfrom tencentcloud.waf.v20180125 import waf_client, models\n\ncred = credential.Credential(\n    os.environ.get('TENCENTCLOUD_SECRET_ID', ''),\n    os.environ.get('TENCENTCLOUD_SECRET_KEY', '')\n)\nclient = waf_client.WafClient(cred, \"ap-guangzhou\")\nreq = models.DescribeWafInfoRequest()\nresp = client.DescribeWafInfo(req)\nprint(resp.to_json_string())","lang":"python","description":"Initialize WAF client and call DescribeWafInfo. Replace region as needed."},"warnings":[{"fix":"Use versioned import: from tencentcloud.waf.v20180125 import waf_client, models","message":"Version 3.x changes all imports to date-based subpackages (e.g., v20180125). Direct imports like 'from tencentcloud.waf import WafClient' will fail.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Run: pip install tencentcloud-sdk-python-common","message":"The SDK does not install its common dependency automatically when using the per-service package. Must install tencentcloud-sdk-python-common separately.","severity":"gotcha","affected_versions":"all"},{"fix":"Use v20180125 for all new development.","message":"The older v20180419 API version is deprecated. New projects should use v20180125.","severity":"deprecated","affected_versions":"<3.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install both: pip install tencentcloud-sdk-python-waf tencentcloud-sdk-python-common","cause":"The per-service package tencentcloud-sdk-python-waf was not installed, or common module is missing.","error":"ModuleNotFoundError: No module named 'tencentcloud.waf'"},{"fix":"Use from tencentcloud.waf.v20180125 import waf_client","cause":"Direct import from tencentcloud.waf does not expose WafClient; versioned subpackage is required.","error":"AttributeError: module 'tencentcloud.waf' has no attribute 'WafClient'"},{"fix":"Use a valid region like 'ap-guangzhou', 'ap-shanghai', etc. Check Tencent Cloud docs.","cause":"Region string is invalid or not supported by WAF service.","error":"tencentcloud.common.exception.TencentCloudSDKException: UnsupportedRegion"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}