### Install pyocclient Source: https://github.com/owncloud/pyocclient/blob/master/README.md Install the pyocclient library using pip. This command is used for initial setup. ```bash pip install pyocclient ``` -------------------------------- ### Install and Test pyocclient Source: https://github.com/owncloud/pyocclient/blob/master/agents.md Install the library in development mode and run tests using the provided script. Ensure you have Python installed. ```bash pip install -e . bash runtests.sh ``` -------------------------------- ### Install unittest-data-provider Source: https://github.com/owncloud/pyocclient/blob/master/docs/source/README.md Install the unittest-data-provider package, which may be required for running unit tests. ```bash pip install unittest-data-provider ``` -------------------------------- ### Install pyocclient Development Version Source: https://github.com/owncloud/pyocclient/blob/master/docs/source/README.md Manually install the development version of pyocclient from a git clone. ```bash pip install requests git clone https://github.com/owncloud/pyocclient.git cd pyocclient python setup.py install ``` -------------------------------- ### Upload File and Share via Link Source: https://github.com/owncloud/pyocclient/blob/master/docs/source/README.md Example demonstrating how to connect to an ownCloud instance, upload a file, and then share it via a public link. Ensure you have a local file named 'localfile.txt' to upload. ```python 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() ``` -------------------------------- ### Upload File to Public Shared Folder Source: https://github.com/owncloud/pyocclient/blob/master/docs/source/README.md Upload a file to a folder that is accessible via a public link. This example assumes the public link is already set up. ```python import owncloud public_link = 'http://domain.tld/owncloud/A1B2C3D4' oc = owncloud.Client.from_public_link(public_link) oc.drop_file('myfile.zip') ``` -------------------------------- ### Build Documentation with Sphinx Source: https://github.com/owncloud/pyocclient/blob/master/docs/source/README.md Commands to build the project documentation using Sphinx. This involves running sphinx-apidoc and then making the HTML output. ```bash sphinx-apidoc -e -f -o docs/source owncloud/ owncloud/test cd docs make html ``` -------------------------------- ### Basic pyocclient Usage Source: https://github.com/owncloud/pyocclient/blob/master/README.md Connect to an ownCloud instance, log in, upload a file, and list directory contents. Ensure you replace placeholder URLs and credentials with your actual ownCloud instance details. ```python import owncloud oc = owncloud.Client('http://your-owncloud-instance.example.com/') oc.login('user', 'password') # Upload a file oc.put_file('remote/path/file.txt', 'local/file.txt') # List directory for item in oc.list('/'): print(item) ``` -------------------------------- ### Run Unit Tests Source: https://github.com/owncloud/pyocclient/blob/master/docs/source/README.md Execute the unit tests for the pyocclient library using the provided script. Ensure a config file 'owncloud/test/config.py' is set up. ```bash ./runtests.sh ``` -------------------------------- ### Run pyocclient Tests Source: https://github.com/owncloud/pyocclient/blob/master/README.md Execute the test suite for the pyocclient library. This script is used to verify the library's functionality. ```bash bash runtests.sh ``` -------------------------------- ### Download File from Public Shared Folder with Password Source: https://github.com/owncloud/pyocclient/blob/master/docs/source/README.md Download a file from a public shared folder that is protected by a password. This requires providing both the public link and the folder password. ```python 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') ``` -------------------------------- ### Commit with Signed-off-by and GPG Signature Source: https://github.com/owncloud/pyocclient/blob/master/README.md Commit changes to the repository, ensuring each commit is signed-off and PGP/GPG signed. This is a mandatory workflow requirement for contributions. ```bash git commit -s -S -m "your commit message" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.