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?)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Bedtime-0.0.3.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Bedtime-0.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file Bedtime-0.0.3.tar.gz.

File metadata

  • Download URL: Bedtime-0.0.3.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0rc2

File hashes

Hashes for Bedtime-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9e3db3986f05521a73b91870ec8a83ed0ecfa1767378ee7a6d92b72a919038f7
MD5 1aed97d56ae7f422ef741afd0dd845f5
BLAKE2b-256 cf0e027e60ea2b86e93cdd7a7c1b5f7f737eb6cdd90a612fa4bfa6310b58487a

See more details on using hashes here.

File details

Details for the file Bedtime-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: Bedtime-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0rc2

File hashes

Hashes for Bedtime-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b0c887959874e55f782765dcb094c13dcad9f2bf081e15df73829aef90111b80
MD5 ebc40d12e8ef1277ff5066c2d9335295
BLAKE2b-256 6c52e652eb9e03ea1f1bcc3deff75d8345b9a5e15b0a89c5a144333d23580dfb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page