Fix warnings

- don't lint the `venv` and `build` directories
- don't import *
Refactor: move main code into `main()` function.

It's nasty to have code floating at the global scope, it should really
live in a main function.
Split main function into multiple functions

So that we have a chance of testing each bit and swapping bits out.
Add failing tests for new parse_time_range func.

`parse_time_range` allows the user to specify either start time, end
time or both.

For missing start/end it generates a 24 hour period.

It also truncates down the the nearest hour.