{"id":22087844,"url":"https://github.com/menychtak/sax-xml_mini_assignment","last_synced_at":"2025-03-23T22:32:07.169Z","repository":{"id":262898826,"uuid":"888168295","full_name":"menychtak/SAX-XML_mini_assignment","owner":"menychtak","description":"This mini-assignment demonstrates how to efficiently perform aggregation on a large XML file based on the 'year' tag. It utilizes SAX abstract class for parsing the XML file, ensuring minimal memory usage while handling sizable datasets. After performing the aggregation, the resulting dictionary is plotted for visualization.","archived":false,"fork":false,"pushed_at":"2024-11-14T21:54:49.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T05:44:54.686Z","etag":null,"topics":["logger","matplotlib","python","sax-parser","xml-parser"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/menychtak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-13T23:45:36.000Z","updated_at":"2024-11-14T21:54:53.000Z","dependencies_parsed_at":"2024-11-14T22:32:05.503Z","dependency_job_id":"e8c2409d-cb77-4038-bd03-622b19b648d6","html_url":"https://github.com/menychtak/SAX-XML_mini_assignment","commit_stats":null,"previous_names":["menychtak/sax-xml_mini_assignment"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/menychtak%2FSAX-XML_mini_assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/menychtak%2FSAX-XML_mini_assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/menychtak%2FSAX-XML_mini_assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/menychtak%2FSAX-XML_mini_assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/menychtak","download_url":"https://codeload.github.com/menychtak/SAX-XML_mini_assignment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245178542,"owners_count":20573305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logger","matplotlib","python","sax-parser","xml-parser"],"created_at":"2024-12-01T02:06:47.754Z","updated_at":"2025-03-23T22:32:07.136Z","avatar_url":"https://github.com/menychtak.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XML Publication Analyzer\n\nThis mini-assignment demonstrates how to efficiently perform aggregation and extract tag content from a large XML file to derive meaningful insights. It utilizes SAX abstract class for parsing the XML file, ensuring minimal memory usage while processing large datasets. After completing the aggregation, the resulting dictionary is visualized through a bar-chart using matplotlib.\n\n## Folder Structure\n\nThe project follows this structure:\n```\n.\n├── code\n│   └── main.py               # Main script to run the XML analyzer\n├── dataset\n│   └── file.xml              # Place your XML files here (e.g., file.xml)\n├── libs\n│   ├── xml_parser.py         # XML parsing logic\n│   ├── logger_config.py      # Logger setup\n│   ├── file_handler.py       # File handling utilities\n│   └── plotter.py            # Plotting functions\n├── .gitignore\n├── README.md\n└── requirements.txt\n```\n\n## Getting Started\n\n### Prerequisites\n\n- Python 3.x\n- Required packages listed in `requirements.txt`\n\nTo install the necessary packages, run:\n```bash\npip install -r requirements.txt\n```\n\n### Dataset\n\nTo replicate the results, download the XML dataset from [this link](https://dblp.org/xml/release/dblp-2024-10-01.xml.gz), unzip it, and place the `.xml` file in the `dataset` folder. Rename it to `file.xml` or update the path in the code.\n\n### Usage\n\n1. Add your XML file to the `dataset` folder.\n2. In `main.py`, set the `tag_name` variable to the tag you want to count. For example, to count occurrences of `\u003cyear\u003e` tags, set:\n   ```python\n   tag_name = \"year\"\n   ```\n3. Run the main script:\n   ```bash\n   python code/main.py\n   ```\n\n### Output\n\n- The script will output a dictionary with counts of each year (or specified tag) and display a bar chart of the publication counts.\n\n### Example\n\nAn example XML file containing `\u003cyear\u003e` tags can be found in the DBLP dataset linked above. The dictionary output will look something like:\n```json\n{\"2020\": 100, \"2021\": 150, \"2022\": 200}\n```\n\nThe program will also display a bar chart with the counts per year.\n\n---\n\n### License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmenychtak%2Fsax-xml_mini_assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmenychtak%2Fsax-xml_mini_assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmenychtak%2Fsax-xml_mini_assignment/lists"}