fsa-food-hygiene-london
收藏资源简介:
FSA食品卫生评级(FHRS)— 伦敦数据集是一个由英国食品标准局(FSA)发布的食品卫生评级开放数据的整理版本。该数据集涵盖了伦敦33个地方当局(包括32个区和伦敦金融城公司)内所有根据食品卫生评级计划(FHRS)进行评级的食品场所。原始数据由FSA每日更新,以每个当局一个XML文件的形式发布,且不保留公开历史记录。因此,本数据集的每周提交和月度存档标签(archive-YYYY-MM)构成了伦敦食品商业景观独一无二的纵向记录,在其他地方无法获取。数据集的核心内容包含一个合并所有33个当局数据的Parquet表格文件(fsa_fhrs_london_food_hygiene.parquet),其中每条记录代表一个食品场所。数据字段包括:场所ID、业务名称、业务类型、地址信息(多行)、邮编、当前评级值(0-5或‘Exempt’、‘AwaitingInspection’等字符串)、评级日期、以及卫生、结构和管理信心三个组成部分的扣分分数(分数越低越好)。此外,还包含经度、纬度地理坐标以及添加的‘local_authority’(检查当局)列。所有列均存储为字符串类型。数据集同时提供了原始的、未经修改的33个FSA XML文件的压缩包(fsa_fhrs_london_food_hygiene_raw_xml.zip),作为可重新处理的权威记录。该数据集由uk-open-data项目策划和维护,通过每周运行的自动化管道从FSA重新下载数据,将其整理为便于分析的Parquet格式,根据声明的模式进行验证,并上传至本仓库。主分支(main)始终包含最新数据,而月度标签则提供了历史快照,确保了数据发布方的静默修订得以可见。数据集适用于食品安全与合规性分析、城市商业地理空间分布研究、公共卫生监测、商业智能以及数据工程管道测试等场景。使用者需注意:评级反映的是最近一次检查的结果(检查日期可能较早);评级值不全是数字;部分记录可能缺少地理编码或邮编;数据仅代表当前状态,历史变化需通过本仓库的提交历史和存档标签追踪。数据在开放政府许可证(OGL v3.0)下提供。
The FSA Food Hygiene Rating (FHRS) – London Dataset is a curated version of open food hygiene rating data released by the UK Food Standards Agency (FSA). This dataset covers all food establishments rated under the Food Hygiene Rating Scheme (FHRS) across the 33 local authorities in London, including 32 boroughs and the City of London Corporation. The original data is updated daily by the FSA, released as one XML file per authority, with no public historical records retained. As such, the weekly commits and monthly archive tags (archive-YYYY-MM) of this dataset constitute a unique longitudinal record of London’s food commercial landscape that is unavailable elsewhere. The core content of the dataset includes a Parquet table file (fsa_fhrs_london_food_hygiene.parquet) that merges data from all 33 authorities, with each record representing one food establishment. The data fields include: establishment ID, business name, business type, address information (multi-line), postal code, current rating value (either 0-5 or strings such as "Exempt" and "AwaitingInspection"), rating date, and deduction scores for the three components of hygiene, structural compliance, and management confidence (lower scores indicate better performance). Additionally, geographic coordinates of longitude and latitude, as well as an added "local_authority" (inspecting authority) column, are included. All columns are stored as string types. The dataset also provides a compressed archive (fsa_fhrs_london_food_hygiene_raw_xml.zip) containing the original, unmodified 33 FSA XML files as authoritative records that can be reprocessed. This dataset is curated and maintained by the uk-open-data project. It automatically re-downloads data from the FSA via a weekly automated pipeline, organizes it into analysis-friendly Parquet format, validates it against the declared schema, and uploads it to this repository. The main branch always contains the latest data, while the monthly archive tags provide historical snapshots, ensuring that silent revisions made by the data publisher are visible. This dataset is applicable for use cases including food safety and compliance analysis, urban commercial geospatial distribution research, public health monitoring, business intelligence, and data engineering pipeline testing. Users should note that: Ratings reflect the results of the most recent inspection (the inspection date may be older); Not all rating values are numeric; Some records may lack geocoding or postal code information; The data only represents the current state, and historical changes must be tracked via the repository's commit history and archive tags. The data is made available under the Open Government Licence v3.0 (OGL v3.0).
数据集概述
数据集名称:FSA food hygiene ratings (FHRS) — London
数据集描述:该数据集收录了伦敦33个地方当局(32个行政区加伦敦金融城)中所有在食品卫生评级计划(FHRS)下获得评级的食品经营场所信息。数据由英国食品标准局(FSA)发布,每日更新。由于FSA不保存公开历史记录(每日的提取会覆盖前一日数据),本数据集的每周提交和每月存档标签(archive-YYYY-MM)构成了伦敦食品经营场所长期变化记录。
数据提供方:英国食品标准局(FSA)
更新频率:FSA每日更新每个地方当局的文件,因此每周运行的数据处理流程应能检测到变化。评级会随着检查的持续进行而不断变化。
许可证:Open Government Licence v3.0
数据集配置:fsa_fhrs_london_food_hygiene
数据文件:
fsa_fhrs_london_food_hygiene.parquet:合并了所有33个地方当局数据的主表,每行代表一个经营场所,包含local_authority列。所有列均为字符串类型(rating_value并非总是数值)。此为尽力推导的文件,原始XML压缩包为权威来源。fsa_fhrs_london_food_hygiene_raw_xml.zip:包含33个未修改的FSA XML文件(FHRS<code>en-GB.xml, codes 501-533),打包为一个确定的ZIP文件。作为存档记录,可在需要时重新处理以重建或扩展主表。
数据列说明:
| 列名 | 类型 | 描述 |
|---|---|---|
local_authority |
string | 检查的伦敦地方当局(合并时添加,原始FSA XML行中无此列) |
fhrs_id |
string | FSA的唯一经营场所ID |
local_authority_business_id |
string | 地方当局自己的经营场所ID |
business_name |
string | 经营名称 |
business_type |
string | FSA经营类型标签(例如餐厅/咖啡馆/食堂) |
business_type_id |
string | FSA经营类型代码 |
address_line_1 |
string | 地址行(可能为空) |
address_line_2 |
string | 地址行(可能为空) |
address_line_3 |
string | 地址行(可能为空) |
address_line_4 |
string | 地址行(可能为空) |
post_code |
string | 邮政编码(可能为空) |
rating_value |
string | 评级值:0-5,或Exempt/AwaitingInspection/AwaitingPublication,故为字符串 |
rating_key |
string | FSA用于评级图片/标签的内部键 |
rating_date |
string | 最近一次检查的ISO日期(yyyy-mm-dd);未评级时为空 |
new_rating_pending |
string | 当新评级等待发布时为True |
score_hygiene |
string | 卫生扣分项——越低越好;豁免/未评级时为空 |
score_structural |
string | 结构扣分项——越低越好;豁免/未评级时为空 |
score_confidence_in_management |
string | 管理信心扣分项——越低越好;豁免/未评级时为空 |
longitude |
string | 发布的WGS84经度(可能为空) |
latitude |
string | 发布的WGS84纬度(可能为空) |
数据处理与访问
-
数据更新:由uk-open-data项目维护,每周运行数据流程:重新下载FSA发布的XML文件,整理为可直接分析的Parquet格式,验证后上传。
main分支始终为最新数据;每月生成一个archive-YYYY-MM的Git标签用于快照存档。 -
访问方式:文件支持CORS和HTTP范围请求,可通过浏览器直接查询(如使用DuckDB-Wasm或
fetch())。- 最新数据:
https://huggingface.co/datasets/jhumbl/fsa-food-hygiene-london/resolve/main/<filename> - 快照数据:
https://huggingface.co/datasets/jhumbl/fsa-food-hygiene-london/resolve/archive-YYYY-MM/<filename> - DuckDB:
hf://datasets/jhumbl/fsa-food-hygiene-london/<filename>
DuckDB查询示例: sql SELECT * FROM hf://datasets/jhumbl/fsa-food-hygiene-london/fsa_fhrs_london_food_hygiene.parquet LIMIT 10;
- 最新数据:
注意事项
- 评级反映的是经营场所最近一次检查的结果,该检查可能发生在多年前——在将评级视为当前状况前,请先检查
rating_date。 rating_value并非总是数值:除0-5外,还可能为Exempt、AwaitingInspection或AwaitingPublication,因此在合并表中保持为文本格式。- 分项分数(卫生、结构、管理信心)为扣分制——越低越好——豁免/未评级的经营场所分项分数缺失。
- 部分记录缺少地理编码和/或邮政编码;不应假设每一行都能被映射。
- 经营场所归属于进行检查的地方当局(通常为场所所在地)。伦敦的数据包括伦敦金融城公司,其管辖范围也涵盖平方英里以外的部分市场。
- FSA仅发布当前状态,无公开存档——这些文件的历史记录累积在本数据集的每周提交和每月存档标签中。
- XML头部嵌入了FSA每日的
ExtractDate,因此即使在没有评级实际变化的极少数周内,原始ZIP文件每次每周运行后哈希值也会改变——ZIP文件的改变并不一定意味着评级发生了变化。





