diff --git a/src/ua_parser/__init__.py b/src/ua_parser/__init__.py index abe2d3d..74771c4 100644 --- a/src/ua_parser/__init__.py +++ b/src/ua_parser/__init__.py @@ -25,6 +25,8 @@ parser: Parser + + def __getattr__(name): global parser if name == "parser": @@ -49,6 +51,7 @@ def parse(ua: str) -> ParseResult: you're not going to use *all* of them. """ from . import parser + return parser.parse(ua) @@ -57,6 +60,7 @@ def parse_user_agent(ua: str) -> Optional[UserAgent]: :func:`global parser `. """ from . import parser + return parser.parse_user_agent(ua) @@ -65,6 +69,7 @@ def parse_os(ua: str) -> Optional[OS]: `. """ from . import parser + return parser.parse_os(ua) @@ -73,4 +78,5 @@ def parse_device(ua: str) -> Optional[Device]: parser `. """ from . import parser + return parser.parse_device(ua)