{"id":19925635,"url":"https://github.com/paloaltonetworks/cortex-xpanse-python-sdk","last_synced_at":"2025-05-03T08:31:15.275Z","repository":{"id":40556961,"uuid":"395026022","full_name":"PaloAltoNetworks/cortex-xpanse-python-sdk","owner":"PaloAltoNetworks","description":"Python SDK for Cortex™ Xpanse","archived":false,"fork":false,"pushed_at":"2023-08-08T19:21:56.000Z","size":2772,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-10-13T23:47:33.349Z","etag":null,"topics":["api","cortex","python3","sdk","sdk-python","xpanse"],"latest_commit_sha":null,"homepage":"https://cortex-xpanse-python-sdk.readthedocs.io/en/latest/xpanse.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaloAltoNetworks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-11T14:57:11.000Z","updated_at":"2021-12-01T00:48:46.000Z","dependencies_parsed_at":"2022-08-09T23:00:48.689Z","dependency_job_id":null,"html_url":"https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaloAltoNetworks%2Fcortex-xpanse-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaloAltoNetworks%2Fcortex-xpanse-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaloAltoNetworks%2Fcortex-xpanse-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaloAltoNetworks%2Fcortex-xpanse-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaloAltoNetworks","download_url":"https://codeload.github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224356130,"owners_count":17297675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cortex","python3","sdk","sdk-python","xpanse"],"created_at":"2024-11-12T22:23:28.439Z","updated_at":"2024-11-12T22:23:29.249Z","avatar_url":"https://github.com/PaloAltoNetworks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cortex Xpanse Python SDK\n========================\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://expanse.co/\"\u003e\n        \u003cimg src=\"https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/blob/main/docs/_source/_static/xpanse_banner.png?raw=true\"/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/psf/black\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.python.org/pypi/xpanse\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blueviolet\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/l/xpanse\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/graphs/contributors\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/contributors/PaloAltoNetworks/cortex-xpanse-python-sdk\"/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nOverview\n--------\n\nThis library is intended to be an interface to the\n\u003ca href=\"https://docs-cortex.paloaltonetworks.com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference\"\u003eCortex Xpanse Public API\u003c/a\u003e.\n\nInstall\n-------\n```python\npip install xpanse\n```\n\nRequirements\n------------\n\n`Python 3.7+`\n\nUsage\n-----\n\u003ca href=\"https://cortex-xpanse-python-sdk.readthedocs.io/en/latest/\"\u003eCortex Xpanse Public API Documentation\u003c/a\u003e\n\n```python\n# Import client\nfrom xpanse.client import XpanseClient\n\n# Initialize client\nclient = XpanseClient()\n\n# Get assets iterator object and dump to a list\nassets = client.assets.list().dump()\n```\n\nYou can view more example code in the \u003ca href=\"https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/tree/main/examples\"\u003eexamples\u003c/a\u003e directory.\n\nConfiguration\n-------------\nA valid `API Key`, `API Key ID`, and `Fully Qualified Domain Name (FQDN)` are required for use.\n\nReference the docs for more information with \u003ca href=\"https://docs-cortex.paloaltonetworks.com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference/Get-Started-with-APIs\"\u003eGetting Started\u003c/a\u003e.\n\n#### RECOMMENDED\n***********\nYou can supply them as environment variables.\n\n```shell script\nexport CORTEX_FQDN=\u003cYour Xpanse Instance URL\u003e\nexport CORTEX_API_KEY=\u003cAPI Key\u003e\nexport CORTEX_API_KEY_ID=\u003cAPI Key ID\u003e\n```\n    \n#### NOT RECOMMENDED\n***************\nThe following parameters can be set inline using the `XpanseClient` constructor.\n\n_This is not recommended, as it easily exposes sensitive credentials in your source code._ \n\n```python\n# Import client\nfrom xpanse.client import XpanseClient\n\n# Initialize client - THIS IS NOT RECOMMENDED, SET ENVIRONMENT VARIABLES INSTEAD\nclient = XpanseClient(url=\"https://my-company.crtx.us.paloaltonetworks.com\",\n                      api_key=\"xxxxxxxxxxxxxxxApiKeyxxxxxxxxxxxxxxx\",\n                      api_key_id=1)\n```\n\nLogging\n-------\nLogging is handled through the python logging package. To enable different levels of verbosity in your scripts you can do the following:\n\n```python\nimport logging\n\n# Set the logging level\nlogging.basicConfig(level=logging.DEBUG)\n```\n\nYou can read more at \u003chttps://docs.python.org/3/library/logging.html\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaloaltonetworks%2Fcortex-xpanse-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaloaltonetworks%2Fcortex-xpanse-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaloaltonetworks%2Fcortex-xpanse-python-sdk/lists"}