Skip to main content

Utility functions

Project description

FifeUtil

Package of Python utilities I find handy.

FifeUtil is the place to keep utilities that I would like to re-use across projects.

Installation

To install directly from GitHub:

python3 -m pip install "git+https://github.com/jmfife/fifeutil.git"

If you have cloned or forked the repo already to your local directory and want to use it in live (editable mode):

python3 -m pip install -e "."

Quickstart

Install the package from GitHub:

python3 -m pip install "git+https://github.com/jmfife/fifeutil.git"

Now we see an example of using the one of the timer utilities that synchronizes events with the hour. First run the Python interpreter, then:

>>> from fifeutil import timing
>>> timer1 = timing.TimerSyncHour(3600/5)
>>> import datetime
>>> def printtime():
...     print(datetime.datetime.now())
... 
>>> timer1.triggercallback(printtime)
2020-05-31 17:25:10.001249
2020-05-31 17:25:15.001348
2020-05-31 17:25:20.000543
2020-05-31 17:25:25.000405

We see the timer triggering at 5-second intervals synchronized with the top of the hour and with the minute in this case.

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

fifeutil-1.0.1.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

fifeutil-1.0.1-py3-none-any.whl (13.8 kB view hashes)

Uploaded Python 3

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