{"id":28392337,"url":"https://github.com/afranche7/potoos","last_synced_at":"2026-04-06T06:33:23.135Z","repository":{"id":282758766,"uuid":"912260009","full_name":"afranche7/Potoos","owner":"afranche7","description":"Lightweight anomaly detection on RedisTimeSeries using Luminol","archived":false,"fork":false,"pushed_at":"2025-03-16T20:07:02.000Z","size":41,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T23:32:17.965Z","etag":null,"topics":["anomalies","anomaly","anomaly-detection","luminol","redis","redis-cache","redis-database","redistimeseries"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/potoos/","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/afranche7.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}},"created_at":"2025-01-05T03:55:38.000Z","updated_at":"2025-03-17T03:05:52.000Z","dependencies_parsed_at":"2025-03-16T19:43:54.698Z","dependency_job_id":"e70fcf4b-b6cb-4a56-9743-9875ee73f6b3","html_url":"https://github.com/afranche7/Potoos","commit_stats":null,"previous_names":["afranche7/potoos"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/afranche7/Potoos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afranche7%2FPotoos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afranche7%2FPotoos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afranche7%2FPotoos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afranche7%2FPotoos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afranche7","download_url":"https://codeload.github.com/afranche7/Potoos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afranche7%2FPotoos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31463014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["anomalies","anomaly","anomaly-detection","luminol","redis","redis-cache","redis-database","redistimeseries"],"created_at":"2025-05-31T12:13:29.212Z","updated_at":"2026-04-06T06:33:23.130Z","avatar_url":"https://github.com/afranche7.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/5fdf1783-27dd-407e-bba6-bb1c809c689c\" width=\"250\" height=\"250\"\u003e\n\u003c/p\u003e\n\n# Potoos\n\nPotoos is a lightweight Python library for time series anomaly detection using Redis Time Series and Luminol. Monitor your time series data for anomalies with minimal configuration.\n\n## Overview\n\nPotoos combines the power of:\n- **[Redis Time Series](https://github.com/RedisTimeSeries/RedisTimeSeries)** for efficient time series data storage and retrieval\n- **[Luminol](https://github.com/linkedin/luminol)** for robust anomaly detection algorithms\n\nThis makes it ideal for monitoring metrics, detecting unusual patterns, and identifying outliers in your time series data.\n\n## Features\n\n- 🔄 **Seamless Redis TimeSeries Integration**: Automatically verifies Redis module availability\n- 🔍 **Configurable Time Series Retrieval**: Forward or reverse order, with flexible query options\n- 🚨 **Anomaly Detection**: Uses Luminol's advanced algorithms to identify anomalies\n- 🛠️ **Highly Configurable**: Customize both time series retrieval and anomaly detection parameters\n\n## Requirements\n\n- Python 3.10+\n- Redis server with the RedisTimeSeries module installed\n- Dependencies:\n  - redis-py\n  - luminol\n\n## Installation\n\n```bash\npip install potoos\n```\n\nEnsure your Redis server has the TimeSeries module installed:\n\n```bash\n# Check if module is installed\nredis-cli MODULE LIST | grep timeseries\n\n# If not found, install using Redis Stack or Redis modules\n```\n\n## Quick Start\n\nHere's a simple example of how to use Potoos:\n\n```python\nfrom redis import Redis\nfrom potoos.client import PotoosClient\nfrom potoos.models.config import TimeSeriesConfig, AnomalyDetectionConfig\n\n# Connect to Redis\nredis_client = Redis(host='localhost', port=6379)\n\n# Initialize Potoos client with default configurations\nclient = PotoosClient(redis_client)\n\n# Or with custom configurations\nclient = PotoosClient(\n    redis_client=redis_client,\n    time_series_config=TimeSeriesConfig(reversed=False, count=1000),\n    anomaly_config=AnomalyDetectionConfig(algorithm_name='bitmap_detector')\n)\n\n# Monitor a time series key for anomalies\nresults = client.monitor('metrics:cpu:usage')\n\n# Process the results\nif results:\n    print(f\"Analysis complete. Found {results.meta_data.anomalies_found} anomalies\")\n    print(f\"Analyzed {results.meta_data.data_points_analyzed} data points\")\n    \n    # Print information about each anomaly\n    for anomaly in results.anomalies:\n        print(f\"Anomaly at {anomaly.exact_timestamp}\")\n        print(f\"Anomaly score: {anomaly.anomaly_score}\")\n        \n    # Or access anomaly score in TimeSeries object\n    print(f\"Anomaly scores: {results.scores}\")\n\n    # Access time range analyzed\n    time_range = results.meta_data.time_range_analyzed\n    print(f\"Time range analyzed: {time_range.start} to {time_range.end}\")\n```\n\n## Configuration\n\n### Time Series Configuration\n\n```python\nfrom potoos.models.config import TimeSeriesConfig\n\n# Default values shown\nconfig = TimeSeriesConfig(\n    count=None,         # Maximum number of samples to return\n    aggregation=None,   # Aggregation type (e.g., 'avg', 'sum', 'min', 'max')\n    bucket_size=None,   # Time bucket for aggregation in milliseconds\n    filter_by=None,     # Filtering options for labels\n    align=None,         # Timestamp alignment control\n    start=None,         # Start timestamp\n    end=None,           # End timestamp\n    reversed=False      # Return results in reverse order when True\n)\n```\n\n### Anomaly Detection Configuration\n\n```python\nfrom potoos.models.config import AnomalyDetectionConfig\n\n# Default values shown\nconfig = AnomalyDetectionConfig(\n    algorithm_name='bitmap_detector',  # Algorithm to use\n    score_threshold=None,              # Threshold for anomaly detection\n    score_percentile_threshold=None,   # Percentile threshold\n    algorithm_params={}                # Additional algorithm parameters\n)\n```\n\n## How It Works\n\n1. **Initialization**: PotoosClient connects to your Redis instance and verifies the TimeSeries module is available\n2. **Data Retrieval**: When monitoring, it fetches time series data according to your configuration\n3. **Anomaly Detection**: The retrieved data is analyzed using Luminol's algorithms\n4. **Results**: You receive detailed information about detected anomalies and analysis metadata\n\n## Note on Dependencies\n\nPotoos requires NumPy 1.22.4 or earlier due to Luminol's dependency on the `numpy.asscalar()` function, which was removed in later versions of NumPy.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafranche7%2Fpotoos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafranche7%2Fpotoos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafranche7%2Fpotoos/lists"}