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

feat: make lxml optional (but don't yet remove from requirements) #166

Merged
merged 4 commits into from
Feb 1, 2023

Conversation

tlambert03
Copy link
Owner

@tlambert03 tlambert03 commented Feb 1, 2023

This PR makes slight modifications to the elem2dict function that makes it compatible with both lxml as well as standard lib xml.etree elements. I think the vast majority of the speedup of lxml compared to xmlschema parsing is the lack of schema validation. (i saw ~25% speedup with lxml over xml.etree ... nice, but shouldn't be mandatory given that lxml can lag behind with updates)

My hope here, in the next couple PRs is to disconnect the validation of incoming xml from the parsing of xml. We could make both xmlschema and lxml optional (needed only for validation of an xml instance against the schema ... which we don't particularly need here, given that pydantic will do that on the dict object)

@tlambert03 tlambert03 changed the title feat: make lxml optional (but don' feat: make lxml optional (but don't yet remove from requirements) Feb 1, 2023
@tlambert03 tlambert03 merged commit ad68535 into main Feb 1, 2023
@tlambert03 tlambert03 deleted the optional-lxml branch February 1, 2023 15:32
@tlambert03 tlambert03 added the enhancement New feature or request label Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant