{"id":15288177,"url":"https://github.com/ttitcombe/timekeep","last_synced_at":"2026-01-05T13:34:41.191Z","repository":{"id":57475554,"uuid":"212862751","full_name":"TTitcombe/timekeep","owner":"TTitcombe","description":"Defensive timeseries analysis in python","archived":false,"fork":false,"pushed_at":"2019-12-15T11:30:22.000Z","size":57,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T04:33:06.683Z","etag":null,"topics":["data","data-science","sklearn","time-series","time-series-analysis","timeseries"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/TTitcombe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-04T16:54:03.000Z","updated_at":"2022-10-03T21:27:16.000Z","dependencies_parsed_at":"2022-09-07T17:12:44.169Z","dependency_job_id":null,"html_url":"https://github.com/TTitcombe/timekeep","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2Ftimekeep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2Ftimekeep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2Ftimekeep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2Ftimekeep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TTitcombe","download_url":"https://codeload.github.com/TTitcombe/timekeep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245212304,"owners_count":20578443,"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":["data","data-science","sklearn","time-series","time-series-analysis","timeseries"],"created_at":"2024-09-30T15:44:33.775Z","updated_at":"2026-01-05T13:34:41.160Z","avatar_url":"https://github.com/TTitcombe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timekeep\n[![Build Status](https://travis-ci.com/TTitcombe/timekeep.svg?branch=master)](https://travis-ci.com/TTitcombe/timekeep)\n[![codecov](https://codecov.io/gh/TTitcombe/timekeep/branch/master/graph/badge.svg)](https://codecov.io/gh/TTitcombe/timekeep)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/TTitcombe/timekeep/master)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nA python package for defensive timeseries analytics.\n\n## What is `timekeep`\nAll code needs to make assumptions about the data it uses: its shape, content, or format.\nBut constantly checking and re-checking the assumptions can make the code unwieldy.\nTimeseries data presents additional complications in that many common python packages, such as\n[`pandas`][pandas] and [`scikitlearn`][sklearn], expect 2-dimensional, static data.\n\n`timekeep` protects your timeseries data by providing simple decorators to check those assumptions.\n`timekeep` is heavily inspired by [`engarde`][engarde], but does not share its assumption about\ndata being a [`pandas`][pandas] dataframe.\n\n## Quickstart\n### How to install\n`timekeep` is available from [PyPi][pypi]. Run\n```bash\npip install timekeep\n```\nto install.\n\n**Important**:\n`timekeep` is currently on version `0.x.y` and is in active development. As the version reflects,\nthe codebase is liable to change. Once main functionality has been applied, a stable version `1.0.0`\nwill be released.\n\n### How to use\n`timekeep` provides decorators to be used on functions which return a timeseries dataset.\nEach decorator checks an assumption about the data and raises an error if this assumption is not met.\n\n```python\nimport numpy as np\nimport timekeep.decorators as tkd\n\n# Check that data returned from wont_raise\n# has shape (-1, 10, 2)\n@tkd.is_shape((-1, 10, 2))\ndef wont_raise():\n  return np.random.random((10, 10, 2))\n\n# Check that data returned from will_raise is a\n# timeseries dataset (has three dimensions)\n@tkd.is_timeseries\ndef will_raise():\n  return np.random.random((10, 2))\n```\n\nAnother key feature of `timekeep` is conversion between timeseries data formats; `timekeep` can convert between\n[`tslearn`][tslearn] style timeseries dataset and [`sklearn`][sklearn] datasets, with support for [`tsfresh`][tsfresh]\ndatasets in progress. The conversion functions can be applied as decorators to methods and functions to automatically\nconvert your data as you supply it. For example:\n\n```python\nimport numpy as np\nimport timekeep.conversion as tkc\nfrom sklearn.preprocessing import PCA\n\n# Convert timeseries dataset to sklearn for input into sklearn.preprocessing.PCA\n@tkc.convert_timeseries_input\ndef run_pca_on_timeseries(data):\n  return PCA().fit(data)\n\ntimeseries_data = np.random.random((10, 100, 2))\nrun_pca_on_timeseries(timeseries_data)\n```\n\nSee the [`examples`][examples] folder for more. You can launch this repo on [`binder`][binder_timekeep] \nand run the examples without any installation.\n\n## Contributing\nAny and all help welcome. Please see the [contributing guide][contributing].\n\n[binder_timekeep]: https://mybinder.org/v2/gh/TTitcombe/timekeep/master\n[engarde]: https://github.com/engarde-dev/engarde\n[pandas]: https://pandas.pydata.org/\n[pypi]: https://pypi.org/project/timekeep/0.1/\n[sklearn]: https://scikit-learn.org/stable/index.html\n[tsfresh]: https://tsfresh.readthedocs.io\n[tslearn]: https://tslearn.readthedocs.io\n\n[contributing]: CONTRIBUTING.md\n[examples]: examples/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttitcombe%2Ftimekeep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttitcombe%2Ftimekeep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttitcombe%2Ftimekeep/lists"}