{"id":33919698,"url":"https://github.com/bieli/time-series-data-packer-rs","last_synced_at":"2026-03-09T22:31:30.648Z","repository":{"id":325361259,"uuid":"1100887570","full_name":"bieli/time-series-data-packer-rs","owner":"bieli","description":"Time series data packer written in Rust language for data intensive IoT and IIoT projects.","archived":false,"fork":false,"pushed_at":"2025-12-23T14:13:01.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-04T13:13:43.928Z","etag":null,"topics":["data-engineering","iot","measurements","optimization","packer","rust","time-series"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/bieli.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-20T22:33:50.000Z","updated_at":"2025-12-23T14:13:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bieli/time-series-data-packer-rs","commit_stats":null,"previous_names":["bieli/time-series-data-packer-rs"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/bieli/time-series-data-packer-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bieli%2Ftime-series-data-packer-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bieli%2Ftime-series-data-packer-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bieli%2Ftime-series-data-packer-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bieli%2Ftime-series-data-packer-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bieli","download_url":"https://codeload.github.com/bieli/time-series-data-packer-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bieli%2Ftime-series-data-packer-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30314627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-engineering","iot","measurements","optimization","packer","rust","time-series"],"created_at":"2025-12-12T08:59:33.743Z","updated_at":"2026-03-09T22:31:30.630Z","avatar_url":"https://github.com/bieli.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# time-series-data-packer-rs\n\n![CI status](https://github.com/bieli/time-series-data-packer-rs/actions/workflows/test.yaml/badge.svg)\n![github_tag](https://img.shields.io/github/v/tag/bieli/time-series-data-packer-rs)\n[![Crates.io](https://img.shields.io/crates/v/time-series-data-packer-rs.svg)](https://crates.io/crates/time-series-data-packer-rs)\n\nTime series data packer written in Rust language for data intensive IoT and IIoT projects.\n\n## Motivations\nIn a lot of my IoT projects, I have a pressure on storage size after time series data collection with miliseconds precission.\nYes, I've been using Open Sourece great data warehouses, time-series dedicated databases and engines/databases do a lot of work for me, but one day I decided to find better - my own - way to time series data compressions.\nThis is an experimental project with saving storage size for time series data connected to specific domains (not random data for sure).\n\n## API definitions\n- structs:\n  - `TSPackStrategyType`\n    - `TSPackSimilarValuesStrategy` - similar values based simple methodology (repeatition of the same values will be packed - default strategy)\n    - `TSPackMeanStrategy(values_compression_percent: u8)` - mean value based simple methodoloty (for first iteration). `values_compression_percent` parameter value explanations: if we have in time series values i.e. 100, 100, 102, 98, 100, 99, to pack those sieries of values to 100, we need to set this parameter to `5`. Means, we have avg. from series and we try to find, if values are in -5 to 5 range based on avg. value as a reference on values data window.\n    - `TSPackXorStrategy`\n      - Packing: First value stored raw. Each subsequent value is XOR’d with the previous value’s bit pattern. The XOR result is stored as an f64 (lossless since we reinterpret bits).\n      - Unpacking: First value read raw. Each subsequent XOR is applied to reconstruct the original bits.\n  - `TSPackAttributes`\n    - `strategy_types: Vec\u003cTSPackStrategyType\u003e` - what method of compression we would like to use\n    - `microseconds_time_window: u64` - time window to apply packing strategies in microseconds resolution (sometimes seconds means we have a 100k + similar measurements, so it's good to define more real limits for bare metal and sensor specific criteria for particular data domains)\n    - `precision_epsilon: f64` - dedicated precision for packing strategies optimization (this is a realistic limits for real/float numbers, when sometimes you no need high-accuracy, but more minimize storage usage strategy)\n  - `TSSamples`\n    - f64 - timestamp in seconds\n    - f64 - real value\n  - `TSPackedSamples`\n    - (f64, f64) - timestamps ranges in seconds\n    - f64 - i.e using mean values strategy (based on `values_compression_percent` parameter setting for `pack` function - in case of used `TSPackMeanStrategy`)\n  \n- `TimeSeriesDataPacker` - object with methods:\n  - `fn pack(samples: Vec\u003cTSSamples\u003e, attributes: TSPackAttributes) -\u003e Vec\u003cTSPackedSamples\u003e` - packer functon\n  - `fn unpack( -\u003e Vec\u003cTSPackedSamples\u003e) -\u003e (TSPackAttributes, Vec\u003cTSSamples\u003e)` - unpacker functon\n\n\n### API usage example\n```rust\nuse time_series_data_packer_rs::*;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let samples: Vec\u003cTSSamples\u003e = vec![\n        (0.0, 100.0),\n        (0.001, 100.0),\n        (0.002, 102.0),\n        (0.003, 98.0),\n        (0.004, 100.0),\n        (0.005, 99.0),\n    ];\n\n    let attrs = TSPackAttributes {\n        strategy_types: vec![\n            TSPackStrategyType::TSPackMeanStrategy { values_compression_percent: 5 },\n        ],\n        microseconds_time_window: 1_000, // 1 ms\n    };\n\n    let mut packer = TimeSeriesDataPacker::new();\n    let packed = packer.pack(samples.clone(), attrs)?;\n    println!(\"Packed: {:?}\", packed);\n\n    let (_attrs, original) = packer.unpack();\n    println!(\"Original recovered: {:?}\", original);\n    \n    println!(\"Samples == Original recovered: {:?}\", samples == original);\n\n    Ok(())\n}\n```\n#### Results from API usage example after run\n```bash\n$ cargo run\n\nPacked: [((0.0, 0.003), 100.0), ((0.004, 0.005), 99.5)]\nOriginal recovered: [(0.0, 100.0), (0.001, 100.0), (0.002, 102.0), (0.003, 98.0), (0.004, 100.0), (0.005, 99.0)]\nSamples == Original recovered: true\n```\n\n\n## TODO list\n- [X] CI\n- [x] crates package distribution\n- [ ] I want to have visual UI, to create signals patterns and use it as input to easy wrinting unit tests\n- [ ] prepare great real tests examples from various group of IoT sensors\n- [ ] compare random sequences compressions rates with real data from IoT sensors\n- [ ] add Python interface based on PyO3 library\n- [ ] public Python package in TEST and official python packages for inc. popularity\n- [ ] measure resources (RAM, CPU, IO) required to pack and unpack data with diffirent time ranges\n- [ ] think about packed data buckets concept by time domain: minutes, hours, daily, weekly, monthly (kind of specific packed measurements partitions, becouse in time-series data analytics in IoT there are a very specific situations, when you need to select all historical data, usually you points of interests are selected by known short time ranges)\n- [ ] think about lossless data packing algo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbieli%2Ftime-series-data-packer-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbieli%2Ftime-series-data-packer-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbieli%2Ftime-series-data-packer-rs/lists"}