Caches tiles to Amazon S3.
Requires boto (2.0+):
"bucket": "<bucket name>",
"access": "<access key>",
"secret": "<secret key>"
S3 cache parameters:
Required bucket name for S3. If it doesn't exist, it will be created.
Optional access key ID for your S3 account.
Optional secret access key for your S3 account.
Optional S3 ACL policy for uploaded tiles. Default is 'public-read'.
Optional boolean flag for whether to use the locking feature on S3.
True by default. A good reason to set this to false would be the
additional price and time required for each lock set in S3.
Optional path under bucket to use as the cache dir. ex. 'cache' will
put tiles under <bucket>/cache/
If set to true, use S3's Reduced Redundancy Storage feature. Storage is
cheaper but has lower redundancy on Amazon's servers. Defaults to false.
Access and secret keys are under "Security Credentials" at your AWS account page:
When access or secret are not provided, the environment variables
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY will be used
||Methods defined here:|
- __init__(self, bucket, access=None, secret=None, use_locks=True, path='', reduced_redundancy=False, policy='public-read')
- lock(self, layer, coord, format)
- Acquire a cache lock for this tile.
Returns nothing, but blocks until the lock has been acquired.
Does nothing and returns immediately if `use_locks` is false.
- read(self, layer, coord, format)
- Read a cached tile.
- remove(self, layer, coord, format)
- Remove a cached tile.
- save(self, body, layer, coord, format)
- Save a cached tile.
- unlock(self, layer, coord, format)
- Release a cache lock for this tile.
- reduce(function, sequence[, initial]) -> value
Apply a function of two arguments cumulatively to the items of a sequence,
from left to right, so as to reduce the sequence to a single value.
For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
((((1+2)+3)+4)+5). If initial is present, it is placed before the items
of the sequence in the calculation, and serves as a default when the
sequence is empty.
- strptime(string, format) -> struct_time
Parse a string to a time tuple according to a format specification.
See the library reference manual for formatting codes (same as strftime()).
- tile_key(layer, coord, format, path='')
- Return a tile key string.
- time() -> floating point number
Return the current time in seconds since the Epoch.
Fractions of a second may be present if the system clock provides them.