Getui Custom-Developed Python client library for ownCloud
Project description
个推定制化修改版本 Owncloud SDK,提供客户方进行数据文件交互使用。
Features
Supports connecting to ownCloud 8.2, 9.0, 9.1 and newer.
General information
retrieve information about ownCloud instance (e.g. version, host, URL, etc.)
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
access files from public links
upload files to files drop link target
Apps (OCS Provisioning API)
enable/disable apps
retrieve list of enabled apps
Users (OCS Provisioning API)
create/delete users
create/delete groups
add/remove user from groups
App data
store app data as key/values using the privatedata OCS API
Requirements
Python >= 2.7 or Python >= 3.5
requests module (for making HTTP requests)
Installation
Automatic installation with pip:
$ pip install gtocclient
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: " + link_info.get_link()
Running the unit tests
To run the unit tests, create a config file called “owncloud/test/config.py”. There is a config file example called “owncloud/test/config.py.sample”. All the information required is in that file. It should point to a running ownCloud instance to test against.
You might also need to install the unittest-data-provider package:
$ pip install unittest-data-provider
Then run the script “runtests.sh”:
$ ./runtests.sh
Building the documentation
To build the documentation, you will need to install Sphinx and docutil. Then run the following commands:
$ sphinx-apidoc -e -f -o docs/source owncloud/ owncloud/test
$ cd docs
$ make html
You can then find the documentation inside of “doc/build/html”.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file gtocclient-0.7.7.tar.gz
.
File metadata
- Download URL: gtocclient-0.7.7.tar.gz
- Upload date:
- Size: 56.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d36fb533561520c1400682375e790428119524b51dbd8391e89bc63ec5998c84 |
|
MD5 | 640abd29d3e4d59831216ef9d14bed79 |
|
BLAKE2b-256 | f57d62dc9dd6449290fe8838c9ec7f0358e995e9739d794a14daee541dfb96a9 |