Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Python
Branch: master

Merge pull request #11 from iron-io/ulan-fix-version

corrected version in order to upgrade pip package
latest commit f68f5a5e21
@ulandj ulandj authored
Failed to load latest commit information.
.gitignore Added tests and a gitignore file.
LICENSE.txt Beginnings of the library.
MANIFEST Updated to match tests to new iron_core. Updated setup.py
MANIFEST.in Beginnings of the library.
README.md catch exception on non-existing keys when cache.get and cache.delete
iron_cache.py corrected version in order to upgrade pip package
setup.py
test.py Version bump.

README.md

IronCache Python Client

IronCache is a scalable, managed cache from Iron.io.

Getting Started

Get Credentials

To use IronCache, you need to sign up and get your OAuth token.

Install iron_cache_python

You can install iron_cache_python in two ways:

pip/easy_install

iron_cache_python is available in the Python Package Index as "iron_cache". This means you can run pip install iron_cache or easy_install iron_cache from your command line to download iron_cache_python and all its dependencies.

From Source

You can also download the source from Github. Once you have the source, you can run python setup.py install from the directory containing the source code to install iron_cache_python.

Note: You will need the iron_core_python module for iron_cache_python to function.

Configure Your Client

iron_cache_python conforms to the standard Iron.io configuration scheme that all official libraries use. This means your config files will work across languages and products.

Put Items In the Cache

from iron_cache import *

cache = IronCache()
item = cache.put(cache="test_cache", key="mykey", value="Hello IronCache!")
print item.value

Get an Item In the Cache

from iron_cache import *

cache = IronCache()
try:
    item = cache.get(cache="test_cache", key="mykey")
except:
    item = None    
print item.value if item else print None

Increment an Item's Value

from iron_cache import *

cache = IronCache()
cache.increment(cache="test_cache", key="mykey", amount=10)

Delete an Item From the Cache

from iron_cache import *

cache = IronCache()
try:
    cache.delete(cache="test_cache", key="mykey")
except:
   pass

License

This software is released under the BSD 2-Clause License. You can find the full text of this license under LICENSE.txt in the module's root directory.

More Documentation & Support

More documentation can be found in the Iron.io Dev Center.

Iron.io offers a public support chatroom that is staffed by employees around the clock. We would be more than happy to assist you.

Something went wrong with that request. Please try again.