A simple package to utilize Lightning Time in python
Project description
Lightning Time
TODO: add description here
Learn more about how Lightning Time works & play with it hands-on: here
Installation
pip3 install lightning-time
Usage
Colors
from lightning_time import Lightning, Timestring
# Create a Lightning object
lt = Lightning(Timestring("a~b~c|d"))
By default, the Lightning
colors are set to the following:
bolt: (dynamic value), 161, 0
zap: 50, (dynamic value), 214
spark: 246, 133, (dynamic value)
You can change these colors by passing in color arguments to the Lightning
object:
lt = Lightning(Timestring("a~b~c|d"), bolt_color=(g, b), zap_color=(r, b), spark_color=(r, g))
r, g and b are integers between 0 and 255, inclusive.
For example, to change the color of a bolt
, use the following:
lt = Lightning(Timestring("a~b~c|d"), bolt_color=(155, 35))
You can set the static colors of a Lightning
object with the set_static_colors
method:
lt.set_static_colors((g, b), (r, b), (r, g))
Conversions
from datetime import datetime
#convert from datetime to Lightning time
Lightning.to_lightning(datetime.now()) #e~3~3|8
#convert from Lightning time to a time st
Lightning.from_lightning(Lightning.to_lightning(datetime.now()), withseconds=True) # 21:18:06
Color String
Lightning.to_lightning(datetime.now()).color_strings() # ('#e3a100', '#3238d6', '#f68582')
Print without charges
Lightning.to_lightning(datetime.now()).strip_charges()
# e~3~a
Accessing values
lt = Lightning(Timestring("a~b~c|d"))
lt.timestring.bolts # a
lt.timestring.zaps # b
lt.timestring.sparks # c
lt.timestring.charges # d
Contributing
This project is still under development, feel free to contribute by opening a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lightning-time-0.0.2.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for lightning_time-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c74d2d61d502db3b1cf7aadc505ac8de862154d6fffe81ffad2932ecbf0c0e30 |
|
MD5 | 2420af7f53c1640fe38e8134c92a079d |
|
BLAKE2b-256 | bf903fec468fc31a5e3a61eb16bdd5ad341b606d638b8c8b3864e4c3f4a9522c |