Skip to main content

Python client library for ownCloud

Project description

This library makes it possible to connect to an ownCloud instance and perform file, share and attribute operations in python.

Please note that this is not a sync client implementation but rather a wrapper around various APIs.

See the ownCloud homepage for more information about ownCloud.

Features

Accessing files

  • basic file operations like getting a directory listing, file upload/download, directory creation, etc

  • read/write file contents from strings

  • upload with chunking and mtime keeping

  • upload whole directories

  • directory download as zip

Sharing

  • share a file with public link using the OCS Share API

App data

  • store app data as key/values using the privatedata OCS API

Requirements

  • Python >= 2.7 (no support for Python 3 yet)

  • requests module (for making HTTP requests)

Installation

To install pyocclient, simply:

$ pip install pyocclient

Usage

Example for uploading a file then sharing with link:

import owncloud

oc = owncloud.Client('http://domain.tld/owncloud')

oc.login('user', 'password')

oc.mkdir('testdir')

oc.put_file('testdir/remotefile.txt', 'localfile.txt')

link_info = oc.share_file_with_link('testdir/remotefile.txt')

print "Here is your link: http://domain.tld/owncloud/" + link_info.link

Running the unit tests

To run the unit tests, edit the config file in “owncloud/test/config.py” to point to a running ownCloud instance to test against. Then run the script “runtests.py”:

$ ./runtests.py

Building the documentation

To build the documentation, you will need to install Sphinx and docutil. Then run the following commands:

$ cd doc
$ make html

You can then find the documentation inside of “doc/build/html”.

Contributors

Changelog

0.2

0.1

  • Make python egg [PVince81]

  • Initial release [PVince81]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyocclient-0.1.tar.gz (11.7 kB view details)

Uploaded Source

File details

Details for the file pyocclient-0.1.tar.gz.

File metadata

  • Download URL: pyocclient-0.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyocclient-0.1.tar.gz
Algorithm Hash digest
SHA256 b3505e4973bfadda11f9f5d426018f9ea3a373c3ef47b77324ed4f88f195ff43
MD5 337fcaad3bcebc19f52c811df1666c9b
BLAKE2b-256 ed77bb7f285ebde345252a1e91476bdd4d64ed01d07b4b86a0680d6c7526e625

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page