MCPcopy Create free account
hub / github.com/FastLED/FastLED / parse_package_index

Method parse_package_index

ci/compiler/packages.py:443–451  ·  view source on GitHub ↗

Parse and validate package index JSON

(self, json_str: str)

Source from the content-addressed store, hash-verified

441 self.timeout = timeout
442
443 def parse_package_index(self, json_str: str) -> PackageIndex:
444 """Parse and validate package index JSON"""
445 try:
446 raw_data = json.loads(json_str)
447 return PackageIndex(**raw_data)
448 except ValidationError as e:
449 raise PackageParsingError(f"Invalid package index format: {e}")
450 except json.JSONDecodeError as e:
451 raise PackageParsingError(f"Invalid JSON format: {e}")
452
453 def parse_from_url(self, url: str) -> PackageIndex:
454 """Fetch and parse package index from URL with validation"""

Callers 4

parse_from_urlMethod · 0.95
parse_from_url_asyncMethod · 0.95
test_parse_valid_jsonMethod · 0.95

Calls 2

PackageIndexClass · 0.85
PackageParsingErrorClass · 0.85

Tested by 2

test_parse_valid_jsonMethod · 0.76