GithubHelp home page GithubHelp logo

python3-pcloudapi's Introduction

=========
PCloudAPI
=========

PCloudAPI is a python3 library for accessing the pcloud.com API.
It supports both the binary and the json protocols.

Homepage: https://github.com/tochev/python3-pcloudapi

Changelog
========
 - v0.0.3
    - [Security] Do not allow redirects and enforce pcloud domain
 - v0.0.2
    - Fix connection without SSL (not using SSL is strongly discouraged)
 - v0.0.1 - Initial public version

Examples
========

    >>> from pcloudapi import PCloudAPI
    >>> api = PCloudAPI()
    >>> api.login('[email protected]', '1337pass')
    'Ec7QkEjFUnzZ7Z8W2YH1qLgxY7gGvTe09AH0i7V3kX'
    >>> api.make_request('listfolder', path='/')['metadata']['icon']
    'folder'
    >>> api.upload('/tmp/quotes.txt', '/test.txt')


For more see examples/

Status
======

This is a working prototype and is highly experimental. Things might change.
Use at your own risk.

The JSON connection is to be considered safer, although on upload it reads the
whole file into memory which can be a problem (this is due to a limitation of
the python requests library).

Installation
============

    sudo apt-get install python3 python3-requests python3-setuptools
    git clone https://github.com/tochev/python3-pcloudapi
    cd pcloudapi
    python3 setup.py install

python3-pcloudapi's People

Contributors

tochev avatar

Stargazers

Scott Ivey avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

python3-pcloudapi's Issues

Connections without SSL fail

If I create a connection with use_flag = false, the code raises an exception.

The line of code to fix is:

 #utils.py:111
 match_hostname(sock.getpeercert(), server)

Adding an if statement resolve the issue. So

...
if use_ssl:
    sock = context.wrap_socket(sock, server_hostname=server)
sock.connect(sa)
if use_ssl:
    match_hostname(sock.getpeercert(), server)
return sock
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.