Skip to main content

OASIS Event Terms (OET v1.2) for CAP, with an SVG icon per event code.

Project description

CAP OASIS Event Terms (OET) + SVG Icons

OASIS Event Terms (OET v1.2) for the Common Alerting Protocol, packaged with an SVG icon for every one of the 224 event codes.

⚠️ Not an official icon set

This is not an official or standardised set of icons for the OASIS Event Terms. No standards body — OASIS, OCHA, WMO or anyone else — has endorsed these mappings.

It is an internal effort to standardise the icons used across the warning tools built at github.com/wmo-raf — including cap-composer, cap-aggregator and ClimWeb — so that the same event type looks the same wherever it is displayed or communicated.

The choice of icon for each event code is a judgement call, not a specification. The icons themselves are vendored from the OCHA Humanitarian Icons and Font Awesome Free (see LICENSE); neither project endorses this mapping.

The event terms themselves are standard — they come from the OASIS CAP Event Terms List v1.2.

Browse the icons

Browse all 224 icons here

What's inside

src/cap_oet/                 # the installable package
├── data/oet_v1_2.py         # the 224 OASIS event terms + lookup exports
├── mapping.py               # OET code -> source icon (OCHA name or "fa:<name>")
├── icons.py                 # get_icon_name / get_icon_svg / get_wagtail_icons
├── templatetags/cap_oet.py  # {% oet_icon "OET-079" %}
└── templates/cap_oet/icons/ # OET-000.svg ... OET-223.svg (fill=currentColor)

tools/build_site.py          # dev tool: builds docs/ — not shipped in the package
docs/                        # generated GitHub Pages site — not shipped either

Install

pip install cap-oet

Add to Django INSTALLED_APPS so the templates load:

INSTALLED_APPS = [..., "cap_oet"]

Use

Data:

from cap_oet import OASIS_EVENT_TERMS_BY_CODE, OASIS_EVENT_TERMS_AS_CHOICES

OASIS_EVENT_TERMS_BY_CODE["OET-079"]
# {'code': 'OET-079', 'term': 'flash flood', 'categories': ['Met']}

Icons in a template (colour via CSS because icons use currentColor):

{% load cap_oet %}
<span style="color:#d00">{% oet_icon "OET-079" class="oet-icon" width="24" height="24" %}</span>

Icons in Python:

from cap_oet import get_icon_svg, get_icon_name

get_icon_name("OET-079")  # "cap_oet/icons/OET-079.svg"

Wagtail icons

Every SVG carries id="icon-oet-<nnn>", Wagtail's icon convention, so the icons can go into the admin icon sprite.

get_wagtail_icons() returns the template paths for Wagtail's register_icons hook. Register them from your own wagtail_hooks.py:

from wagtail import hooks
from cap_oet import get_wagtail_icons


@hooks.register("register_icons")
def register_icons(icons):
    return icons + get_wagtail_icons()  # all 224
    # return icons + get_wagtail_icons(["OET-159", "OET-079"])  # or just what you need

Then render with Wagtail's own tag:

{% load wagtailadmin_tags cap_oet %}
{% icon name="oet-159" %}
{% icon name=alert.event_code|oet_icon_name %}   {# OET-159 -> oet-159 #}

Registering all 224 adds them to the admin sprite on every page (~170 KB). Pass a subset if you only need a few. get_wagtail_icons() lives in icons.py and imports fine without Wagtail installed.

{% oet_icon %} inlines the SVG and strips the id, so rendering the same icon twice on a page can't produce duplicate DOM ids.

Coverage

All 224 codes have an icon — there are no placeholders and no original artwork. Each is vendored from an existing open set and recoloured to currentColor:

Source Count Listed in
OCHA Humanitarian Icons 132 mapping.py::OCHA_SOURCED
Font Awesome Free (solid) 92 mapping.py::FA_SOURCED

Font Awesome fills the concepts OCHA doesn't cover (radiation, bomb, smog, icicles, plane-circle-xmark, …) and is normalized into the same 48×48 viewBox. Because the two sets are drawn in different styles, the family isn't perfectly uniform — STYLE_GUIDE.md records the OCHA rules as the target if any icon is redrawn later.

Icon explorer

Browse all 224 icons · Usage examples

Filter by category, grouping and source; search; resize; recolour; click any icon to copy its SVG. Every icon also has a stable URL, e.g. icons/OET-079.svg, and manifest.json is a machine-readable index of the whole set.

To rebuild it — the builder reads the icon SVGs, mapping.py and the OET data directly (no Django, no settings), so the output can't drift from the icon set:

python tools/build_site.py --out docs
docs/
├── index.html          explorer: filter by category, grouping and source; search;
│                       size slider; colour + dark-mode toggle; click to copy an SVG;
│                       shareable deep links (?cat=Met&grouping=fire)
├── manifest.json       224 × {code, term, grouping, categories, source, shared}
├── icons.svg           sprite of <symbol id="OET-079">, referenced via <use>
└── icons/OET-079.svg   every icon as its own file — stable public URL

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cap_oet-0.1.0.tar.gz (73.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cap_oet-0.1.0-py3-none-any.whl (151.9 kB view details)

Uploaded Python 3

File details

Details for the file cap_oet-0.1.0.tar.gz.

File metadata

  • Download URL: cap_oet-0.1.0.tar.gz
  • Upload date:
  • Size: 73.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cap_oet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 81bb58ed32730ad9b71ed7115bea1da3064e3007e77932957c4e2fa464fff630
MD5 95ebfe7b82ad70c0d0f989f7d848ef10
BLAKE2b-256 1e1ac1acda1d8bde796a081d8c092b4586e9eb3c2285362251689feeb013af44

See more details on using hashes here.

Provenance

The following attestation bundles were made for cap_oet-0.1.0.tar.gz:

Publisher: publish.yml on wmo-raf/cap-oet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cap_oet-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cap_oet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 151.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cap_oet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff5b5caf7accc241c16da7dd487dd655a37261ed01b556994249fbb41ce5cc79
MD5 7e22aed290e78e2c4e85d3af5017b623
BLAKE2b-256 d80f027e12ccf0f466ffb3ea85b9e073da71cf9bd9ec4db43444533c079b05a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cap_oet-0.1.0-py3-none-any.whl:

Publisher: publish.yml on wmo-raf/cap-oet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page