Skip to content

tonyskapunk/beat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

beat

A CLI tool and Python library for Swatch® Internet Time (.beats).

Swatch® Internet Time divides the day into 1000 beats (@000 to @999), with each beat equal to 1 minute and 26.4 seconds. It uses BMT (Biel Mean Time, UTC+1) as its reference timezone, eliminating the need for time zones or daylight saving conversions.

Installation

pip install beat-time

CLI Options

Flag Description
-c, --centibeats Display centibeats (fractional beats)
-t, --time Time to convert in HH:MM:SS format
-z, --timezone Timezone offset in hours (default: 1)
-v, --version Show version

CLI Usage

Get the current time in beats:

$ beat
@123

With centibeats for more precision:

$ beat -c
@123.456

Convert a specific time (HH:MM:SS) to beats:

$ beat -t
@123

Specify a timezone offset (default is UTC+1/BMT):

$ beat -t 1:57:46 -z 0
@123

Show version:

$ beat -v

Library Usage

import beat_time

# Current time in beats
beat_time.now()                 # '@123'
beat_time.now(centibeats=True)  # '@123.449'

# Convert a specific time (hours, minutes, seconds, timezone offset)
beat_time.internettime(1, 57, 46, tzone=0)                    # '@123'
beat_time.internettime(1, 57, 46, tzone=0, centibeats=True)   # '@123.449'

Web Version

A standalone HTML version is available in docs/index.html that displays the current beat time in the browser, updating every centibeat (864ms).

License

GPLv3

About

.beat(Swatch Internet Time)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages