Python package to decode day-of-week bitmasks
Project description
bitmask-decoder
Python wrapper to decode days-of-week bitmasks.
This mask is created by assigning an integer to each day of the week and summing up the integers of the relevant days.
It is assumed that the days are assigned as follows:
- Monday: 1
- Tuesday: 2
- Wednesday: 4
- Thursday: 8
- Friday: 16
- Saturday: 32
- Sunday: 64
Any combinations of these days can be summed up to create a mask for that specific combination. For example:
42 = tuesday, thursday and saturday
Installation
bitmask-decoder is available via pip.
pip install -i https://test.pypi.org/simple/ bitmask-decoder==0.0.2
2 Functions
bitmask_decoder.find_dow()
returns the days of week as individual integers for a single mask
bitmask_decoder.get_dow(column)
returns the days of the week as strings from a list
Example
import bitmask_decoder
bitmask_decoder.get_dow([127, 16, 5, 9, 8, 14, 13, 1, 42])
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
bitmask-decoder-0.0.3.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for bitmask_decoder-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a59c0a928b261023d6f6f3b299b0de50ccd5b7c806d14634eee94c4fe5fae4c2 |
|
MD5 | 526d6b3ed150749522c092a7d432e153 |
|
BLAKE2b-256 | d296d587329acef85d0532fffc2d0dad61c8fde89e9a2d1b5ce5f8c8f23084ed |