Fetch only. This package fetches and parses the list. It does not screen names and it stores nothing. List data alone is not a clearance decision.

The EU Consolidated Financial Sanctions List (eu), published by the European Commission's Financial Sanctions Files (FSF) service. About 6,300 persons and entities.

Format used: the XML 1.1 file. FSF serves it from a public URL whose token query parameter is a fixed public token (dG9rZW4tMjAxNw, base64 for token-2017), not a credential; no account is needed. The file is about 26 MB and the server ignores Range requests, so raise http.max-response-bytes to at least 33554432 (32 MiB) for the run that fetches this list. Change detection uses Last-Modified: current-version reads it with a HEAD request, and fetch skips the download when you pass the version you already hold.

Example

out ::eu::sanctions/fetch()
out.version
first(out.entries).name

Values

LIST_NAME

LIST_NAME: Str "EU Consolidated Financial Sanctions List"

MONTHS

MONTHS: Map {
  jan: "01",
  feb: "02",
  mar: "03",
  apr: "04",
  may: "05",
  jun: "06",
  jul: "07",
  aug: "08",
  sep: "09",
  oct: "10",
  nov: "11",
  dec: "12"
}

NEEDED_RESPONSE_BYTES

NEEDED_RESPONSE_BYTES: Int 33554432

PAGE_URL

PAGE_URL: Str "https://data.europa.eu/data/datasets/consolidated-list-of-persons-groups-and-entities-subject-to-eu-financial-sanctions"

URL

URL: Str "https://webgate.ec.europa.eu/fsd/fsf/public/files/xmlFullSanctionsList_1_1/content?token=dG9rZW4tMjAxNw"

Functions

address-line

fn (node: Str): Str

blank-to-null

fn (v: Any): Str?

clean-list

fn (values: Vec): Vec<Str>

Trim strings, drop blanks and duplicates, keep the first-seen order.

country-of

fn (node: Str): Str?

current-version

fn (): Str?

The list's current version from one HEAD request, without downloading the list: its Last-Modified, or ETag. Compare it with the version you hold to skip a download. Null when the server sends neither, an Err when the request fails.

Example

::eu::sanctions/current-version()

dob-of

fn (node: Str): Str?

fetch

fn (): Map
fn (known-version: Str?): Map

Download and parse the EU list. Returns {version, entries, unchanged}, with SanctionEntity records in entries. known-version is the version you already hold: when the HEAD Last-Modified equals it, nothing is downloaded, unchanged is true and entries is null. A file over http.max-response-bytes is an Err saying how far to raise it. A list that parses to no records is an Err.

Example

out ::eu::sanctions/fetch()
again ::eu::sanctions/fetch(out.version)
again.unchanged

iso-date

fn (raw: Str?): Str?

Normalize one published date of birth to ISO 8601, or null when it has no year. Accepts 1948-12-10, 10 Dec 1948, Dec 1948, 1948, circa 1948, 10/12/1948 and dd/mm/1948 (day first), and ranges such as 1959 to 1962 or 01 Jan 1960 to 31 Dec 1962 (1959/1962, 1960/1962).

Example

::eu::sanctions/iso-date("10 Dec 1948")  // "1948-12-10"
::eu::sanctions/iso-date("dd/mm/1963")   // "1963"
::eu::sanctions/iso-date("1959 to 1962") // "1959/1962"

kind

fn (code: Str?): Str

other-names

fn (aliases: Vec, name: Str): Vec<Str>

Cleaned aliases without the primary name, ignoring case.

pad2

fn (s: Str): Str

parse

fn (doc: Str): Vec<SanctionEntity>

Parse the whole EU FSF XML 1.1 document into SanctionEntity records (pure).

parse-entity

fn (record: Str): SanctionEntity

Turn one <sanctionEntity> record string into a SanctionEntity. The primary name is the first English (nameLanguage="") alias; the others are aliases. Exposed for testing.

present

fn (v: Any): Bool

require-entries

fn (entries: Vec): Vec

The parsed records, or an Err when there are none: a changed file format can parse to nothing, and an empty list must not pass for a list with nobody on it.

Types

SanctionEntity

SanctionEntity type {
    id: Str,
    eu-reference: Str?,
    un-id: Str?,
    kind: SubjectKind,
    name: Str,
    aliases: Vec<Str>,
    dobs: Vec<Str>,
    citizenships: Vec<Str>,
    programmes: Vec<Str>,
    addresses: Vec<Str>,
    remarks: Str?,
    url: Str
}

One <sanctionEntity>, as the FSF XML 1.1 file publishes it.

Fields

  • id — the logicalId
  • eu-reference — the euReferenceNumber
  • un-id — the unitedNationId
  • kind — a SubjectKind
  • name — the primary name: the first alias with no nameLanguage
  • aliases — every other wholeName
  • dobs — dates of birth as ISO 8601: YYYY-MM-DD or YYYY
  • citizenships — ISO 3166-1 alpha-2 code, or the country description when the list gives no code
  • programmes — the regulations' programme codes
  • addresses — one line per address
  • remarks — the <remark> texts, joined with ;
  • url — the list's page on data.europa.eu

SubjectKind

SubjectKind type "individual" | "entity"

What the entry is: "individual" for the list's person subject type, "entity" for enterprise.