Name | xpanse JSON |
Version |
2.1.0
JSON |
| download |
home_page | |
Summary | Python library is an interface to the Cortex Xpanse API. |
upload_time | 2023-08-08 19:22:00 |
maintainer | |
docs_url | None |
author | Palo Alto Cortex Xpanse |
requires_python | >=3.7 |
license | ISC |
keywords |
xpanse
iom
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Cortex Xpanse Python SDK
========================
<p align="center">
<a href="https://expanse.co/">
<img src="https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/blob/main/docs/_source/_static/xpanse_banner.png?raw=true"/>
</a>
</p>
<p align="center">
<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg"/>
</a>
<a href="https://pypi.python.org/pypi/xpanse">
<img src="https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blueviolet"/>
</a>
<a href="https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/blob/main/LICENSE">
<img src="https://img.shields.io/pypi/l/xpanse"/>
</a>
<a href="https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/graphs/contributors">
<img src="https://img.shields.io/github/contributors/PaloAltoNetworks/cortex-xpanse-python-sdk"/>
</a>
</p>
Overview
--------
This library is intended to be an interface to the
<a href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference">Cortex Xpanse Public API</a>.
Install
-------
```python
pip install xpanse
```
Requirements
------------
`Python 3.7+`
Usage
-----
<a href="https://cortex-xpanse-python-sdk.readthedocs.io/en/latest/">Cortex Xpanse Public API Documentation</a>
```python
# Import client
from xpanse.client import XpanseClient
# Initialize client
client = XpanseClient()
# Get assets iterator object and dump to a list
assets = client.assets.list().dump()
```
You can view more example code in the <a href="https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/tree/main/examples">examples</a> directory.
Configuration
-------------
A valid `API Key`, `API Key ID`, and `Fully Qualified Domain Name (FQDN)` are required for use.
Reference the docs for more information with <a href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference/Get-Started-with-APIs">Getting Started</a>.
#### RECOMMENDED
***********
You can supply them as environment variables.
```shell script
export CORTEX_FQDN=<Your Xpanse Instance URL>
export CORTEX_API_KEY=<API Key>
export CORTEX_API_KEY_ID=<API Key ID>
```
#### NOT RECOMMENDED
***************
The following parameters can be set inline using the `XpanseClient` constructor.
_This is not recommended, as it easily exposes sensitive credentials in your source code._
```python
# Import client
from xpanse.client import XpanseClient
# Initialize client - THIS IS NOT RECOMMENDED, SET ENVIRONMENT VARIABLES INSTEAD
client = XpanseClient(url="https://my-company.crtx.us.paloaltonetworks.com",
api_key="xxxxxxxxxxxxxxxApiKeyxxxxxxxxxxxxxxx",
api_key_id=1)
```
Logging
-------
Logging is handled through the python logging package. To enable different levels of verbosity in your scripts you can do the following:
```python
import logging
# Set the logging level
logging.basicConfig(level=logging.DEBUG)
```
You can read more at <https://docs.python.org/3/library/logging.html>.
Raw data
{
"_id": null,
"home_page": "",
"name": "xpanse",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "xpanse iom",
"author": "Palo Alto Cortex Xpanse",
"author_email": "xpanse-integrations@paloaltonetworks.com",
"download_url": "https://files.pythonhosted.org/packages/53/c5/6227ea1c994edca97100d279ff053aa41f6aa2928605b2c0073957003788/xpanse-2.1.0.tar.gz",
"platform": null,
"description": "Cortex Xpanse Python SDK\n========================\n<p align=\"center\">\n <a href=\"https://expanse.co/\">\n <img src=\"https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/blob/main/docs/_source/_static/xpanse_banner.png?raw=true\"/>\n </a>\n</p>\n\n<p align=\"center\">\n <a href=\"https://github.com/psf/black\">\n <img src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"/>\n </a>\n <a href=\"https://pypi.python.org/pypi/xpanse\">\n <img src=\"https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blueviolet\"/>\n </a>\n <a href=\"https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/blob/main/LICENSE\">\n <img src=\"https://img.shields.io/pypi/l/xpanse\"/>\n </a>\n <a href=\"https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/graphs/contributors\">\n <img src=\"https://img.shields.io/github/contributors/PaloAltoNetworks/cortex-xpanse-python-sdk\"/>\n </a>\n</p>\n\nOverview\n--------\n\nThis library is intended to be an interface to the\n<a href=\"https://docs-cortex.paloaltonetworks.com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference\">Cortex Xpanse Public API</a>.\n\nInstall\n-------\n```python\npip install xpanse\n```\n\nRequirements\n------------\n\n`Python 3.7+`\n\nUsage\n-----\n<a href=\"https://cortex-xpanse-python-sdk.readthedocs.io/en/latest/\">Cortex Xpanse Public API Documentation</a>\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 <a href=\"https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/tree/main/examples\">examples</a> 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 <a href=\"https://docs-cortex.paloaltonetworks.com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference/Get-Started-with-APIs\">Getting Started</a>.\n\n#### RECOMMENDED\n***********\nYou can supply them as environment variables.\n\n```shell script\nexport CORTEX_FQDN=<Your Xpanse Instance URL>\nexport CORTEX_API_KEY=<API Key>\nexport CORTEX_API_KEY_ID=<API Key ID>\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 <https://docs.python.org/3/library/logging.html>.\n\n\n",
"bugtrack_url": null,
"license": "ISC",
"summary": "Python library is an interface to the Cortex Xpanse API.",
"version": "2.1.0",
"project_urls": null,
"split_keywords": [
"xpanse",
"iom"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "aa6b1679da4728725a461d9786b2e6f3d25b2936c3b0861ff9a0de720c1bb296",
"md5": "c39138686f066eaa4293cc9830b47d8a",
"sha256": "5cafd2f18da2ca48251c22c48b0a4c2a669827e0c728bf282c20b3bde4350ad9"
},
"downloads": -1,
"filename": "xpanse-2.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c39138686f066eaa4293cc9830b47d8a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 61107,
"upload_time": "2023-08-08T19:21:58",
"upload_time_iso_8601": "2023-08-08T19:21:58.274137Z",
"url": "https://files.pythonhosted.org/packages/aa/6b/1679da4728725a461d9786b2e6f3d25b2936c3b0861ff9a0de720c1bb296/xpanse-2.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "53c56227ea1c994edca97100d279ff053aa41f6aa2928605b2c0073957003788",
"md5": "6c8da7a18dfa5c6ead2d6f0e10383af1",
"sha256": "18915f075dfab1d8d976dbadbfadb27b5c07c5ba56ee62418674a744ff44dd2d"
},
"downloads": -1,
"filename": "xpanse-2.1.0.tar.gz",
"has_sig": false,
"md5_digest": "6c8da7a18dfa5c6ead2d6f0e10383af1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 45137,
"upload_time": "2023-08-08T19:22:00",
"upload_time_iso_8601": "2023-08-08T19:22:00.254663Z",
"url": "https://files.pythonhosted.org/packages/53/c5/6227ea1c994edca97100d279ff053aa41f6aa2928605b2c0073957003788/xpanse-2.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-08 19:22:00",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "xpanse"
}