Skip to main content

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!

Metadata

Release files for fritter 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fritter 0.1.1
File Size Uploaded
fritter-0.1.1.tar.gz 41.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fritter 0.1.1
File Interpreter ABI Platform
fritter-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 91.1 kB

Release files / fritter-0.1.1.tar.gz

Download URL fritter-0.1.1.tar.gz
Size 41.2 kB
Tags Source
SHA-256 checksum
How to use checksums
74538a4d0b132b8c015ec373ee5fa883340c41e67dafc35cf2495719995690a2
BLAKE2b-256 checksum
How to use checksums
830aa1002acfa31c4ce525b550475aef3ffb859d67cdf266b6b88c2ad3d7a90e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.10

Release files / fritter-0.1.1-py3-none-any.whl

Download URL fritter-0.1.1-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2c4c3769fe317f0411deb1509eb03e595b076af8bd6b988b77b2c2a0115039d
BLAKE2b-256 checksum
How to use checksums
a1240ae7fd1c020b8debd8ad027fdbbaa4b34a9fba2c7f927f00071de0b05da9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.10

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page