pub fn extract_package(import_statement: &str) -> StringExpand description
Extract the package name from an import statement
ยงExamples
use py_import_helper::utils::parsing::extract_package;
assert_eq!(extract_package("from typing import Any"), "typing");
assert_eq!(extract_package("import json"), "json");
assert_eq!(extract_package("from collections.abc import Mapping"), "collections.abc");