Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.12 KB

README.md

File metadata and controls

55 lines (40 loc) · 1.12 KB

datastore.cloudfiles

Rackspace Cloud Files implementation of Datastore.

Install

From PyPI (using pip):

pip install datastore.cloudfiles

From PyPI (using setuptools):

easy_install datastore.aws

From source:

git clone https://github.com/boilerroomtv/datastore.cloudfiles
cd datastore.cloudfiles
python setup.py install

Quickstart

>>> import datastore.cloudfiles
>>> import pyrax
>>>
>>> pyrax.set_setting('identity_type', 'rackspace')
>>> pyrax.set_default_region(RACKSPACE_REGION)
>>> pyrax.set_credentials(RACKSPACE_USERNAME, RACKSPACE_API_KEY)
>>> container = pyrax.cloudfiles.create_container(self.container_name)
>>> ds = datastore.cloudfiles.RackspaceCloudFilesDatastore(self.container)
>>>
>>> hello = datastore.Key('hello')
>>> ds.put(hello, 'world')
>>> ds.contains(hello)
True
>>> ds.get(hello)
'world'
>>> ds.delete(hello)
>>> ds.get(hello)
None

License

Original code in datastore.cloudfiles is licensed under the Mozilla Public License 2.0.