{ "info": { "author": "Andreas Jung", "author_email": "info@zopyx.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "haufe.extended.sharepoint\r\n================\r\n\r\n``haufe.extended`` is a fork of Haufe's sharepoint. It is\r\nmade to allow non NTLM auth, adds Copy.asmx for documents\r\nand provides a new set of perks for Lists\r\n\r\nFeatures\r\n--------\r\n\r\n* Connect with non NTLM, and NTLM connections\r\n* CRUD interface for Lists.asmx, Copy.asmx\r\n* Adds attachment, file upload support\r\n* Same core as the initial Haufe Sharepoint\r\n\r\nUsage (parts borrowed from Haufe)\r\n-----\r\n\r\nIn order to connect to Sharepoint you need the following parameters\r\n\r\n- the Lists/Copy WSDL URL\r\n- the ID/Name of the related Sharepoint list you want to interact with\r\n- a valid Sharepoint username and password (having the related rights)\r\n\r\nAPI usage\r\n---------\r\n\r\nConnecting to sharepoint\r\n++++++++++++++++++++++++\r\n\r\nIn order to connect to Sharepoint you need to import the ``Connector``\r\nmethod which is a factory return a ``ListEndPoint`` instance::\r\n\r\n\r\n > from haufe.sharepoint import Connector\r\n > url = 'http://sharepoint/bereiche/onlineschulungen/'\r\n > username = 'YourDomain\\\\account'\r\n > password = 'secret'\r\n > list_id = '60e3f442-6faa-4b49-814d-2ce2ec88b8d5'\r\n > service = Connector(url, username, password, list_id, NTLM=False)\r\n\t> service = Connector(url, username, password, list_id, NTLM=True)\r\n\r\n\r\nSharepoint list model introspection\r\n+++++++++++++++++++++++++++++++++++\r\n\r\nThe internals of the list schema is available through the ``model`` property\r\nof the ``ListEndPoint`` instance::\r\n\r\n > fields = service.model\r\n\r\nThe primary key of the list is exposed through the ``primary_key`` property::\r\n\r\n > primary_key = service.primary_key\r\n\r\nThe lists of all required field names and all fields is available through::\r\n\r\n > all_fields = service.all_fields\r\n > required_fields = service.required_fields\r\n\r\nList item deletion\r\n++++++++++++++++++\r\n\r\nIn order to delete list items by their primary key values, you can use\r\nthe ``deleteItems()`` method::\r\n\r\n > result = service.deleteItems('54', '55')\r\n > print result\r\n > print result.result\r\n > print result.ok\r\n\r\nThe ``result`` object is an instance of ``ParsedSoapResult`` providing a\r\nflag ``ok`` (True|False) indicating the overall success or overall failure \r\nof the operation. The individual error codes are available by iterating over the \r\n``result`` property of the ``ParsedSoapResult`` instance.\r\n\r\nUpdating list items\r\n+++++++++++++++++++\r\n\r\nYou can update existing list items by passing one or multiple dictionaries\r\nto ``updateItems()``. Each dict must contain the value of the related primary key\r\n(in this case the ``ID`` field)::\r\n\r\n > data = dict(ID='77', Title=u'Ruebennase', FirstName=u'Heinz')\r\n > result = service.updateItems(data)\r\n > print result\r\n > print result.result\r\n > print result.ok\r\n\r\n``updateItems()`` will not raise any exception. Instead you need to\r\ncheck the ``ok`` property of the result object and if needed the individual\r\nitems of the ``result`` property::\r\n\r\n # update an item (non-existing ID)\r\n > data = dict(ID='77000', Title=u'Becker')\r\n > result = service.updateItems(data)\r\n > print result\r\n > print result.result\r\n > print result.ok\r\n\r\nAdding items to a list\r\n++++++++++++++++++++++\r\n\r\nThe ``addItems()`` method works like the ``updateItems()`` method \r\nexcept that do not have pass in a primary key (since it is not known\r\non the client side). The assigned primary key value after adding\r\nthe item to the list should be available from the ``result`` object::\r\n\r\n > data = dict(Title=u'Ruebennase', FirstName=u'Heinz')\r\n > result = service.addItems(data)\r\n > print result\r\n > print result.result\r\n > print result.ok\r\n > print 'assigned ID:', result.result[0]['row']._ows_ID\r\n\r\nRetrieving a single list item\r\n+++++++++++++++++++++++++++++\r\n\r\n``getItem()`` will return a single item by its primary key value::\r\n\r\n > data = service.getItem('77') \r\n\r\nRetrieving all list items\r\n+++++++++++++++++++++++++\r\n\r\n``getItems()`` will return all list items (use with care!)::\r\n\r\n > items = service.getItems()\r\n\r\nGeneric query API\r\n+++++++++++++++++\r\n\r\n``query(**kw)`` can be used to query the list with arbitrary query parameters\r\nwhere each subquery must perform an exact match. All subqueries are combined\r\nusing a logical AND::\r\n\r\n > items = service.query(FirstName='Heinz', Title='Becker')\r\n\r\nThe result is returned a Python list of dictified list items.\r\nAll query parameters must represent a valid field name of the list (ValueError\r\nexception raised otherwise).\r\n\r\nIn order to perform a substring search across _all_ query parameter you may\r\npass the ``mode='contains'`` parameter. To specify a prefix search across\r\nall query parameters, use ``mode='beginswith'``.\r\n\r\nView support\r\n++++++++++++\r\n\r\n``haufe.sharepoint`` supports list views of Sharepoint. You can either\r\nset a default view used for querying Sharepoint like::\r\n\r\n > service.setDefaultView('{D9DF14B-21F2-4D75-B796-EA74647C30C6'}')\r\n\r\nor you select the view on a per-query basis by passing the view name\r\nas ``viewName`` method parameter (applies to ``getItem()``, \r\n``getItems()`` and ``query()``)::\r\n\r\n > items = service.getItems(viewName='{D9DF14B-21F2-4D75-B796-EA74647C30C6'}')\r\n\t\r\nCreating/Deleting/Reading Attachments\r\n+++++++++++\r\n\r\n > attachment = service.addAttachment(item_id, \"file__.png\", file)\r\n > attachments = service.getAttachments('ITEM ID')\r\n > service.deleteAttachment('ITEM_URL')\r\n\r\nCopy.asmx Support\r\n+++++++++++\r\n\r\nUploading new documents:\r\n\r\n > doc = service.upload(\"test\", file, fields=dict(\r\n > Name=\"A document title\"\r\n > ))\r\n > doc.ok\r\n\t\r\nLike attachment support in Lists.asmx file should be the path to a file. \r\nFields are the meta data listed in the documents, they can also be\r\nedited with another 'meta' dictionary. This will tell sharepoint\r\nwhat types you are using. For example:\r\n \r\n > service.upload(\r\n > dict(destinationUrl='my file', \r\n > fields=dict(MultiChoice='Blue'),\r\n > meta=dict(MultiChoice='MultiChoice')))\r\n\r\nTells 'MultiChoice' field is a MultiChoice and should not be treated\r\nlike any other type. \t\r\n\r\n\r\nOverwriting Current Documents\r\n++++++++++++\r\n\r\nyou can overwrite current documents. \r\nUsing overwrite = True\r\n\r\n\r\nCommand line usage\r\n------------------\r\n\r\n``haufe.sharepoint`` comes with a small ``sharepoint-inspector`` commandline utility::\r\n\r\n sharepoint-inspector --url --list --username --password --cmd \r\n\r\nwhere is either ``fields`` or ``items`` \r\n\r\n\r\n\r\nRequirements\r\n------------\r\n\r\n* Python 2.4 or higher (no support for Python 3.X)\r\n\r\nTested\r\n------\r\n* tested with Python 2.4-2.6\r\n* suds 0.4.1 beta or checkout of the suds trunk (https://fedorahosted.org/suds/). suds 0.4.0 is _not_ sufficient!\r\n* python-ntlm 1.0\r\n* Microsoft Sharepoint Services 3.0 API\r\n\r\nAuthor\r\n------\r\n\r\nWritten for Haufe-Lexware GmbH, Freiburg, Germany.\r\n\r\n| ZOPYX Limited\r\n| Andreas Jung\r\n| Charlottenstr. 37/1\r\n| D-72070 Tuebingen\r\n| www.zopyx.com\r\n| info@zopyx.com\r\n\r\nExtended by\r\n-------\r\n\r\nNadir Hamid\r\n| matrix.nad@gmail.com\r\n\r\nSpecial Thanks:\r\n-------\r\n| Pat S\r\n\r\n\r\n\r\nChangelog haufe.sharepoint.extended\r\n========\r\n\r\n0.2.0 - 2015/01/15\r\n\r\n* ConnectorLists, ConnectorCopy\r\n objects. Both follow order for lists.asmx and copy.asmx\r\n respectively. \r\n* Support for ParsedSoapResult in attachments and uploads\r\n using 'ok' and 'results' properties\r\n* Factory object fixes more tests with NON NTLM connections\r\n* Minor fixes\r\n* New samples in root for upload and attachments\r\n\r\n0.1.0 - 2014/12/27\r\n\r\n* Support for Copy.asmx\r\n* Non NTLM based auth\r\n* Attachments, document uploading support\r\n* Initial release\r\n\r\nChangelog haufe.sharepoint\r\n=========\r\n\r\n0.1.9 - 2011/06/03\r\n------------------\r\n* fixed some documentation glitches\r\n* added logging at connection time\r\n\r\n0.1.8 - 2011/05/30\r\n------------------\r\n* fixed improper parameter usage in exception\r\n\r\n\r\n0.1.7 - 2011/05/24\r\n------------------\r\n* applied third-party patch containing minor fixes\r\n\r\n0.1.6 - 2011/05/04\r\n------------------\r\n* better connection error handling\r\n* WSDL url prefix automatically added to the Sharepoint URL\r\n* fixed issue in getItems() with empty result sets\r\n\r\n0.1.5 - 2011/02/23\r\n------------------\r\n* added checkin_file(), checkout_file()\r\n* the connection ``timeout`` is now configurable through the Connector() API\r\n* add setDefaultView() API\r\n\r\n0.1.4 - 2011/02/22\r\n------------------\r\n* support for exact|substring|prefix search through\r\n the query() API\r\n\r\n0.1.3 - 2011/02/22\r\n------------------\r\n* added generic query() API\r\n\r\n0.1.2 - 2011/02/21\r\n------------------\r\n* implemented getItem() in a proper way\r\n\r\n0.1.1 - 2011/02/18\r\n------------------\r\n\r\n* minor fixes\r\n* documentation updated\r\n\r\n0.1 - 2011/02/17\r\n----------------\r\n\r\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/haufe.sharepoint", "keywords": "Sharepoint", "license": "ZPL", "maintainer": "Nadir", "maintainer_email": "matrix.nad@gmail.com", "name": "haufe.sharepoint.extended", "package_url": "https://pypi.org/project/haufe.sharepoint.extended/", "platform": "ALL", "project_url": "https://pypi.org/project/haufe.sharepoint.extended/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/haufe.sharepoint" }, "release_url": "https://pypi.org/project/haufe.sharepoint.extended/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Experimental Python-Sharepoint connector w/ CopyList sharepoint", "version": "0.1.0" }, "last_serial": 1689950, "releases": { "0.1.0": [ { "comment_text": "0.1.0", "digests": { "md5": "013b2d98443b01f97171f8f6fb7d6955", "sha256": "0e338e1027bef2e9cfae4947fd2799c8cdce82205b0f6a83b36ce782dcd7b5a0" }, "downloads": -1, "filename": "haufe.sharepoint.extended.0.1.0.zip", "has_sig": false, "md5_digest": "013b2d98443b01f97171f8f6fb7d6955", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 506027, "upload_time": "2015-01-24T06:26:13", "url": "https://files.pythonhosted.org/packages/d6/13/47ff327be21e16db8435e3199b1f332ff1372965ef02c199a435fcd7f131/haufe.sharepoint.extended.0.1.0.zip" }, { "comment_text": "updated 0.1.0, minor patch", "digests": { "md5": "961976ee7c05a989682901bb1711138b", "sha256": "35572ddeac0886e5a8cfeb5a3555c9d09857c007a1c1e2b81a55cfc83eb3a1dd" }, "downloads": -1, "filename": "haufe.sharepoint.extended-0.1.1.zip", "has_sig": false, "md5_digest": "961976ee7c05a989682901bb1711138b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 506096, "upload_time": "2015-01-24T06:08:24", "url": "https://files.pythonhosted.org/packages/80/32/4d89d4f6607b22d36896a9453af113d0a11843f2bb0ef9337513ebcf8ecc/haufe.sharepoint.extended-0.1.1.zip" } ] }, "urls": [ { "comment_text": "0.1.0", "digests": { "md5": "013b2d98443b01f97171f8f6fb7d6955", "sha256": "0e338e1027bef2e9cfae4947fd2799c8cdce82205b0f6a83b36ce782dcd7b5a0" }, "downloads": -1, "filename": "haufe.sharepoint.extended.0.1.0.zip", "has_sig": false, "md5_digest": "013b2d98443b01f97171f8f6fb7d6955", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 506027, "upload_time": "2015-01-24T06:26:13", "url": "https://files.pythonhosted.org/packages/d6/13/47ff327be21e16db8435e3199b1f332ff1372965ef02c199a435fcd7f131/haufe.sharepoint.extended.0.1.0.zip" }, { "comment_text": "updated 0.1.0, minor patch", "digests": { "md5": "961976ee7c05a989682901bb1711138b", "sha256": "35572ddeac0886e5a8cfeb5a3555c9d09857c007a1c1e2b81a55cfc83eb3a1dd" }, "downloads": -1, "filename": "haufe.sharepoint.extended-0.1.1.zip", "has_sig": false, "md5_digest": "961976ee7c05a989682901bb1711138b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 506096, "upload_time": "2015-01-24T06:08:24", "url": "https://files.pythonhosted.org/packages/80/32/4d89d4f6607b22d36896a9453af113d0a11843f2bb0ef9337513ebcf8ecc/haufe.sharepoint.extended-0.1.1.zip" } ] }