This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Egnyte SDK

This is the official Python client library for Egnyte’s Public APIs. For overview of the HTTP API, go to https://developers.egnyte.com

Getting an API key

Register on https://developers.egnyte.com/member/register to get API key for your Egnyte account. This key is required to generate an Egnyte OAuth token.

Examples

  • Include this library
  • Generate an access token
  • Create a client object
client = egnyte.EgnyteClient({"domain": "apidemo.egnyte.com",
    "access_token": "68zc95e3xv954u6k3hbnma3q"})
  • Create a folder
folder = client.folder("/Shared/new").create(ignore_if_exists=True)
  • Delete a folder
client.folder("/Shared/time to say goodbye").delete()
  • Get a list of files in a folder, download a file, replace it’s contents, add a note
folder = client.folder("/Shared/foo that need to be bar")
folder.list()
for file_obj in folder.files:
    with file_obj.download() as download:
        data = download.read()
    # replace file contents
    file_obj.upload(data.replace(b"foo", b"bar"))
    file_obj.add_note("all occurrences of 'foo' replaced by 'bar'!")
  • Get a list of files in a subfolders
folder = client.folder("/Shared")
folder.list()
for folder_obj in folder.folders:
    do_something(folder_obj)
  • Upload a new file from local file
file_obj = client.file("/Private/smeagol/my precious")
with open("local path", "rb") as fp:
    file_obj.upload(fp)
  • Delete a file
file_obj.delete()
  • Do a recursive download
client.bulk_download(['/Shared/a dir', '/Shared/another dir'],
    '/home/smeagol/', overwrite=True)
  • Do a recursive upload
client.bulk_upload(['/tmp/some directory', '/tmp/some file'], '/Shared/Marketing')
  • Search for files
import datetime
results = api.search.files('"some text" OR "other text"', folder='/Shared', modified_after=datetime.date(2015, 1, 15))
  • Get and process events from server
events = api.events.filter(folder='/Shared', suppress='user')
old_events = events.list(events.latest_event_id - 10, count = 10) # get events in batches
future_events = iter(events)
for event in future_events: # polls server continously, iterator over single events, iterator will never end
    do_something(event)
    if condition(event):
        break

Full documentation

The docs subdirectory contains just the source for the documentation. You can read the documentation at http://egnyte.github.io/python-egnyte-docs/

Command line

If you’re using implicit flow, you’ll need to provide access token directly. If you’re using API token with resource flow, you can generate API access token using command line options. See the full documentation or install, then use:

python -m egnyte -h

Dependencies

This library depends on:

  • requests 2.2.1 or later - for HTTPS calls
  • six 1.8.0 or later - for Python 2 and 3 compatibility using same source

Thread safety

Each client object should be used from one thread at a time. This library does no locking of it’s own - it is responsibility of the caller to do so if necessary.

Running tests

Tests can be run with nose or trial directly on the egnyte package, or from setup.py:

python setup.py test

or

python setup.py nosetests

Integration tests will be skipped unless you create ~/.egnyte/test_config.json You can create this file manually or with following command:

python -m egnyte -c test_config.json config create -k -d -l [-p ]

Helping with development

First, report any problems you find to https://developers.egnyte.com/forum/ or api-support@egnyte.com

If you’d like to fix something yourself, please fork this repository, commit the fixes and updates to tests, then set up a pull request with information what you’re fixing.

Please remember to assign copyright of your fixes to Egnyte or make them public domain so we can legally merge them.

Release History

Release History

0.5.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4beta

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
egnyte-0.5.1-py2.7.egg (82.9 kB) Copy SHA256 Checksum SHA256 any Egg Dec 7, 2016
egnyte-0.5.1-py2.py3-none-any.whl (37.5 kB) Copy SHA256 Checksum SHA256 any Wheel Dec 7, 2016
egnyte-0.5.1.tar.gz (30.1 kB) Copy SHA256 Checksum SHA256 Source Dec 7, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting