timehash
About
timehash is an algorithm (with multiple reference implementations) for calculating variable precision sliding windows of time. When performing aggregations and correlations on large-scale data sets, the ability to convert precise time values into ‘malleable intervals’ allows for many novel analytics.
Using sliding windows of time is a common practice in data analysis but prior to the timehash algorithm it was more of an art than a science.
Features
convert epoch miliseconds into an interval of time, depicted by an ASCII character ‘hash’ (a ‘timehash’)
timehash values are well suited to referencing time intervals in key-value stores (e.g. Hbase, Acculumo, Redis)
The creation of a compound key of space and time (e.g. geohash_timehash) is a powerful primitive for understanding geotemporal patterns
Implementations
python timehash - a reference implementation in pure python
perl timehash - a reference implementation in perl
java timehash - a reference implementation in java
javascript time-hash - port of reference implements
golang timehash - a reference implementation in Go
Usage
Example of calculating a timehash value in python:
import timehash
import time
rightnow = time.time()
rightnow60 = rightnow + 60.0
rightnow_hash = timehash.encode(rightnow, precision=10)
rightnow60_hash = timehash.encode(rightnow60, precision=10)
print 'timehash of right now: %s' % rightnow_hash
print 'timehash of now +60s: %s'% rightnow60_hash
% timehash of right now: ae0f0ba1fc
% timehash of now +60s: ae0f0baa1c
License
Contact
TimeHash Guru: AbeUsher
Python Packager: Kevin Dwyer / @pheared
Golang implementation: Justin Shelton / @kwonstant
Javascript implementation: Eric Xanderson
Rust implementation: Kevin Dwyer / @pheared
C impelmentation Sam Mason
C# impelmentation Sam Mason
Metadata
Release files for timehash 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| timehash-1.2.tar.gz | 6.2 kB | Without provenance | Details for timehash-1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| timehash-1.2-py3-none-any.whl | Python 3 | none | any | Details for timehash-1.2-py3-none-any.whl |
Total release size: 12.5 kB
Release files / timehash-1.2.tar.gz
| Download URL | timehash-1.2.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7ddee20656861df1f3bcf8c3347c9d6894699e1128708f8521c543ba51afff7
|
|
BLAKE2b-256 checksum How to use checksums |
8b1c393d4a2ccbadcee01f3d4abefe3671d779f0b901c0f7769e24d854faae9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / timehash-1.2-py3-none-any.whl
| Download URL | timehash-1.2-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78040c16e3adbe74bdc81cefb3bffa0521ee8ed046a3ffbf76f85b1b9203598e
|
|
BLAKE2b-256 checksum How to use checksums |
c1f7bb2d23f8de999b5ae4e55028e53fb777661ce7539ed559fd82886ffba5e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Security for timehash 1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.