# Ceteris Lab downloadable Python script
# Course: Fundamentals of Python for Financial Econometrics

from pathlib import Path

root = Path.cwd()
figure_path = root / "figures" / "example.png"
print(figure_path.suffix)
print(figure_path.parent.name)

import json
from pathlib import Path

metadata = {
    "provider": "Bank of Canada",
    "series": "FXUSDCAD",
    "retrieved": "2026-08-15",
}
path = Path("data/metadata/example.json")
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(json.dumps(metadata, indent=2), encoding="utf-8")
print(path.exists())

from pathlib import Path
root = Path.cwd()
print(figure_path.suffix)
print(figure_path.parent.name)
import json
from pathlib import Path
