{"id":25487840,"url":"https://github.com/7urkm3n/pcloud","last_synced_at":"2025-04-09T22:20:33.479Z","repository":{"id":47194248,"uuid":"291566513","full_name":"7urkm3n/pcloud","owner":"7urkm3n","description":"pCloud's Ruby SDK","archived":false,"fork":false,"pushed_at":"2024-03-03T18:38:44.000Z","size":83,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T00:11:47.333Z","etag":null,"topics":["pcloud","pcloud-api","rails","ruby"],"latest_commit_sha":null,"homepage":"https://docs.pcloud.com","language":"Ruby","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/7urkm3n.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-30T23:03:43.000Z","updated_at":"2023-04-28T15:07:26.000Z","dependencies_parsed_at":"2024-08-22T21:34:20.918Z","dependency_job_id":"15e6d19c-f259-424f-be57-d37df00b1fbc","html_url":"https://github.com/7urkm3n/pcloud","commit_stats":{"total_commits":56,"total_committers":7,"mean_commits":8.0,"dds":0.5178571428571428,"last_synced_commit":"f7afe973435908531197f3b0fddab64b9905e147"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7urkm3n%2Fpcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7urkm3n%2Fpcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7urkm3n%2Fpcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7urkm3n%2Fpcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/7urkm3n","download_url":"https://codeload.github.com/7urkm3n/pcloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247631834,"owners_count":20970069,"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":["pcloud","pcloud-api","rails","ruby"],"created_at":"2025-02-18T20:28:16.620Z","updated_at":"2025-04-09T22:20:33.455Z","avatar_url":"https://github.com/7urkm3n.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gem for Pcloud cloud storage\n\nThis Gem provides a Ruby interface to [Pcloud.com](https://docs.pcloud.com).\n\n[![Build Status](https://github.com/7urkm3n/pcloud/workflows/release/badge.svg?branch=main)](https://github.com/7urkm3n/pcloud/actions?query=workflow%3Arelease) [![Gem Downloads](https://badgen.net/rubygems/dt/pcloud)](https://rubygems.org/gems/pcloud) [![Gem Version](https://badge.fury.io/rb/pcloud.svg)](https://badge.fury.io/rb/pcloud)\n\n\u003c!-- [![Gem Version](https://badgen.net/rubygems/v/pcloud)](https://rubygems.org/gems/pcloud) --\u003e\n\n##### Want to contribute? [Doc Link](CONTRIBUTE.md)\n\n## Installation and Configuration\n\u003cfont size=3\u003eSupported Ruby versions: \u003cb\u003e2.3+\u003c/b\u003e \u003c/font\u003e\n\nAdd `pcloud` to your Gemfile, and then run `bundle install`\n\n```ruby\ngem 'pcloud'\n```\n\nor install via gem\n\n```bash\ngem install pcloud\n```\n\n###### Rails\n\nto generate `Rails` initializer file\n\n```bash\nrails generate pcloud\n```\n\nor add it manually into following path\n\n```bash\nconfig/initializers/pcloud.rb\n```\n\n### Instantiating a client\n\n```ruby\nrequire 'pcloud'\n\npcloud = Pcloud::Client.new(\n  username: 'email',\n  password: 'password',\n).authenticate\n\npcloud.get(\"listfolder\", folderid: 0)\n```\n\nNote that, [as per official API docs](https://docs.pcloud.com/):\n\n\u003epCloud has two data centers. One in United States and one in Europe.\n\u003eAs a consequence API calls have to be made to the correct API host name depending were the user has been registered – api.pcloud.com for United States and eapi.pcloud.com for Europe.\n\nThe default region used is `https://api.pcloud.com` (US). To use a different region, specify a different `base_url` parameter (EU region: `https://eapi.pcloud.com`) when instantiating a client, e.g.:\n\n```ruby\nrequire 'pcloud'\n\npcloud = Pcloud::Client.new(\n  username: 'email',\n  password: 'password',\n  base_url: \"https://eapi.pcloud.com\",\n).authenticate\n\npcloud.get(\"listfolder\", folderid: 0)\n```\n\n### Global configuration\n\nThe library can also be configured globally on the `Pcloud` class.\n\n```ruby\nPcloud.username = 'email'\nPcloud.password = 'password'\nPcloud.authenticate\n\nPcloud.get(\"listfolder\", folderid: 0)\n```\n\n### Logging\n\nBy default errors are logged in STDOUT level, also `Rails.logger` available.\n\n```ruby\nPcloud.logger = Rails.logger\n```\n\n### Working with methods\n\nAvailable methods:\n\n- \u003cb\u003e Get \u003c/b\u003e\n- \u003cb\u003e Post \u003c/b\u003e\n- \u003cb\u003e File handling \u003c/b\u003e\n\n###### addition!\n\n\u003e Some apis need to be `raw` format, just add `raw` in params. `params: {fileid: ..987, raw: true}`\n\u003e For example `gettextfile` https://docs.pcloud.com/methods/streaming/gettextfile.html\n\n#### Get method\n\n```ruby\nPcloud.get(\"getip\")\nPcloud.get(\"getdigest\")\n\n# with params\nparams = {folderid: 0}\nPcloud.get(\"listfolder\", params)\n```\n\n#### Post method\n\n```ruby\npayload = {}\nparams = {folderid: 0, name: \"new folder name\"}\nPcloud.post(\"createfolder\", payload, params)\n```\n\n### [File methods](https://docs.pcloud.com/methods/file/)\n\n##### [Download File](https://docs.pcloud.com/methods/file/downloadfile.html)\n\n```ruby\n# optional params: filename, destination\n# destination by default current_path\nPcloud.file.download({fileid: 987532135})\n\nPcloud.file.download(\n  fileid: 987532135,                   #required\n  destination: \"#{Dir.pwd}/Downloads\", #optional\n  filename: \"hehe.txt\"                 #optional\n)\n```\n\n##### [Download Folder](#)\n\n```ruby\n# optional params: filename, destination\n# destination by default current_path\nPcloud.file.download_folder({folderid: 123456789})\n```\n\n##### [Upload File](https://docs.pcloud.com/methods/file/uploadfile.html)\n\n```ruby\nparams = {\n  folderid: 0,  #required\n  nopartial: 1,\n}\n# multiple uploads\nfile1 = File.open(\"./Rakefile\")\nfile2 = File.open(\"./README.md\")\nfile3 = File.open(\"./Gemfile\")\npayload = { files: [file1,file2,file3] }\n\nPcloud.file.upload(params, payload)\n```\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7urkm3n%2Fpcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F7urkm3n%2Fpcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7urkm3n%2Fpcloud/lists"}