Skip to main content

Orange Cloud python client

https://img.shields.io/pypi/v/orangecloud-client.svg https://img.shields.io/github/license/antechrestos/orangecloud-client.svg

This library is a python implementation of the orange cloud api It brings:

Dependencies

It is based on:

Installing

From pip

$ pip install orangecloud-client

From sources

To build the library run :

$ python setup.py install

Run the OAuth Grant code process

To start using it you must create a developer account on the orange partner platform. Then create an application. But beware on one things: the redirect url must differ from any localhost or local url. Since we want to trick it, do as follow:

  • pick a domain name such http://my-own-cloud.io:8080 (do not use https as it cannot be handled later)

  • create the application

  • map the domain my-own-cloud.io on localhost in your host file ( /etc/hosts for linux,

    %systemroot%\system32\drivers\etc\ for windows)

  • run the following code

# provide the client id and client secret got on your application page
api_manager = ApiManager(client_id, client_secret)
# in this example the redirect url  is http://myowncloud.io:8080 and /etc/hosts contains the line
# 127.0.0.1       myowncloud.io
redirect_uri = 'http://myowncloud.io:8080'
url_to_open = api_manager.init_authorize_code_process(redirect_uri=redirect_uri, state='1234')
print 'Open this URL: %s' % url_to_open
code = api_manager.wait_and_terminate_authorize_code_process()
api_manager.init_with_authorize_code(redirect_uri=redirect_uri, code=code)
print 'refresh_token got %s' % api_manager.refresh_token

This will run a local http server listening to your domain, print an url to open. Open it in your browser, log in using your cloud account, consent the access for your application. You will be then redirected to your local http server. The code will be then extracted and exchanged for a token. You can save your refresh token. Next time you can instantiate the ApiManager as follows:

api_manager = ApiManager(client_id, client_secret)
api_manager.init_with_token(refresh_token)

You are now fully able to use the api.

API

The api brings the following domains.

Freeespace

The only operation on this endpoint is the get one that returns the available free space.

Folders

This endpoint let you:

  • get the information about a folder (See the `documentation <https://developer.orange.com/apis/cloud-france/api-reference>`_ about the `query parameters`)

  • create a folder in the cloud

  • delete a folder from the cloud

  • move a folder from one folder to another

  • rename a folder

  • copy a folder in another folder

Files

This endpoint let you:

  • get the information about a file.

  • delete a file from the cloud

  • move a file from one folder to another

  • rename a file

  • copy a file in another folder

  • upload a file on the cloud

  • download a file from the cloud

Command Line interface

To run the client, enter the following command :

$ orangecloud-client

At first execution, it will ask you ask. Please note that your credentials won’t be saved on your disk: only tokens will be kept for further use. Please not that the command shell runs an interactive shell to interact with the cloud. Other commands are single command and return after finished.

Issues and contributions

Please submit issue/pull request.

Metadata

Release files for orangecloud-client 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orangecloud-client 0.0.2
File Size Uploaded Provenance Actions
orangecloud-client-0.0.2.tar.gz 12.0 kB Without provenance Details for orangecloud-client-0.0.2.tar.gz

Release files / orangecloud-client-0.0.2.tar.gz

Download URL orangecloud-client-0.0.2.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1d23b82e74e14c24f1778595f63c1380b6c6d3e2cff80058189cfb141b39f3f7
BLAKE2b-256 checksum
How to use checksums
b3fe42c152488267ded8461a2c427ed8ca673d12bb4e1d9b343d687b6c88d0a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for orangecloud-client 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

0.0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page