{"id":45096040,"url":"https://github.com/versada/toggler","last_synced_at":"2026-02-19T18:33:58.877Z","repository":{"id":147015203,"uuid":"612192548","full_name":"versada/toggler","owner":"versada","description":"Feature Flags Manager","archived":false,"fork":false,"pushed_at":"2024-07-10T12:22:12.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-13T19:29:51.484Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/versada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-03-10T11:56:21.000Z","updated_at":"2024-07-10T12:21:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"046ae238-5334-45b1-9f8c-a31f138113a7","html_url":"https://github.com/versada/toggler","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/versada/toggler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versada%2Ftoggler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versada%2Ftoggler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versada%2Ftoggler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versada%2Ftoggler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/versada","download_url":"https://codeload.github.com/versada/toggler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versada%2Ftoggler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29627114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"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":[],"created_at":"2026-02-19T18:33:58.766Z","updated_at":"2026-02-19T18:33:58.865Z","avatar_url":"https://github.com/versada.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toggler\n\nToggler allows to set up feature toggles (flags) on a YAML file and validate whether\nspecific flag is ON or OFF on specific environment.\n\n## How to Use\n\n### Configure Feature Toggles\n\nFeature toggles are configured in `yaml` file:\n\n```yaml\n---\nfeature1:\n  modes: [prod, stage]\n  date: 2023-01-01\n  days_to_expire: 10\n  ref: r123\nfeature2:\n  modes: [stage]\n  date: 2023-01-01\nfeature3:\n  modes: [other]\n  date: 2023-01-01\n```\n\nStructure:\n\n* modes (e.g prod, stage), defines features enabled on specific mode.\n* features (e.g feature1, feature2) are feature names used to identify which\n  feature is used or not:\n    - active: whether feature is enabled or not. If feature is not defined on\n      specific mode, it is implicitly treated as disabled. This is the only required field.\n    - ref: reference to feature or ticket (for convenience).\n    - date: when feature flag was added.\n    - days_to_expire: how many days feature flag is to stay. Warning logs will\n      be written after deadline.\n\n### Define mode and config file path\n\nYou can either explicitly initialize `Toggler` with its optional arguments, `mode` and `path` (or `stream`) or you can use environment variables `TOGGLER_MODE` and `TOGGLER_CFG`.\n\nFor example:\n\n```\nTOGGLER_MODE=prod TOGGLER_CFG=/path/to/tog.yml my-app\n```\n\n### Initialize `Toggler` and check features activity\n\n```python\nfrom toggler.toggler import Toggler\n\ntog = Toggler()  # expecting specified env variables\nif tog.is_active(\"feature1\"):\n    # feature1 logic\n    ...\nelse:\n    # old logic\n    ...\n```\n\n### Using toggler in tests\n\nYou can force toggle feature to make it easier to test.\n\n```python\nfrom toggler.services.env import toggle_feature\n\n\ndef test_feature1_on():\n    with toggle_feature(\"feature1\", True):  # Force enable\n        # test if feature1 logic works as expected\n        ...\n\n\ndef test_feature1_off():\n    with toggle_feature(\"feature1\", False):  # Force disable\n        # test if logic without feature1 works as expected\n        ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fversada%2Ftoggler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fversada%2Ftoggler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fversada%2Ftoggler/lists"}