Code Monkey home page Code Monkey logo

pygett's Introduction

pyGett

About

This library provides a binding to the REST API for the file sharing service Ge.tt. Please see the Ge.tt Developer's Documentation for information on how to get an API key.

Installation

To install, use the standard python setup.py install or sudo pip install pygett

Documentation

Read the full documentation on ReadTheDocs.

Quick Usage

The API initializaton requires the following parameters to be present:

  • apikey: The API key assigned by Ge.tt for your application
  • email: The email address linked to an API key
  • password: The password linked to an API key

Example initialization:

from pygett import Gett

client = Gett(
        apikey = "apitest",
        email = "[email protected]",
        password = "secret"
)

Getting a dict of all shares:

shares = client.get_shares()
for file in shares['4ddfds'].files
    print file.filename

Getting a list of all shares:

shares = client.get_shares_list()
for share in shares:
    for file in share.files:
        print share.sharename + "\t" + file.filename + "\t" + file.size

Getting a specific share:

share = client.get_share("4ddfds")

Getting a specific file:

file = client.get_file("4ddfds", 0)

Uploading a file:

file = client.upload_file(
        filename = "test.rst",
        data = open("test.rst", "rb").read()
)

    print "File '%s' is now available at %s" % (file.filename, file.getturl)

Downloading file content:

file = client.get_file("4ddfds", 0)
open("myCopy.txt", "wb").write(file.contents())

License

Copyright (C) 2011 by Mark Allen. You may use this library under the terms and conditions of the MIT license. See the LICENSE file for full information.

pygett's People

Contributors

jadeallenx avatar v1k45 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

v1k45

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.