Skip to content

Commit 091ccac

Browse files
committed
Use orjson in data_loader
1 parent fd01249 commit 091ccac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

data_loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""Data Loader CLI STAC_API Ingestion Tool."""
22

3-
import json
43
import os
54
from typing import Any
65

76
import click
7+
import orjson
88
from httpx import Client
99

1010

@@ -14,8 +14,8 @@ def load_data(data_dir: str, filename: str) -> dict[str, Any]:
1414
if not os.path.exists(filepath):
1515
click.secho(f"File not found: {filepath}", fg="red", err=True)
1616
raise click.Abort()
17-
with open(filepath) as file:
18-
return json.load(file)
17+
with open(filepath, "rb") as file:
18+
return orjson.loads(file.read())
1919

2020

2121
def load_collection(client: Client, collection_id: str, data_dir: str) -> None:

0 commit comments

Comments
 (0)