pyzscaler


Namepyzscaler JSON
Version 1.6.0 PyPI version JSON
download
home_pagehttps://pyzscaler.packet.tech/
SummaryA python SDK for the Zscaler API.
upload_time2023-11-13 11:20:44
maintainer
docs_urlNone
authorMitch Kelly
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements restfly python-box
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![pyZscaler](https://raw.githubusercontent.com/mitchos/pyZscaler/gh-pages/docs/assets/images/logo.svg)](https://github.com/mitchos/pyZscaler)
# pyZscaler - An unofficial SDK for the Zscaler API

[![Build Status](https://github.com/mitchos/pyZscaler/actions/workflows/build.yml/badge.svg)](https://github.com/mitchos/pyZscaler/actions/workflows/build.yml)
[![Documentation Status](https://readthedocs.org/projects/pyzscaler/badge/?version=latest)](https://pyzscaler.readthedocs.io/?badge=latest)
[![License](https://img.shields.io/github/license/mitchos/pyZscaler.svg)](https://github.com/mitchos/pyZscaler)
[![Code Quality](https://app.codacy.com/project/badge/Grade/d339fa5d957140f496fdb5c40abc4666)](https://www.codacy.com/gh/mitchos/pyZscaler/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=mitchos/pyZscaler&amp;utm_campaign=Badge_Grade)
[![PyPI Version](https://img.shields.io/pypi/v/pyzscaler.svg)](https://pypi.org/project/pyZscaler)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pyzscaler.svg)](https://pypi.python.org/pypi/pyzscaler/)
[![GitHub Release](https://img.shields.io/github/release/mitchos/pyZscaler.svg)](https://github.com/mitchos/pyZscaler/releases/)

pyZscaler is an SDK that provides a uniform and easy-to-use interface for each of the Zscaler product APIs.

This SDK is not affiliated with, nor supported by Zscaler in any way.

## Quick links
* [pyZscaler API Documentation](https://pyzscaler.readthedocs.io)
* [pyZscaler User Documentation and Examples (WIP)](https://pyzscaler.packet.tech)

## Overview
Each Zscaler product has separate developer documentation and authentication methods. This SDK simplifies
software development using the Zscaler API.

This SDK leverages the [RESTfly framework](https://restfly.readthedocs.io/en/latest/index.html) developed
by Steve McGrath.

## Features
- Simplified authentication with Zscaler APIs.
- Uniform interaction with all Zscaler APIs.
- Uses [python-box](https://github.com/cdgriffith/Box/wiki) to add dot notation access to json data structures.
- Zscaler API output automatically converted from CamelCase to Snake Case.
- Various quality of life enhancements for object CRUD methods.

## Products
- Zscaler Private Access (ZPA)
- Zscaler Internet Access (ZIA)
- Zscaler Digital Experience (ZDX)
- Zscaler Mobile Admin Portal for Zscaler Client Connector (ZCC)
- Zscaler Connector Portal (ZCON)


## Installation

The most recent version can be installed from pypi as per below.

    $ pip install pyzscaler

## Usage

Before you can interact with any of the Zscaler APIs, you may need to generate API keys or retrieve tenancy information
for each product that you are interfacing with. Once you have the requirements and you have installed pyZscaler,
you're ready to go.


### Quick ZIA Example - Explicitly Activate Changes
**Note:** Changes will not be activated until you explicitly call the `activate()` method or the admin session is closed.
It's a best-practice to log out your API session so that logging is sane and you don't have unnecessary sessions open.
```python
from pyzscaler import ZIA

zia = ZIA(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD')
for user in zia.users.list_users():
    print(user)
    
zia.config.activate() # Explicitly activate changes (if applicable). 
zia.session.delete()  # Log out of the ZIA API and automatically commit any other changes
```

### Quick ZIA Example - Using the Python Context Manager

**Note**: Using the Python Context Manager will automatically log the admin user out and commit/activate any changes 
made when execution is complete.

```python
from pyzscaler import ZIA
with ZIA(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD') as zia:
    for user in zia.users.list_users():
        print(user)

```


### Quick ZPA Example

```python
from pyzscaler import ZPA
from pprint import pprint

zpa = ZPA(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', customer_id='CUSTOMER_ID')
for app_segment in zpa.app_segments.list_segments():
    pprint(app_segment)
```

### Quick ZCC Example

```python
from pyzscaler import ZCC
from pprint import pprint

zcc = ZCC(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', company_id='COMPANY_ID')
for device in zcc.devices.list_devices():
    pprint(device)
```
### Quick ZDX Example

```python
from pyzscaler import ZDX

zdx = ZDX(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', cloud='CLOUD')
for device in zdx.devices.list_devices():
    print(device)
```
### Quick ZCON Example
The Zscaler Connector Portal uses the same authentication methods as ZIA and this will allow us to use the Python Context
Manager just like we did with ZIA. Of course, you can still use the explicit method if you prefer.

```python
from pyzscaler import ZCON

with ZCON(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD') as zcon:
    for group in zcon.groups.list_groups():
        print(group)
```



## Documentation
### API Documentation
pyZscaler's API is fully 100% documented and is hosted at [ReadTheDocs](https://pyzscaler.readthedocs.io). 

This documentation should be used when working with pyZscaler rather than referring to Zscaler's API reference. 
pyZscaler makes some quality of life improvements to simplify and clarify arguments passed to Zscaler's API.

### User Documentation
A start has been made on [user documentation](https://pyzscaler.packet.tech) with examples and explanations on how to implement with pyZcaler.

## Is It Tested?
Yes! pyZscaler has a complete test suite that fully covers all methods within all modules.

## Contributing

Contributions to pyZscaler are absolutely welcome.

Please see the [Contribution Guidelines](https://github.com/mitchos/pyZscaler/blob/main/CONTRIBUTING.md) for more information.

[Poetry](https://python-poetry.org/docs/) is currently being used for builds and management. You'll want to have
poetry installed and available in your environment.

## Issues
Please feel free to open an issue using [Github Issues](https://github.com/mitchos/pyZscaler/issues) if you run into any problems using pyZscaler.

## License
MIT License

Copyright (c) 2021 Mitch Kelly

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
            

Raw data

            {
    "_id": null,
    "home_page": "https://pyzscaler.packet.tech/",
    "name": "pyzscaler",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Mitch Kelly",
    "author_email": "me@mkelly.dev",
    "download_url": "https://files.pythonhosted.org/packages/15/67/34f05e9e137a4c0ef06a671badb6700f064ff461d718bed1c6d68cbbcc1f/pyzscaler-1.6.0.tar.gz",
    "platform": null,
    "description": "[![pyZscaler](https://raw.githubusercontent.com/mitchos/pyZscaler/gh-pages/docs/assets/images/logo.svg)](https://github.com/mitchos/pyZscaler)\n# pyZscaler - An unofficial SDK for the Zscaler API\n\n[![Build Status](https://github.com/mitchos/pyZscaler/actions/workflows/build.yml/badge.svg)](https://github.com/mitchos/pyZscaler/actions/workflows/build.yml)\n[![Documentation Status](https://readthedocs.org/projects/pyzscaler/badge/?version=latest)](https://pyzscaler.readthedocs.io/?badge=latest)\n[![License](https://img.shields.io/github/license/mitchos/pyZscaler.svg)](https://github.com/mitchos/pyZscaler)\n[![Code Quality](https://app.codacy.com/project/badge/Grade/d339fa5d957140f496fdb5c40abc4666)](https://www.codacy.com/gh/mitchos/pyZscaler/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=mitchos/pyZscaler&amp;utm_campaign=Badge_Grade)\n[![PyPI Version](https://img.shields.io/pypi/v/pyzscaler.svg)](https://pypi.org/project/pyZscaler)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pyzscaler.svg)](https://pypi.python.org/pypi/pyzscaler/)\n[![GitHub Release](https://img.shields.io/github/release/mitchos/pyZscaler.svg)](https://github.com/mitchos/pyZscaler/releases/)\n\npyZscaler is an SDK that provides a uniform and easy-to-use interface for each of the Zscaler product APIs.\n\nThis SDK is not affiliated with, nor supported by Zscaler in any way.\n\n## Quick links\n* [pyZscaler API Documentation](https://pyzscaler.readthedocs.io)\n* [pyZscaler User Documentation and Examples (WIP)](https://pyzscaler.packet.tech)\n\n## Overview\nEach Zscaler product has separate developer documentation and authentication methods. This SDK simplifies\nsoftware development using the Zscaler API.\n\nThis SDK leverages the [RESTfly framework](https://restfly.readthedocs.io/en/latest/index.html) developed\nby Steve McGrath.\n\n## Features\n- Simplified authentication with Zscaler APIs.\n- Uniform interaction with all Zscaler APIs.\n- Uses [python-box](https://github.com/cdgriffith/Box/wiki) to add dot notation access to json data structures.\n- Zscaler API output automatically converted from CamelCase to Snake Case.\n- Various quality of life enhancements for object CRUD methods.\n\n## Products\n- Zscaler Private Access (ZPA)\n- Zscaler Internet Access (ZIA)\n- Zscaler Digital Experience (ZDX)\n- Zscaler Mobile Admin Portal for Zscaler Client Connector (ZCC)\n- Zscaler Connector Portal (ZCON)\n\n\n## Installation\n\nThe most recent version can be installed from pypi as per below.\n\n    $ pip install pyzscaler\n\n## Usage\n\nBefore you can interact with any of the Zscaler APIs, you may need to generate API keys or retrieve tenancy information\nfor each product that you are interfacing with. Once you have the requirements and you have installed pyZscaler,\nyou're ready to go.\n\n\n### Quick ZIA Example - Explicitly Activate Changes\n**Note:** Changes will not be activated until you explicitly call the `activate()` method or the admin session is closed.\nIt's a best-practice to log out your API session so that logging is sane and you don't have unnecessary sessions open.\n```python\nfrom pyzscaler import ZIA\n\nzia = ZIA(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD')\nfor user in zia.users.list_users():\n    print(user)\n    \nzia.config.activate() # Explicitly activate changes (if applicable). \nzia.session.delete()  # Log out of the ZIA API and automatically commit any other changes\n```\n\n### Quick ZIA Example - Using the Python Context Manager\n\n**Note**: Using the Python Context Manager will automatically log the admin user out and commit/activate any changes \nmade when execution is complete.\n\n```python\nfrom pyzscaler import ZIA\nwith ZIA(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD') as zia:\n    for user in zia.users.list_users():\n        print(user)\n\n```\n\n\n### Quick ZPA Example\n\n```python\nfrom pyzscaler import ZPA\nfrom pprint import pprint\n\nzpa = ZPA(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', customer_id='CUSTOMER_ID')\nfor app_segment in zpa.app_segments.list_segments():\n    pprint(app_segment)\n```\n\n### Quick ZCC Example\n\n```python\nfrom pyzscaler import ZCC\nfrom pprint import pprint\n\nzcc = ZCC(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', company_id='COMPANY_ID')\nfor device in zcc.devices.list_devices():\n    pprint(device)\n```\n### Quick ZDX Example\n\n```python\nfrom pyzscaler import ZDX\n\nzdx = ZDX(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', cloud='CLOUD')\nfor device in zdx.devices.list_devices():\n    print(device)\n```\n### Quick ZCON Example\nThe Zscaler Connector Portal uses the same authentication methods as ZIA and this will allow us to use the Python Context\nManager just like we did with ZIA. Of course, you can still use the explicit method if you prefer.\n\n```python\nfrom pyzscaler import ZCON\n\nwith ZCON(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD') as zcon:\n    for group in zcon.groups.list_groups():\n        print(group)\n```\n\n\n\n## Documentation\n### API Documentation\npyZscaler's API is fully 100% documented and is hosted at [ReadTheDocs](https://pyzscaler.readthedocs.io). \n\nThis documentation should be used when working with pyZscaler rather than referring to Zscaler's API reference. \npyZscaler makes some quality of life improvements to simplify and clarify arguments passed to Zscaler's API.\n\n### User Documentation\nA start has been made on [user documentation](https://pyzscaler.packet.tech) with examples and explanations on how to implement with pyZcaler.\n\n## Is It Tested?\nYes! pyZscaler has a complete test suite that fully covers all methods within all modules.\n\n## Contributing\n\nContributions to pyZscaler are absolutely welcome.\n\nPlease see the [Contribution Guidelines](https://github.com/mitchos/pyZscaler/blob/main/CONTRIBUTING.md) for more information.\n\n[Poetry](https://python-poetry.org/docs/) is currently being used for builds and management. You'll want to have\npoetry installed and available in your environment.\n\n## Issues\nPlease feel free to open an issue using [Github Issues](https://github.com/mitchos/pyZscaler/issues) if you run into any problems using pyZscaler.\n\n## License\nMIT License\n\nCopyright (c) 2021 Mitch Kelly\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python SDK for the Zscaler API.",
    "version": "1.6.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/mitchos/pyZscaler/issues",
        "Documentation": "https://pyzscaler.readthedocs.io/",
        "Homepage": "https://pyzscaler.packet.tech/",
        "Repository": "https://github.com/mitchos/pyZscaler"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d80539106b025089275bba638a2a5ccabdbc587bd80076fb92b7ab3a98624ac2",
                "md5": "d326d1f78dfd6b58da84afacffd4c3ee",
                "sha256": "946265ed6d0ec886cfd5a18a962e4f807b5d4c313f39f8080cc773cc38715f5d"
            },
            "downloads": -1,
            "filename": "pyzscaler-1.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d326d1f78dfd6b58da84afacffd4c3ee",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 109473,
            "upload_time": "2023-11-13T11:20:41",
            "upload_time_iso_8601": "2023-11-13T11:20:41.568211Z",
            "url": "https://files.pythonhosted.org/packages/d8/05/39106b025089275bba638a2a5ccabdbc587bd80076fb92b7ab3a98624ac2/pyzscaler-1.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "156734f05e9e137a4c0ef06a671badb6700f064ff461d718bed1c6d68cbbcc1f",
                "md5": "7aa72362095c326515d04a6c7272caae",
                "sha256": "13712474b4b9019e95cf050badc95b2fbf00dbb800e98f6bdc52e6ca6229ee4d"
            },
            "downloads": -1,
            "filename": "pyzscaler-1.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7aa72362095c326515d04a6c7272caae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 79708,
            "upload_time": "2023-11-13T11:20:44",
            "upload_time_iso_8601": "2023-11-13T11:20:44.236209Z",
            "url": "https://files.pythonhosted.org/packages/15/67/34f05e9e137a4c0ef06a671badb6700f064ff461d718bed1c6d68cbbcc1f/pyzscaler-1.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-13 11:20:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mitchos",
    "github_project": "pyZscaler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "restfly",
            "specs": [
                [
                    "==",
                    "1.4.7"
                ]
            ]
        },
        {
            "name": "python-box",
            "specs": [
                [
                    "==",
                    "7.0.1"
                ]
            ]
        }
    ],
    "lcname": "pyzscaler"
}
        
Elapsed time: 0.15198s