Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iomarmochtar/ozpy
Python library for accessing Zimbra SOAP.
https://github.com/iomarmochtar/ozpy
api python-library zimbra
Last synced: 1 day ago
JSON representation
Python library for accessing Zimbra SOAP.
- Host: GitHub
- URL: https://github.com/iomarmochtar/ozpy
- Owner: iomarmochtar
- License: gpl-2.0
- Created: 2017-06-12T06:11:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-16T03:18:53.000Z (over 3 years ago)
- Last Synced: 2024-10-03T02:14:45.044Z (about 1 month ago)
- Topics: api, python-library, zimbra
- Language: Python
- Size: 25.4 KB
- Stars: 4
- Watchers: 1
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
OZPY
====Python (2.7+ including 3.X) library for accessing Zimbra SOAP (https://wiki.zimbra.com/wiki/SOAP_API_Reference_Material_Beginning_with_ZCS_8) by using builtin Python library (no dependency required).
Currently this library split into 2 parts: Zmprov and Mailbox.not all zmprov command(s) has been implemented, because i add them only based on customer/project needs
but you can add your own by extending **OZSoap** which is base of **Zmprov** and **Mailbox**
for example creating new COS (Class Of Service).. code-block:: python
from ozpy.base import OZSoap
class NewClass(OZSoap):
def create_cos(self, name):
body = {"name": [{
"_content": name
}]}
return self.send("CreateCos", body)or directly call the soap method (by omitting Request suffix)
.. code-block:: python
# zmsoap_obj is an instance from class OZSoap
zmsoap_obj.CreateCos(
name=[{"_content": "barudong"}]
)you can use **zmsoap** to get the parameters in soap body by using **--verbose** and **--json**
.. code-block:: bash
zmsoap -z CreateCosRequest/name=new_cos --json --verbose
Examples
--------fetch all account
.. code-block:: python
from ozpy.zmprov import Zmprov
zmprov = Zmprov(
username="[email protected]",
password="superpassword",
soapurl="https://192.168.113.75:7071/service/admin/soap"
)
print( zmprov.gaa() )Sending email
.. code-block:: python
from ozpy.mailbox import Mailbox
mbx = Mailbox(
username="[email protected]",
password="superpassword",
soapurl="https://192.168.113.75/service/soap"
)
mbx.sendMail('[email protected]', 'This is subject', 'Email content')