Questions tagged [dogpile.cache]

dogpile.cache is a Python package that provides a caching pattern based on dogpile.core locking system and is intended to replace Beaker as far as caching goes.

Using this tag

Use this tag for all questions related to dogpile.cache and interfacing with supported caching backends.

Documentation

Documentation of the project can be found here.

13 questions
7
votes
1 answer

Caching a downloaded file based on modified time using dogpile

I'm writing a program that downloads a large file (~150MB) and parses the data into a more useful text format file. The process of downloading, and especially parsing, are slow (~20 minutes in total), so I'd like to cache the result. The result of…
Jon
  • 9,815
  • 9
  • 46
  • 67
3
votes
0 answers

dogpile.cache 'No module named fcntl' error

I'm using Python 2.7 with SQLAlchemy. I'm trying to see if I can use Dogpile.Cache. I've installed dogpile cache using pip install dogpile.cache but when I try to run the example given by SQLAlchemy (helloworld.py) I keep getting ImportError: No…
monty_bean
  • 494
  • 5
  • 25
3
votes
1 answer

Test if a function/region is cached in Beaker/Dogpile

Using the python modules Beaker or Dogpile for caching, is it possible to test if a region with a particular key value is already present in the cache or not?
drarmstr
  • 680
  • 1
  • 8
  • 16
1
vote
0 answers

Return the value in case of pickle serialization exception instead of failing the whole call

from dogpile.cache import make_region TIMEOUT_SECONDS = 10 * 60 def my_key_generator(namespace, fn): fname = fn.__name__ def generate_key(*arg): key_template = fname + "_" + "_".join(str(s) for s in arg) return…
user
  • 5,335
  • 7
  • 47
  • 63
1
vote
1 answer

Check if variable is set to NO_VALUE

I am using dogpile to have cache in my python program. During the init of my program, I clean the cache SimpleCache.set_fault_injector(NO_VALUE) @staticmethod def set_fault_injector(injector): SimpleCache.save("fault_injector", injector) Then I…
xeon123
  • 819
  • 1
  • 10
  • 25
1
vote
1 answer

SqlAlchemy cache with dogpile

I have three models with inheritance and relationship and I want to cache query to this models. class Person(Base): __tablename__ = 'person' id = Column(Integer, primary_key=True) name = Column(String(100), nullable=False) type =…
aborilov
  • 7,416
  • 3
  • 21
  • 20
0
votes
0 answers

Python "wetterdienst" module: using with local files?

I am currently using the wetterdienst module with the DWD (Deutscher Wetterdienst, Germany's National Meteorological Service) server for retrieving e.g. MOSMIX data (weather forecasts). For training an ML model with forecasts dating back more than a…
Stefan
  • 1,036
  • 10
  • 32
0
votes
2 answers

Handling dogpile.cache decorator exceptions

I'm using dogpile.cache in a Python project, with a pylibmc based backend. After creating a region I use something like: @region.cache_on_arguments() def run_some_query(**kwargs): # ... Query code ... return query_results My problem is,…
Marius
  • 403
  • 4
  • 9
0
votes
1 answer

Differences between pylibmc, dbm, and memcached in dogpile.cache

I am new to caching in Python and unable to understand the differences between dogpile.cache.dbm, dogpile.cache.pylibmc, and dogpile.cache.memcached. Could someone please explain it?
archura
  • 1,053
  • 1
  • 10
  • 12
0
votes
0 answers

Caching column_property in sqlalchemy model via dogpile

I wonder if there is a chance to cache column_property using dogpile. This is my code: A.some_count = column_property( select([func.count()]) .where(and_(B.__table__.c.a_id == A.__table__.c.id, B.__table__.c.c_id ==…
Rogalek
  • 50
  • 10
0
votes
1 answer

dogpile memory backend independent from web server

I'm trying to avoid having to requery and reprocess data for the cache every time the server reloads in development (pyramid framework). Is there an easy way to set up dogpile's memory backend, dogpile.cache.memory, so that its persistence is…
user3747260
  • 465
  • 1
  • 5
  • 14
0
votes
1 answer

Can't have a global cache

I have defined this cache file with dogpile [1]. But my problem is that when I invoke the key in different classes, it can't find the value. Eg, If I am running cache.Cache.save("mykey", 123) in the main.py, and during the execution I am retrieving…
xeon123
  • 819
  • 1
  • 10
  • 25
0
votes
2 answers

Disable cache decorator for testing for dogpile.cache

I recently switched from beaker to dogpile.cache. It works very well in live code but I am running into an issue with testing. How do I disable the caching for testing? I am currently using #caching.py from dogpile.cache import make_region region =…
sasker
  • 2,221
  • 2
  • 21
  • 26