pip install xml_thunder
XML Thunder provides a class called 'Lightning'. The Lightning class's primary purpose is used for creating an XML parser. The Lightning class provides the following methods:
- __init__(self)
- Initializes an empty private dictionary
- __repr__(self)
- Returns the string of the private dictionary
- __str__(self)
- Returns the string of the private dictionary
- __contains__(self, route: String)
- Returns a bool if the route is in the keys of the private dictionary
- __getitem__(self, route: String)
- Returns None or a Callable from the private dictionary
- __setitem__(self, route: String, function: Callable)
- Maps a route to the function
- Returns None
- __delitem__(self, route: String)
- Deletes the specified route
- Returns None
- __len__(self)
- Returns the length of a private dictionary
- __bool__(self)
- Returns True if the private dictionary is empty
- get_all_routes(self)
- Returns all registered routes in the private dictionary
- route(self, path: String)
- Creates a route for the provided 'path'
- 'path' is any valid xPath
- Note that this method is a decorator and should be used as such
- parse(self, xml_like_document: String | FileObject)
- The entrypoint for parsing xml strings/files
- Returns None