mirror of
https://github.com/PlaneQuery/OpenAirframes.git
synced 2026-05-30 02:29:27 +02:00
rename to openairframes
This commit is contained in:
@@ -14,7 +14,7 @@ body:
|
|||||||
- Each object must include **at least one** of:
|
- Each object must include **at least one** of:
|
||||||
- `registration_number`
|
- `registration_number`
|
||||||
- `transponder_code_hex` (6 uppercase hex chars, e.g., `ABC123`)
|
- `transponder_code_hex` (6 uppercase hex chars, e.g., `ABC123`)
|
||||||
- `planequery_airframe_id`
|
- `openairframes_id`
|
||||||
- Your contributor name (entered below) will be applied to all objects.
|
- Your contributor name (entered below) will be applied to all objects.
|
||||||
- `contributor_uuid` is derived from your GitHub account automatically.
|
- `contributor_uuid` is derived from your GitHub account automatically.
|
||||||
- `creation_timestamp` is created by the system (you may omit it).
|
- `creation_timestamp` is created by the system (you may omit it).
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"pattern": "^[0-9A-F]{6}$"
|
"pattern": "^[0-9A-F]{6}$"
|
||||||
},
|
},
|
||||||
"planequery_airframe_id": {
|
"openairframes_id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1
|
"minLength": 1
|
||||||
},
|
},
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"required": [
|
"required": [
|
||||||
"planequery_airframe_id"
|
"openairframes_id"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ def submissions_to_dataframe(submissions: list[dict]) -> pd.DataFrame:
|
|||||||
- creation_timestamp (first)
|
- creation_timestamp (first)
|
||||||
- transponder_code_hex
|
- transponder_code_hex
|
||||||
- registration_number
|
- registration_number
|
||||||
- planequery_airframe_id
|
- openairframes_id
|
||||||
- contributor_name
|
- contributor_name
|
||||||
- [other columns alphabetically]
|
- [other columns alphabetically]
|
||||||
- contributor_uuid (last)
|
- contributor_uuid (last)
|
||||||
@@ -62,7 +62,7 @@ def submissions_to_dataframe(submissions: list[dict]) -> pd.DataFrame:
|
|||||||
"creation_timestamp",
|
"creation_timestamp",
|
||||||
"transponder_code_hex",
|
"transponder_code_hex",
|
||||||
"registration_number",
|
"registration_number",
|
||||||
"planequery_airframe_id",
|
"openairframes_id",
|
||||||
"contributor_name",
|
"contributor_name",
|
||||||
"contributor_uuid",
|
"contributor_uuid",
|
||||||
]
|
]
|
||||||
@@ -78,7 +78,7 @@ def submissions_to_dataframe(submissions: list[dict]) -> pd.DataFrame:
|
|||||||
"creation_timestamp",
|
"creation_timestamp",
|
||||||
"transponder_code_hex",
|
"transponder_code_hex",
|
||||||
"registration_number",
|
"registration_number",
|
||||||
"planequery_airframe_id",
|
"openairframes_id",
|
||||||
"contributor_name",
|
"contributor_name",
|
||||||
]
|
]
|
||||||
last_cols = ["contributor_uuid"]
|
last_cols = ["contributor_uuid"]
|
||||||
@@ -108,7 +108,7 @@ def main():
|
|||||||
"creation_timestamp",
|
"creation_timestamp",
|
||||||
"transponder_code_hex",
|
"transponder_code_hex",
|
||||||
"registration_number",
|
"registration_number",
|
||||||
"planequery_airframe_id",
|
"openairframes_id",
|
||||||
"contributor_name",
|
"contributor_name",
|
||||||
"tags",
|
"tags",
|
||||||
"contributor_uuid",
|
"contributor_uuid",
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ def group_by_identifier(submissions: list[dict]) -> dict[str, list[dict]]:
|
|||||||
key = f"reg:{submission['registration_number']}"
|
key = f"reg:{submission['registration_number']}"
|
||||||
elif "transponder_code_hex" in submission:
|
elif "transponder_code_hex" in submission:
|
||||||
key = f"icao:{submission['transponder_code_hex']}"
|
key = f"icao:{submission['transponder_code_hex']}"
|
||||||
elif "planequery_airframe_id" in submission:
|
elif "openairframes_id" in submission:
|
||||||
key = f"id:{submission['planequery_airframe_id']}"
|
key = f"id:{submission['openairframes_id']}"
|
||||||
else:
|
else:
|
||||||
key = "_unknown"
|
key = "_unknown"
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ def convert_faa_master_txt_to_df(zip_path: Path, date: str):
|
|||||||
certification = pd.json_normalize(df["certification"].where(df["certification"].notna(), {})).add_prefix("certificate_")
|
certification = pd.json_normalize(df["certification"].where(df["certification"].notna(), {})).add_prefix("certificate_")
|
||||||
df = df.drop(columns="certification").join(certification)
|
df = df.drop(columns="certification").join(certification)
|
||||||
|
|
||||||
# Create planequery_airframe_id
|
# Create openairframes_id
|
||||||
df["planequery_airframe_id"] = (
|
df["openairframes_id"] = (
|
||||||
normalize(df["aircraft_manufacturer"])
|
normalize(df["aircraft_manufacturer"])
|
||||||
+ "|"
|
+ "|"
|
||||||
+ normalize(df["aircraft_model"])
|
+ normalize(df["aircraft_model"])
|
||||||
@@ -38,11 +38,11 @@ def convert_faa_master_txt_to_df(zip_path: Path, date: str):
|
|||||||
+ normalize(df["serial_number"])
|
+ normalize(df["serial_number"])
|
||||||
)
|
)
|
||||||
|
|
||||||
# Move planequery_airframe_id to come after registration_number
|
# Move openairframes_id to come after registration_number
|
||||||
cols = df.columns.tolist()
|
cols = df.columns.tolist()
|
||||||
cols.remove("planequery_airframe_id")
|
cols.remove("openairframes_id")
|
||||||
reg_idx = cols.index("registration_number")
|
reg_idx = cols.index("registration_number")
|
||||||
cols.insert(reg_idx + 1, "planequery_airframe_id")
|
cols.insert(reg_idx + 1, "openairframes_id")
|
||||||
df = df[cols]
|
df = df[cols]
|
||||||
|
|
||||||
# Convert all NaN to empty strings
|
# Convert all NaN to empty strings
|
||||||
|
|||||||
Reference in New Issue
Block a user