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)
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)
# 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
zmsoap -z CreateCosRequest/name=new_cos --json --verbose
Examples
fetch all account
from ozpy.zmprov import Zmprov
zmprov = Zmprov(
username="admin@mail.com",
password="superpassword",
soapurl="https://192.168.113.75:7071/service/admin/soap"
)
print zmprov.gaa()
Sending email
from ozpy.mailbox import Mailbox
mbx = Mailbox(
username="user1@mail.com",
password="superpassword",
soapurl="https://192.168.113.75/service/soap"
)
mbx.sendMail('admin@mail.com', 'This is subject', 'Email content')
Metadata
Release files for ozpy 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ozpy-1.0.1.tar.gz | 5.7 kB | Details |
Release files / ozpy-1.0.1.tar.gz
| Download URL | ozpy-1.0.1.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ddb65132a765fea320922bc7625ae854dd04862b3703977c83dde56933c4a3a
|
|
BLAKE2b-256 checksum How to use checksums |
2c71cce3a894bf0f1f54f9df1151aacd279403e79004c067be6650ca34269773
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.9.1 pkginfo/1.4.1 requests/2.9.1 setuptools/23.1.0 requests-toolbelt/0.8.0 tqdm/4.14.0 CPython/2.7.12
|