Skip to main content

Accessing and caching remote data.

Project description

remotedata

Accessing and caching remote data for python. May be used in the cases that:

  1. The remote data is being updated frequently
  2. You don't want to sync all the data but just per your request
  3. You want to cache the data locally for some time
  4. Especially, when the files are used for testing

Installation

pip install remotedata

Usage

Currently, data from github and dropbox are supported

Github

from remotedata import remotedata
rdata = remotedata(dict(
	source = 'github',
	cachedir = '/tmp/cached/',
	## if branch is not master: pwwang/remotedata/branch
	repos  = 'pwwang/remotedata',
	## optional, default is first part of repos
	# user = 'pwwang',
	## github token, in case you have > 60 requests per hours to github API
	# token = 'xxx',
))
readme = rdata.get('README.md')
# README.md is downloaded to /tmp/cache/github/pwwang.remotedata@master/README.md
# Now you can use it as a local file

# readme will be cached, we don't have to download it again,
# until it has been changed remotely.

# remove cached file
rdata.remove('README.md')
# clear up all caches
rdata.clear()

Dropbox

from remotedata import remotedata
rdata = remotedata(dict(
	source = 'dropbox',
	cachedir = '/tmp/cached/',
	dropbox_token = 'xxx'
))
rdata.get('/somefile') # or
rdata.get('somefile')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

remotedata-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

remotedata-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file remotedata-0.1.0.tar.gz.

File metadata

  • Download URL: remotedata-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.1 Linux/4.15.0-1028-gcp

File hashes

Hashes for remotedata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cbae0fb8483ae0330fda9938ea08dc9abfc79e833e2fc543565b58e295ab2de8
MD5 4e242ba132db47059c3447feb689def4
BLAKE2b-256 81e52c8bf09b2794e23935d21be9c169e6347446ef3ee0a45c1b9ad848176ba0

See more details on using hashes here.

File details

Details for the file remotedata-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: remotedata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.1 Linux/4.15.0-1028-gcp

File hashes

Hashes for remotedata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb06895d3954df687e50ae5b47d7070f3de451fe2c2d0c1ecd532ab22a6c0fe9
MD5 dcf64f62affff63cf52821647197299d
BLAKE2b-256 d332fb64fef1a6c27d9451555039dff2e870b269117510826b08fac8a08dee85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page