{"id":19617175,"url":"https://github.com/tomgross/pcloud","last_synced_at":"2025-05-16T14:07:35.339Z","repository":{"id":45365257,"uuid":"77771832","full_name":"tomgross/pcloud","owner":"tomgross","description":"A Python implementation of the pCloud API","archived":false,"fork":false,"pushed_at":"2025-02-02T18:26:12.000Z","size":195,"stargazers_count":100,"open_issues_count":4,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-12T11:55:39.698Z","etag":null,"topics":["api-client","pcloud","pcloud-api","pcloud-client","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomgross.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"tomgross","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://paypal.me/tomgross42"]}},"created_at":"2017-01-01T08:40:43.000Z","updated_at":"2025-02-26T13:13:41.000Z","dependencies_parsed_at":"2024-06-19T01:43:36.218Z","dependency_job_id":"2d899674-aeaf-4a71-8bbd-988e83ff6f98","html_url":"https://github.com/tomgross/pcloud","commit_stats":null,"previous_names":["tomgross/pcloud"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomgross%2Fpcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomgross%2Fpcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomgross%2Fpcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomgross%2Fpcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomgross","download_url":"https://codeload.github.com/tomgross/pcloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544146,"owners_count":22088807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","pcloud","pcloud-api","pcloud-client","python"],"created_at":"2024-11-11T11:02:21.240Z","updated_at":"2025-05-16T14:07:35.320Z","avatar_url":"https://github.com/tomgross.png","language":"Python","funding_links":["https://github.com/sponsors/tomgross","https://paypal.me/tomgross42"],"categories":[],"sub_categories":[],"readme":"==============================================================================\npcloud - A Python API client for pCloud\n==============================================================================\n\n.. image:: https://github.com/tomgross/pcloud/actions/workflows/pcloud-test.yml/badge.svg\n    :target: https://github.com/tomgross/pcloud/actions\n\nThis Python **(Version \u003e= 3.6 only!)** library provides a Python API to the pCloud storage.\n\nFeatures\n========\n\n- Can be used as a library\n- Provides a PyFileSystem implementation\n\nExamples\n========\n\nUsage of API\n------------\n\n \u003e\u003e\u003e from pcloud import PyCloud\n \u003e\u003e\u003e pc = PyCloud('email@example.com', 'SecretPassword')\n \u003e\u003e\u003e pc.listfolder(folderid=0)\n\nUse alternate endpoints (*API calls have to be made to the correct API host name depending were the user has been\nregistered – api.pcloud.com for United States and eapi.pcloud.com for Europe.*)\n\n \u003e\u003e\u003e from pcloud import PyCloud\n \u003e\u003e\u003e pc = PyCloud('email@example.com', 'SecretPassword', endpoint=\"eapi\")\n \u003e\u003e\u003e pc.listfolder(folderid=0)\n\nPyCloud also provides an API method to retrieve the nearest API server, which gives\nyou a speed gain for some API operations. To use PyCloud with this feature create\nthe PyCloud-object with the *nearest* endpoint parameter:\n\n \u003e\u003e\u003e from pcloud import PyCloud\n \u003e\u003e\u003e pc = PyCloud('email@example.com', 'SecretPassword', endpoint=\"nearest\")\n \u003e\u003e\u003e pc.listfolder(folderid=0)\n\nBinary protocol\n+++++++++++++++\n\npCloud supports JSON and binary format to access its API. By default\nthe Python pCloud API uses the JSON protocol. To make use of the\nbinary protocol you need to specify the according endpoints.\n\nFor United States server location:\n\n \u003e\u003e\u003e pc = PyCloud('email@example.com', 'SecretPassword', endpoint=\"binapi\")\n\nFor Europe server location:\n\n \u003e\u003e\u003e pc = PyCloud('email@example.com', 'SecretPassword', endpoint=\"bineapi\")\n\nThe API methods and parameters are identical for both protocols.\n\nOAuth 2.0 authentication\n------------------------\n\nTo use OAuth 2.0 authentication you need to create an App in pCloud (https://docs.pcloud.com/my_apps/).\n\nAdd the following redirect URI http://localhost:65432/\n(Make sure port 65432 is available on your machine. Otherwise you need to adjust the `PORT` in oauth2.py)\n\nNote! To see the redirect URI in the settings of pCloud you have to log out and log in again.\n\nOnce you finished adding the app and setting the redirect URI you are ready to use\nOAuth 2.0 with PyCloud on your machine. For the communication with pCloud PyCloud uses the\nbuiltin `webserver`-module. This means you need a real browser on your system available.\n\n \u003e\u003e\u003e from pcloud import PyCloud\n \u003e\u003e\u003e pc = PyCloud.oauth2_authorize(client_id=\"XYZ\", client_secret=\"abc123\")\n \u003e\u003e\u003e pc.listfolder(folderid=0)\n\nHeadless mode\n+++++++++++++\n\nOAuth 2.0 is designed to use a browser for the authentication flow. Nevertheless Selenium\ncan be used to automate this process. For an example see the `pycloud_oauth2`-fixture in `test_oauth2.py`.\nThis method will not integrated as main functionality, since there are too many dependencies.\nYou can use it as example for your usecase.\n\nUploading files\n---------------\n\na) from filenames:\n\n  \u003e\u003e\u003e pc.uploadfile(files=['/full/path/to/image1.jpg', '/Users/tom/another/image.png'],\n  ...     path='/path-to-pcloud-dir')\n\nb) from data:\n\n  \u003e\u003e\u003e import io\n  \u003e\u003e\u003e from PIL import Image\n  \u003e\u003e\u003e img = Image.open('image.jpg', 'r')\n  \u003e\u003e\u003e bio = io.BytesIO()\n  \u003e\u003e\u003e img.save(bio, format='jpeg')\n  \u003e\u003e\u003e pc.uploadfile(data=bio.getvalue(), filename=\"image.jpg\", path='/path-to-pcloud-dir')\n\nSearching files\n---------------\n\nThe pCloud-API allows searching files, even this is not documented in the official\npCloud documentation.\n\n  \u003e\u003e\u003e pcapi.search(query=\"foo\", offset=20, limit=10)\n\nPyFilesystem integration\n++++++++++++++++++++++++\n\nUsage of PyFilesystem with opener\n\n  \u003e\u003e\u003e from fs import opener\n  \u003e\u003e\u003e opener.open_fs('pcloud://email%40example.com:SecretPassword@/')\n  \u003cpCloudFS\u003e\n\nOpener of eapi endpoint\n\n  \u003e\u003e\u003e from fs import opener\n  \u003e\u003e\u003e opener.open_fs('pcloud+eapi://email%40example.com:SecretPassword@/')\n  \u003cpCloudFS\u003e\n\nCopying files from Linux to pCloud using PyFilesystem\n\n  \u003e\u003e\u003e from fs import opener, copy\n  \u003e\u003e\u003e with opener.open_fs('pcloud://email%40example.com:SecretPassword@/') as pcloud_fs:\n  \u003e\u003e\u003e    with opener.open_fs('/opt/data_to_copy') as linux_fs:\n  \u003e\u003e\u003e        copy.copy_file(src_fs=linux_fs,\n  \u003e\u003e\u003e                       src_path='database.sqlite3',\n  \u003e\u003e\u003e                       dst_fs=pcloud_fs,\n  \u003e\u003e\u003e                       dst_path='/backup/server/database.sqlite3')\n\nCopy directory from Linux to pCloud using PyFilesystem\n\n  \u003e\u003e\u003e from fs import opener, copy\n  \u003e\u003e\u003e with opener.open_fs('pcloud://email%40example.com:SecretPassword@/') as pcloud_fs:\n  \u003e\u003e\u003e    with opener.open_fs('/opt/data_to_copy') as linux_fs:\n  \u003e\u003e\u003e        copy.copy_dir(src_fs=linux_fs,\n  \u003e\u003e\u003e                      src_path='database/',\n  \u003e\u003e\u003e                      dst_fs=pcloud_fs,\n  \u003e\u003e\u003e                      dst_path='/backup/database/')\n\nFurther Documentation\n=====================\n\nImplements the pCloud API found at https://docs.pcloud.com/\n\n\nInstallation\n============\n\n $ pip install pcloud\n\nInstallation with PyFilesystem support\n\n $ bin/pip install pcloud[pyfs]\n\non zsh (Mac):\n\n $ bin/pip install \"pcloud[pyfs]\"\n\n\nDevelopment\n===========\n\nFor testing purposes a mock server is provided. To use this mock server\nyou need to add a file with the same name as the method + the `.json` suffix\nin the tests/data directory (like `getdigest.json`).\nThe file contains the expected JSON result.\n\nContribute\n==========\n\n- Issue Tracker: https://github.com/tomgross/pcloud/issues\n- Source Code: https://github.com/tomgross/pcloud\n\nLicense\n=======\n\nThe project is licensed under MIT (see LICENSE).\n\nContributors\n============\n\n- Tom Gross, itconsense@gmail.com\n- Massimo Vannucci (blasterspike)\n- Yennick Schepers (yennicks)\n- olokelo\n- qo4on\n\n.. include:: CHANGES.rst\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomgross%2Fpcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomgross%2Fpcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomgross%2Fpcloud/lists"}