Coder Social home page Coder Social logo

python-oos-example's Introduction

Using Outscale Object Storage with Python

Project Sandbox

This small example project shows how to use OOS using standard boto3 library.

Running this example will:

  • Create a Bucket with a random name
  • Put a string inside an object inside the bucket
  • Read back that object
  • Delete the object
  • Delete the bucket

Pre-requisites

You will need:

Running the example

  1. (optional) Setup your virtual env:
virtualenv -p python3 .venv
source .venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Setup your credentials and region:
export OSC_REGION="eu-west-2"
export OSC_ACCESS_KEY="MyAccessKey"
export OSC_SECRET_KEY="MySecretKey"
  1. Run the example:
> python src/main.py

You should have a similar output:

> python src/main.py
creating private bucket named bucket-test-voxa...
bucket bucket-test-voxa created
writing 'Hello World' to public my-data object...
writed to bucket-test-voxa object
reading my-data object...
read object ok: b'Hello World'
deleting my-data object...
deleted my-data object
deleting bucket named bucket-test-voxa...
bucket bucket-test-voxa delete

Check main.py to see how it is done.

Contribution guidelines

Feel free to open an issue for discussion or bug report.

License

Copyright Outscale SAS

BSD-3-Clause

python-oos-example's People

Contributors

jerome-jutteau avatar

Stargazers

André Tran avatar

Watchers

Matthias Gatto avatar  avatar  avatar  avatar André Tran avatar

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.