Skip to main content

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.

timehash-shaded-partial.png

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

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

Modified BSD License

Contact

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)

Source distribution for timehash 1.2
File Size Uploaded
timehash-1.2.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for timehash 1.2
File Interpreter ABI Platform
timehash-1.2-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page