diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..379270c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Edward Betts + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d8cc910 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# GLAM Wiki schedule parser + +## Overview + +The GLAM Wiki Schedule Parser (`parse.py`) is a Python script designed to convert event schedules from a specific format used in Wikimedia's wiki pages into XML. It's tailored for the GLAM Wiki 2023 event, focusing on Galleries, Libraries, Archives, and Museums. The script is adept at handling complex schedules involving multiple days, sessions, and speakers. + +## Features + +- Parses wiki-formatted schedule pages. +- Converts schedule data into a structured XML format. +- Handles multiple days, rooms, and sessions. +- Generates unique identifiers for events and speakers. + +## Requirements + +- Python 3 +- `lxml` library for XML handling. + +Ensure that your Python environment has the `lxml` package installed. You can install it using pip: + +```bash +pip install lxml +``` + +## Usage + +To use the script, simply pass the filename of the wiki-formatted schedule page as an argument: + +```bash +./parse.py [filename] +``` + +Replace `[filename]` with the path to your schedule file. + +## Functionality + +- `md5sum`: Generates a hex MD5 sum for a given string. +- `content_to_url`: Converts a wiki link to a full URL. +- `minutes_to_duration`: Converts minutes to a duration string. +- `build_event`: Constructs an XML element for an event. +- `read_wikitext`: Parses the wiki-formatted schedule file. +- `generate_schedule`: Creates the complete schedule in XML format. +- `main`: Entry point for the script. Parses the given file and prints the XML. + +## Limitations + +- The script is specifically designed for the GLAM Wiki 2023 format and may not work with other event formats without modification. +- Error handling is minimal, assuming well-formatted input. + +## Contributions + +Feel free to contribute to this project by submitting issues or pull requests to https://git.4angle.com/edward/glam-wiki-schedule. + +## License + +This script is open-source and is available under the MIT license - see the [LICENSE](LICENSE) file + +## Contact + +For any queries or contributions, please contact Edward Betts at edward@4angle.com.