• Stars
    star
    280
  • Rank 147,492 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ownCloud client library for Python

Python client library for ownCloud

https://travis-ci.org/owncloud/pyocclient.svg?branch=master

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

Please note that this is not a sync client implementation but a library that provides functions to abstract away HTTP calls for various ownCloud APIs.

See the ownCloud homepage for more information about ownCloud.

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

Sharing (OCS Share API)

  • share a file/directory via public link
  • share a file/directory with another user or group
  • unshare a file/directory
  • check if a file/directory is already shared
  • get information about a shared resource
  • update properties of a known share

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 pyocclient

Manual installation of development version with git:

$ pip install requests
$ git clone https://github.com/owncloud/pyocclient.git
$ cd pyocclient
$ python setup.py install

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()

Example for uploading a file to a public shared folder:

import owncloud

public_link = 'http://domain.tld/owncloud/A1B2C3D4'

oc = owncloud.Client.from_public_link(public_link)
oc.drop_file('myfile.zip')

Example for downloading a file from a public shared folder with password:

import owncloud

public_link = 'http://domain.tld/owncloud/A1B2C3D4'
folder_password = 'secret'

oc = owncloud.Client.from_public_link(public_link, folder_password=folder_password)
oc.get_file('/sharedfile.zip', 'download/destination/sharedfile.zip')

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".

More Repositories

1

core

☁️ ownCloud web server core (Files, DAV, etc.)
PHP
8,113
star
2

android

☎️ The ownCloud Android App
Kotlin
3,834
star
3

client

πŸ–₯️ Desktop Syncing Client for ownCloud
C++
1,397
star
4

ocis

βš›οΈ ownCloud Infinite Scale Stack
Go
1,344
star
5

ios-legacy

πŸ“± iOS app for ownCloud
Objective-C
628
star
6

music

🎢 Music app for ownCloud
PHP
557
star
7

web

🐲 Next generation frontend for ownCloud Infinite Scale
TypeScript
432
star
8

ios-app

πŸ“±The all-new iOS app for ownCloud
Swift
214
star
9

notes

πŸ“” Notes app for ownCloud
Starlark
196
star
10

tasks

βœ… Tasks app for ownCloud
JavaScript
183
star
11

calendar

Calendar app for ownCloud
JavaScript
121
star
12

richdocuments

πŸ“” Collabora Online for ownCloud
JavaScript
116
star
13

android-library

☎️ The ownCloud Android Library
Kotlin
111
star
14

notes-iOS-App

πŸ““
Swift
98
star
15

gallery

πŸŒ… Gallery app for ownCloud, which includes previews for all supported media files
JavaScript
88
star
16

ios-library

Objective-C
79
star
17

contacts

πŸ‘₯ Manage your CardDAV contacts from a feature-rich web-interface
JavaScript
75
star
18

owncloud-sdk

☁️ ownCloud client library for JavaScript
JavaScript
75
star
19

news-iOS-App

The iOS News App
Objective-C
59
star
20

docs

ownCloud Documentation (v2)
JavaScript
55
star
21

administration

Some Administration tools for ownCloud
Shell
54
star
22

davclient.js

WebDAV, CalDAV and CardDAV client for javascript
JavaScript
51
star
23

files_antivirus

πŸ‘Ύ virus scanner for ownCloud
JavaScript
47
star
24

ocis-charts

πŸ“ˆ Helm Charts for ownCloud's OCIS
Mustache
45
star
25

files_external_gdrive

GDrive external storage for ownCloud
PHP
42
star
26

activity

⚑ Activity app for ownCloud
PHP
33
star
27

oauth2

πŸ” Application for using OAuth 2.0 in ownCloud
PHP
32
star
28

files_videoplayer

CSS
29
star
29

owncloud-design-system

🎨 A pattern library for ownCloud for Vue.js
Vue
26
star
30

updater

PHP
25
star
31

files_mediaviewer

Viewer for pictures and videos integrated in the files app
JavaScript
22
star
32

encryption

πŸ” server side encryption of files
PHP
19
star
33

theme-example

CSS
19
star
34

files_texteditor

JavaScript
18
star
35

files_pdfviewer

Starlark
17
star
36

user_ldap

πŸ“’
PHP
17
star
37

OwncloudUniversal

Owncloud-Client for Windows Phones (Win10Mobile) or PCs
C#
16
star
38

files_primary_s3

πŸ“¦ S3 compatible Storage
Starlark
15
star
39

QA

πŸ’₯ public test plans for owncloud components and apps
Shell
14
star
40

announcementcenter

πŸ“’ Announcement Center for ownCloud
PHP
13
star
41

files_external_dropbox

πŸ“¦ App for Integration of Dropbox
Starlark
13
star
42

market

πŸͺ MarketPlace integration
JavaScript
13
star
43

impersonate

Allow administrators to become a different user
Starlark
12
star
44

owncloud.github.io

Developer documentation for ownCloud Infinite Scale
CSS
12
star
45

notifications

πŸ”” Notifications app for ownCloud
PHP
12
star
46

docs-server

ownCloud Server Documentation
Shell
12
star
47

ios-sdk

πŸ“± πŸ“¦ iOS SDK for ownCloud
Objective-C
10
star
48

ocis-hello

βš›οΈ Example extension for oCIS
Go
10
star
49

cdperf

βš›οΈ ownCloud cloud performance test
TypeScript
10
star
50

files_external_ftp

Flysystem based ftp backend for ownCloud
Starlark
10
star
51

twofactor_totp

πŸ”‘ Second factor TOTP (Google Authenticator) provider for ownCloud
PHP
9
star
52

files_external_s3

Starlark
9
star
53

docs-ocis

ownCloud oCis Admin Documentation
JavaScript
8
star
54

customgroups

Let users create their own custom groups
PHP
8
star
55

security-advisories

PHP
8
star
56

search_elastic

Elasticsearch based full text search
PHP
8
star
57

docs-ui

Custom Antora UI theme for the official ownCloud documentation.
CSS
8
star
58

templateeditor

Mail Template Editor is discontinued. Use theming to customize mail templates.
Starlark
7
star
59

protoc-gen-microweb

Protoc generator for Micro web services
Go
7
star
60

data_exporter

Export/Import for ownCloud user data
PHP
7
star
61

guests

πŸ‘ͺ Share with externals easily via email address
JavaScript
6
star
62

openidconnect

OpenId Connect (OIDC) Integration for ownCloud
PHP
6
star
63

diagnostics

πŸ₯ Collect request data and measure performance
Starlark
6
star
64

craft-blueprints-owncloud

Python
6
star
65

brute_force_protection

Brute-force protection app for ownCloud
PHP
6
star
66

password_policy

πŸ›‘οΈ Define password policies for user and public link passwords
Gherkin
6
star
67

firstrunwizard

JavaScript
5
star
68

docs-client-desktop

ownCloud Desktop Client Documentation
Shell
5
star
69

twofactor_email

PHP
5
star
70

docs-webui

ownCloud Server Documentation
Shell
5
star
71

file-picker

Integrate ownCloud into your own product
Vue
5
star
72

coding-standard

πŸ“šProvides the ownCloud coding standard
PHP
4
star
73

docs-client-android

ownCloud Android Documentation
JavaScript
4
star
74

twofactor_backup_codes

Starlark
4
star
75

files_paperhive

PaperHive integration with ownCloud
Starlark
4
star
76

ocis-reva

πŸ”„ reva integration for oCIS
Go
4
star
77

qnap-packaging

Shell
4
star
78

owncloud-client-binary

some precompiled desktop-client parts to simplify packaging. not intended for end-users
4
star
79

ocis-proxy

πŸŒ‰ Reverse proxy for oCIS
Go
4
star
80

testing

πŸ”§ app for testing ownCloud
PHP
3
star
81

moodle-repository_ocis

PHP
3
star
82

external

This app allows to list external web sites in the navigation menu
JavaScript
3
star
83

docs-client-ios-app

ownCloud iOS App Documentation
JavaScript
3
star
84

example-files

Some example files for the user home skeleton
Makefile
3
star
85

helm-charts

3
star
86

test-data

A repository for test data to find bugs. Please only upload CC and free content.
PHP
3
star
87

user_external

User backend using IMAP, SMB or FTP
Starlark
3
star
88

ios-scenario-testing

πŸ“± βš™οΈ iOS scenario testing using feature files. Gherkin language, Cucumber as tool and Appium interaction with devices/emulators
Java
3
star
89

ocis-wopiserver

βš›οΈ ownCloud Infinite Scale WOPI server
Go
3
star
90

libre-graph-api

☁️ Libre Graph Cloud Collaboration API
Mustache
3
star
91

ocis-ocs

βš›οΈ Serve OCS API for oCIS
Go
3
star
92

ocis-phoenix

βš›οΈ Serve Phoenix for oCIS
Go
3
star
93

web-app-dicom-viewer

ownCloud Web DICOM Viewer is an extension of ownCloud Web to preview DICOM files (medical images and their corresponding metadata)
TypeScript
3
star
94

ocis-php-sdk

PHP
3
star
95

client-desktop-shell-integration-nautilus

πŸ–₯️🐚
Python
2
star
96

docs-main

Shell
2
star
97

docs-client-branding

ownCloud Branding Documentation
Shell
2
star
98

configreport

Starlark
2
star
99

screenshots

Screenshots of ownCloud software
2
star
100

libre-graph-api-go

generated go SDK for the open graph api
Shell
2
star