Skip to content
A tool to enable easy sharing of ownCloud files from your desktop, also a Python library.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


ownCloud share tools is an set of tools that provide access to the ownCloud OCS Share API. In this repository you will find the command line client, GUI and Python library for interfacing with ownCloud shares.


Python 3 PyQt5 requests

To install these on a debian based system, sudo apt-get install python3 python3-pyqt5 python-requests


Run python3 install


ownCloud-share-tools running on Linux as a Thunar custom action.

The GUI is designed to be used as a file browser action. To add the GUI to Thunar, open Thunar and click edit, configure custom actions, click add then in the command box enter

ocsharetools --user YourUserName --pass YourPassword --url gui --path %F

If you are connecting to an OwnCloud server that uses self-signed certificates enter

ocsharetools --user YourUserName --pass YourPassword --url gui --disable-ssl-verification --path %F

All the other text boxes can be set to whatever you want, although setting the name to ownCloud and using the ownCloud icon is recommended.

Using the CLI

$ ocsharetools --help
usage: [-h] --username USERNAME --password PASSWORD --url URL
                       {getshares,getshare,create,update,delete,gui} ...

Perform OCS Share API calls

positional arguments:
                        Available commands
    getshares           get Shares from a specific file or folder
    getshare            get a single share by id
    create              create a share
    update              update a share
    delete              delete a share by id
    gui                 run gui

optional arguments:
  -h, --help            show this help message and exit
  --username USERNAME   Your OwnCloud username
  --password PASSWORD   Your OwnCloud password
  --url URL             Your OwnCloud url, eg
                        Disables SSL verification, eg when the OwnCloud server
                        is using self-signed certificates

######Examples: Get a list of shares

ocsharetools --user Bob --pass secret --url getshares

Create a public share link with a password

ocsharetools --user Bob --pass secret --url create --path /NewDocument.odt --share-type=3 --share-password secret

Create a share with a user

ocsharetools --user Bob --pass secret --url create --path /NewDocument.odt --share-type=0 --share-with=Steve

Create a share with a group

ocsharetools --user Bob --pass secret --url create --path /NewDocument.odt --share-type=1 --share-with=Developers

Delete a share (ID number is obtained from getshares command)

ocsharetools --user Bob --pass secret --url delete 32

Update a share a share (ID number is obtained from getshares command), setting an expiry date

ocsharetools --user Bob --pass secret --url update 32 --expire-date "31-01-2015"

Get a list of shares on a server that uses self-signed certificats for SSL encryption

ocsharetools --user Bob --pass secret --url --disable-ssl-verification getshares

Using the library

# First off, import the library
from ocsharetools import *

# Initialise the library with your url, username and password
ocs = OCShareAPI('', 'Bob', 'secret')

# Create a share
share = ocs.create_share(path='/NewDocument.odt', share_type=3)

# Print share URL

# Set the expiry date to tomorrow.
import datetime
date = + datetime.timedelta(days=1)


# Delete the share


If the connection to the OwnCloud server refuses to work with the error message similar to

requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)

then the server is most likely using a self-signed certificate, which cannot be verified. In this case use the --disable-ssl-verification command line option, eg for listing the shares on the server use --username USERNAME --password PASSWORD --url URL --disable-ssl-verification getshares

You can’t perform that action at this time.