semvec/pypi-packages huggingface dataset:
timestamps 1.3.0
Timestamp manager

Timestamp
=========

# Build Status
[![Build Status](https://travis-ci.org/gndu91/timestamps.svg?branch=master)](https://travis-ci.org/gndu91/timestamps)

# Install
In order to install, you can either use pypi with either
```bash
pip3 install timestamps
```
or
```bash
python3 -m pip install timestamps
```

# Usage
The library has several types defined

# Timestamp
Represents a timestamp with a 10^-7 precision (same as the time.time() of python 3)
You can instanciate it in various ways, each time, you can provide a non-keyword value
	or a value with as keyword either _float, _hex or _datetime,
	or with the methods from_float, from_hex and from_datetime
Timestamps objects can ONLY represent POSITIVE timestamps.
```python

# From the current time
t = Timestamp.now()

# With a float
t = Timestamp(1.0)
t = Timestamp.from_float(1.0)
t = Timestamp(_float=1.0) # WARNING: Discouraged, use Timestamp.from_float instead

# With a datetime
t = Timestamp(datetime.datetime.now())
t = Timestamp.from_datetime(datetime.datetime.now())
t = Timestamp(_datetime=datetime.datetime.now()) # WARNING: Discouraged, use Timestamp.from_datetime instead 

# With an hex
t = Timestamp(_hex='f')  # WARNING: Discouraged, use Timestamp.from_hex instead
t = Timestamp('0xf0')
t = Timestamp.from_hex('#FF')

# With another timestamp
t = Timestamp(Timestamp.now())
```
You can compare them with anything that can fit in the Timestamp initializator,
        namely floats, datetimes, and hex values.
```python
Timestamp.now() < Timestamp.now()
time.time() < Timestamp.now()
'0xff' < Timestamp(time.time())
```