Skip to main content

bedtime

Python library for doing something when it's almost time for bed (the computer is going to sleep, or turning off).

import time, bedtime

def do_log():
    with open("./test.log", "a") as f:
        f.write("i went to sleep\n")

sleeper = bedtime.Listener(on_sleep=do_log)

while True:
    time.sleep(1)

    # later, after lights out...
    # test.log <
    #   i went to sleep

TODO:

  • Windows
  • MacOS
  • Linux (maybe usually the same as MacOS?)

Metadata

Release files for Bedtime 0.0.3

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

Source distribution (sdist)

Source distribution for Bedtime 0.0.3
File Size Uploaded
Bedtime-0.0.3.tar.gz 3.5 kB Details

Built distribution (wheel)

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

Total release size: 8.6 kB

Release files / Bedtime-0.0.3.tar.gz

Download URL Bedtime-0.0.3.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9e3db3986f05521a73b91870ec8a83ed0ecfa1767378ee7a6d92b72a919038f7
BLAKE2b-256 checksum
How to use checksums
cf0e027e60ea2b86e93cdd7a7c1b5f7f737eb6cdd90a612fa4bfa6310b58487a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0rc2

Release files / Bedtime-0.0.3-py3-none-any.whl

Download URL Bedtime-0.0.3-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0c887959874e55f782765dcb094c13dcad9f2bf081e15df73829aef90111b80
BLAKE2b-256 checksum
How to use checksums
6c52e652eb9e03ea1f1bcc3deff75d8345b9a5e15b0a89c5a144333d23580dfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0rc2

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

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