GithubHelp home page GithubHelp logo

joblib-s3's Introduction

Joblibs3

Travis Codecov

This package provides an AWS store backend for the joblib Memory object used for fast caching of computation results.

Initially, only local (or network shares) file systems were supported with joblib but now joblib offers the possibility to register extra store backends matching the provided StoreBackendBase API.

If you don't know joblib already, user documentation is located on https://pythonhosted.org/joblib

If you are only interested in computation result caching in joblib, the Memory documentation is available here.

The AWS S3 backend relies on the dask s3fs package.

Joblibs3 supports Python 2.7, 3.4 and 3.5.

Getting the latest code

To get the latest code use git:

git clone git://github.com/aabadie/joblib-s3.git

Installing joblibs3

Simply use pip:

$ cd joblib-s3
$ pip install -r requirements.txt .

Using joblibs3 to cache computation results in AWS S3

See the following example:

# Import the required packages
import numpy as np
from joblib import Memory
from joblibs3 import register_s3fs_store_backend
# Optionally, instantiate a session to use AWS_PROFILE from ~/.aws/config
# from aiobotocore.session import AioSession

if __name__ == '__main__':
    register_s3fs_store_backend()

    # we assume you S3 credentials are stored in ~/.aws/credentials, so no
    # need to pass them to Memory constructor.
    backend_options = dict(
        bucket='joblib-example',
        # Optional
        #session=AioSession(profile='my-profile'),
    )
    mem = Memory('joblib_cache', backend='s3', verbose=100, compress=True,
                 backend_options=backend_options)

    multiply = mem.cache(np.multiply)
    array1 = np.arange(10000)
    array2 = np.arange(10000)

    result = multiply(array1, array2)
    print(result)

This example is available in the examples directory.

joblib-s3's People

Contributors

aabadie avatar richiverse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

joblib-s3's Issues

Create a new release to pypi

The version of joblibs3 available in pypi is out of date with the code in this repo. It would be great to create a release of the latest version of this library.

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.