Timer classes with a focus on periodic timing in while loops
Reason this release was yanked:
unstable API
Project description
TickPy
Timer classes with a focus on periodic timing in while loops.
Usage
I use this module when I'm working with finite state machines, or in other words programs where the main function is a long-running while loop. My applications are usually pretty simple; most often I'm prototyping what will become a C program on a chip in python - this module lets me approximate that scenario pretty quickly.
It's all pretty simple stuff in here and it's a very small library - have a quick read of the code in the tickpy/ dir. In short, tickers are counters that update over a given interval, and timers track time in a more traditional sense. In both cases, functions are provided for operations like 'how long since' or 'has this period elapsed', and so on.
Testing
A test suite with complete coverage is available for this repo. It is implemented with pytest.
Plausible extensions
Things I can/will implement at request or my need:
- extensions to period checking functions for both timer and ticker classes
- extend ticker .cmod() to optionally take a
period_startparameter - effectively decoupling period tracking from the start time when desired, and returning False if .counter has not yet reached period start.
- extend ticker .cmod() to optionally take a
- optionally autoupdate when calling cmod and so on. Almost certainly ill-advised for the applications I envisage using this module for however.
Licence
GPL3 applies to all files and folders in this repo.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tickpy-0.4.1.tar.gz.
File metadata
- Download URL: tickpy-0.4.1.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2ea1986d421c9ee5a606d02e50723fc19b507ed7f5b25db4b3d29b8b9ed78fb
|
|
| MD5 |
d35feb3e94a8de919aa05ac35753d90b
|
|
| BLAKE2b-256 |
da6f6548b7963a7144eac43faee58339206b72a99358ff5cc382657f80d151b3
|
File details
Details for the file tickpy-0.4.1-py3-none-any.whl.
File metadata
- Download URL: tickpy-0.4.1-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0d2fdc1bce320643d752f61fab67306d32e46789157152cabe0c8a26ef58000
|
|
| MD5 |
e74b919dea53519578777aad84815053
|
|
| BLAKE2b-256 |
42c08127cbc27a10ae7d760385c6acd8173cfcbbb49b1789ff7a582f244ed804
|