{"id":29797714,"url":"https://github.com/emrothenberg/oref","last_synced_at":"2026-03-06T23:32:19.765Z","repository":{"id":300369555,"uuid":"1006019392","full_name":"emrothenberg/oref","owner":"emrothenberg","description":"Python interface to Israel’s Home Front Command (Pikud HaOref) emergrncy alert network.","archived":false,"fork":false,"pushed_at":"2025-06-21T22:44:12.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-27T03:55:39.293Z","etag":null,"topics":["emergency","homefront","israel","pikud-haoref","pikudhaoref","rocket"],"latest_commit_sha":null,"homepage":"","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/emrothenberg.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-06-21T10:01:58.000Z","updated_at":"2025-07-05T09:54:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"7bfe0115-41d4-47da-8ad6-3c19e95845ce","html_url":"https://github.com/emrothenberg/oref","commit_stats":null,"previous_names":["emrothenberg/oref"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emrothenberg/oref","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrothenberg%2Foref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrothenberg%2Foref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrothenberg%2Foref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrothenberg%2Foref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emrothenberg","download_url":"https://codeload.github.com/emrothenberg/oref/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrothenberg%2Foref/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30203346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"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":["emergency","homefront","israel","pikud-haoref","pikudhaoref","rocket"],"created_at":"2025-07-28T07:00:48.202Z","updated_at":"2026-03-06T23:32:19.752Z","avatar_url":"https://github.com/emrothenberg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oref\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**Oref** – Python interface to Israel’s Home Front Command (Pikud HaOref) emergrncy alert network.\n\n---\n\n## Installation\n\n```bash\npip install oref\n```\n\n*Python 3.11 + required.*\n\n---\n\n## Quick‑start\n\n```python\nimport oref\nfrom oref.types import Alert\n\n# Load baseline (English) metadata\noref.init()\n\n# Optional – preload extra languages\noref.init(extra_languages=[\"he\", \"ar\", \"ru\"])\n\n# One‑off check (all areas)\nalert = oref.check_alert()\nif alert:\n    print(alert)\n\n# Continuous listener (filter to specific areas if desired)\n\ndef on_alert(a: Alert):\n    print(\"\\n\u003e\u003e\u003e INCOMING:\", a)\n\noref.listen(on_alert, areas=[\"Jerusalem\", 158])\n```\n\n---\n\n## API Synopsis\n\n### Initialise\n\n| Function   | Signature                                                     | Purpose                                                                                       |\n| ---------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |\n| **`init`** | `init(extra_languages: List[Literal[\"ar\", \"he\", \"ru\"]] = [])` | Downloads location, guideline \u0026 translation datasets. Must be called before any other helper. |\n\n### Alerts\nAlert functions can be invoked from both `oref` and `oref.alerts`.\n\n| Function          | Signature                                     | Notes                                                  |                                                                                                |                                                 |\n| ----------------- | --------------------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------- | ----------------------------------------------- |\n| **`check_alert`** | \\`check\\_alert(areas: List\\[str \\| int] \\| Literal\\[\"all\"] = \"all\") -\u003e Alert \\ bool\\`                                                                                         | Returns latest alert object or `False` if none. |\n| **`listen`**      | \\`listen(callback: Callable, areas: List\\[str \\| int] \\| Literal\\[\"all\"] = \"all\", args=(), kwargs={})\\` | Polls every second; invokes `callback` once per unique alert (15‑minute deduplication window). |                                                 |\n\n### Data Helpers\nData helpers can be invoked from both `oref` and `oref.loader`\n\n| Function                 | Returns                  | Description                                                             |                                            |\n| ------------------------ | ------------------------ | ----------------------------------------------------------------------- | ------------------------------------------ |\n| **`locations`**          | `List[Location]`         | All known locations with multilingual labels \u0026 shelter times.           |                                            |\n| **`location`**           | \\`Location \\| bool\\`                                                                  | Single lookup by ID or any language label. |\n| **`guidelines`**         | `List[Guideline]`        | Civil‑defence instructions per alert zone.                              |                                            |\n| **`alert_translations`** | `List[AlertTranslation]` | Full mapping of alert categories/titles/desc in four languages.         |                                            |\n| **`translate`**          | `(title, desc)`          | Convenience wrapper translating an `Alert` into the requested language. |                                            |\n\n### Data Structures (`oref.types`)\n\n* **`Alert`** – `id`, `category`, `title`, `description`, `locations`, `unfiltered_locations`; `filter_locations(relevant)`\n* **`Location`** – `id`, `area_id`, `name` (*Placename*), `region` (*Placename*), `shelter_time`\n* **`Guideline`** – `code`, `area_id`, `zone_name`, `label` (*Placename*), `time_notes`, `mode`, `color_code`\n* **`Placename`** – multilingual string container (`en / he / ar / ru`)\n* **`AlertTranslation`** – four‑language mapping plus category metadata\n\n---\n\n## Example – Translate \u0026 Filter\n\n```python\nfrom oref import check_alert, translate\n\nalert = check_alert()\nif alert:\n    # Limit to Be’er Sheva \u0026 area‑id 165\n    alert.filter_locations([\"Be'er Sheva\", 165])\n    # Convert title/description to Russian\n    title_ru, desc_ru = translate(alert, \"ru\")\n    print(title_ru, \"::\", desc_ru)\n```\n\n---\n\n## Configuration\n\n`oref.config` exposes endpoint constants (`ALERTS_URL`, `LOCATIONS_URL`, `GUIDELINES_URL`, `ALERT_TRANSLATIONS_URL`). Override them **before** calling `init()` to point at mirrors, proxies, or test fixtures.\n\n---\n\n## Logging\n\nThe package emits informative messages via the standard `logging` module. Example:\n\n```python\nimport logging, oref\nlogging.basicConfig(level=logging.INFO)\noref.init()\n```\n\n---\n\n## Caveats\n\n* Unofficial – not endorsed by Pikud HaOref.\n* Upstream JSON schemas may change without notice.\n* Network polling every second like the official website; adjust in fork if lower bandwidth is essential.\n\n---\n\n## Licence\n\nMIT © 2025\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrothenberg%2Foref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femrothenberg%2Foref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrothenberg%2Foref/lists"}