Skip to main content

Fritter, the Frame-Rate IndependenT TimEr tRee.

Project description

FRITTer

Frame-Rate IndependenT TimEr tRee

Welcome to Fritter, a generalized Python library for interacting with work that needs to occur over time, whether physical time (i.e. numbers of seconds) or civil time (i.e. numbers of days, weeks, months, or years).

Get It Now

What Is It, and Why Do I Need It?

Fritter is a one-stop clock shop, allowing you to schedule over very short or very long periods of time. Wherever you need something to happen in the future, Fritter has something for you. Here are just some of the use-cases:

  • If you have an algorithm that processes work over time and you want a unified interface to be able to deploy it across a variety of event loops, take a look at fritter.drivers, where you will find drivers that support Twisted, asyncio, as well as ones for scheduled events executing in batch scripts or CLI tools that don't need an event loop at all, supplying a small wrapper around time.sleep.

  • Do you want to write fast, deterministic tests for that code, without pulling in any of those frameworks or calling sleep? Fritter comes with a robust in-memory driver perfect for unit testing, or for any scenario where you need precise control.

  • Do you have a demanding application with large numbers of timers that is straining the naive implementation of your favorite library? Fritter allows you to bring your own custom priority queue implementation for these high-performance edge cases.

  • Do you need to schedule a very high-frequency timer, whose rate is measured in Hz, to update a system that needs to stay synchronized with real time, such as an interactive animation, real-time simulation, or delivery of samples to an audio device? fritter.repeat has got you covered, with an interface that allows you to achieve its titular frame-rate independence.

  • Do you need to schedule a very low-frequency timer, whose rate is measured in weeks or months, something that runs so infrequently or so far in the future that the current process will almost certainly no longer be running? Schedule your timer in terms of datetime-ish objects, then serialize it with fritter.persistent.jsonable to load it again when your process restarts. fritter.persistent is careful to supply an interface using IANA identifiers to maintain correctness in the face of future DST changes, and other things that can start to complicate the use of time over longer periods.

  • Do you need to manage groups of related timers, sometimes pausing some groups while allowing others to continue, while all running on the same loop; like how the "pause" button on a video game stops the action but doesn't stop the UI? fritter.tree will allow you to nest your groups arbitrarily deeply.

If any of these sound interesting, pip install fritter to try it out today!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fritter-0.0.9.tar.gz (63.4 kB view details)

Uploaded Source

Built Distribution

fritter-0.0.9-py3-none-any.whl (48.6 kB view details)

Uploaded Python 3

File details

Details for the file fritter-0.0.9.tar.gz.

File metadata

  • Download URL: fritter-0.0.9.tar.gz
  • Upload date:
  • Size: 63.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for fritter-0.0.9.tar.gz
Algorithm Hash digest
SHA256 56977c04c23893317059fb90a2ac65a371709decc4877649d4d6a9716bb1663a
MD5 f754a8c265a020db68e032a23785f21c
BLAKE2b-256 7f4fb985a4f8e77ff43ecef6fb391a011a3d0ac82f7c43586b26a975773f2ff6

See more details on using hashes here.

File details

Details for the file fritter-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: fritter-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 48.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for fritter-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 56e1cf4aa990ea7f188629800f4eec4eede0bd35d4a56e67209cd4a3d4ef8677
MD5 d6e5e6b103d5df63ddd6ce17ca32d7b1
BLAKE2b-256 be8d3a3df078d211117ea0c8cb08137cb792d31d46101591cb87ab8359e0c1dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page