Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force stdlib etree instead of lxml? #248

Open
narfel opened this issue Apr 28, 2022 · 1 comment
Open

Force stdlib etree instead of lxml? #248

narfel opened this issue Apr 28, 2022 · 1 comment

Comments

@narfel
Copy link

narfel commented Apr 28, 2022

For my use case, when lxml is installed I get drastically less performance. In the init.py it says "

parser may be 'lxml', 'minidom' or None (then it will be automatically detected, lxml if possible).

How do I tell gpxpy to use that? parse(xml_or_file: Union[AnyStr, IO[str]], version: Optional[str] = None) has no option for a parser, or am I missing something?

@tkrajina
Copy link
Owner

tkrajina commented Nov 16, 2023

No, you're right. When I first implemented this lxml was faster, so I made to be default. But it absolutely makes sense to use the default parser by default. Maybe something like this: b75314d

That way, you gahe a global gpxpy.set_xml_etree() function where you can set lxml if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants