{"id":20310048,"url":"https://github.com/abeusher/timehashlib","last_synced_at":"2026-05-05T16:02:52.851Z","repository":{"id":57531710,"uuid":"136727839","full_name":"abeusher/timehashlib","owner":"abeusher","description":"An algorithm for creating user configurable, variable-precision sliding windows of time. Useful for binning time values in large collections of data.","archived":false,"fork":false,"pushed_at":"2018-06-09T14:02:03.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T12:13:40.811Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abeusher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-09T13:56:42.000Z","updated_at":"2019-07-13T11:37:36.000Z","dependencies_parsed_at":"2022-09-07T04:52:43.789Z","dependency_job_id":null,"html_url":"https://github.com/abeusher/timehashlib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeusher%2Ftimehashlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeusher%2Ftimehashlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeusher%2Ftimehashlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeusher%2Ftimehashlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abeusher","download_url":"https://codeload.github.com/abeusher/timehashlib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241809619,"owners_count":20023787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T17:29:47.282Z","updated_at":"2026-05-05T16:02:47.825Z","avatar_url":"https://github.com/abeusher.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timehashlib\nAn algorithm for creating user configurable, variable-precision sliding windows of time. Useful for binning time values in large collections of data.\n\ntimehash\n========\n\nAbout\n-----\n\ntimehash is an algorithm (with multiple reference implementations) for\ncalculating variable precision sliding windows of time. When performing\naggregations and correlations on large-scale data sets, the ability to\nconvert precise time values into 'malleable intervals' allows for many\nnovel analytics.\n\nUsing `sliding windows of\ntime \u003chttp://stackoverflow.com/questions/19386576/sliding-window-over-time-data-structure-and-garbage-collection\u003e`__\nis a common practice in data analysis but prior to the timehash\nalgorithm it was more of an art than a science.\n\n.. image:: timehash-shaded-partial.png\n\nFeatures\n--------\n\n-  convert epoch miliseconds into an interval of time, depicted by an\n   ASCII character 'hash' (a 'timehash')\n-  timehash values are well suited to referencing time intervals in\n   key-value stores (e.g. Hbase, Acculumo, Redis)\n-  The creation of a compound key of space and time (e.g.\n   geohash\\_timehash) is a powerful primitive for understanding\n   geotemporal patterns\n\nImplementations\n---------------\n\n-  `python\n   timehash \u003chttps://github.com/abeusher/timehash/blob/master/timehash/__init__.py\u003e`__\n   - a reference implementation in pure python\n-  `perl\n   timehash \u003chttps://github.com/abeusher/timehash/blob/master/timehash.pl\u003e`__\n   - a reference implementation in perl\n-  `java\n   timehash \u003chttps://github.com/abeusher/timehash/blob/master/TimeHash.java\u003e`__\n   - a reference implementation in java\n-  `javascript\n   time-hash \u003chttps://github.com/disarticulate/time-hash\u003e`__\n   - port of reference implements\n-  `golang\n   timehash \u003chttps://github.com/abeusher/timehash/blob/master/timehash.go\u003e`__\n   - a reference implementation in Go\n\nUsage\n-----\n\nExample of calculating a timehash value in python:\n\n.. code:: python\n\n    import timehash\n    import time\n\n    rightnow = time.time()\n    rightnow60 = rightnow + 60.0\n\n    rightnow_hash = timehash.encode(rightnow, precision=10)\n    rightnow60_hash = timehash.encode(rightnow60, precision=10)\n\n    print 'timehash of right now: %s' % rightnow_hash\n    print 'timehash of now +60s: %s'% rightnow60_hash\n     \n    % timehash of right now: ae0f0ba1fc\n    % timehash of now +60s: ae0f0baa1c\n\nLicense\n-------\n\n`Modified BSD\nLicense \u003chttp://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_.28.22Revised_BSD_License.22.2C_.22New_BSD_License.22.2C_or_.22Modified_BSD_License.22.29\u003e`__\n\nContact\n-------\n\n- TimeHash Guru: `AbeUsher \u003chttp://www.linkedin.com/in/socialnetworkanalysis\u003e`__\n- Python Packager: `Kevin Dwyer / @pheared \u003chttps://twitter.com/pheared\u003e`__\n- Golang implementation: `Justin Shelton / @kwonstant \u003chttps://twitter.com/kwonstant\u003e`__\n- Javascript implementation: `Eric Xanderson  \u003chttps://github.com/disarticulate\u003e`__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabeusher%2Ftimehashlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabeusher%2Ftimehashlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabeusher%2Ftimehashlib/lists"}