GithubHelp home page GithubHelp logo

xml_merge's Introduction

XML to XLSX Converter and Data Merger

This Python script is designed to convert XML files to XLSX format and merge data from multiple XLSX files into a single file.

Features

  • XML to XLSX Conversion: Converts XML files to XLSX format while preserving XML attributes.
  • Data Merging: Merges data from multiple XLSX files based on specified columns.
  • Automatic Chunking: Splits merged data into smaller chunks if the size exceeds a specified limit.

Requirements

  • Python 3.x
  • xml.etree.ElementTree module
  • openpyxl library
  • pandas library

Usage

XML to XLSX Conversion

from xml_to_xlsx import xml_folder_to_xlsx

# Specify the folder containing XML files and the folder to save XLSX files
xml_folder = "path/to/xml_folder"
xlsx_folder = "path/to/xlsx_folder"

# Convert XML files to XLSX
xlsx_files = xml_folder_to_xlsx(xml_folder, xlsx_folder)

Data Merging

from data_merger import merge_xlsx_files

# Specify the folder containing XLSX files
folder_path = "path/to/xlsx_folder"

# Merge data from XLSX files
merge_xlsx_files(folder_path)

Folder Structure

  • xml_to_xlsx.py: Contains functions for XML to XLSX conversion.
  • data_merger.py: Contains functions for merging data from XLSX files.
  • test: Example folder containing XML and XLSX files.

How it Works

  1. XML to XLSX Conversion: The script parses XML files and extracts attribute data. It then organizes the data into XLSX files, preserving the structure of the XML attributes.

  2. Data Merging: The script reads multiple XLSX files, extracts specified columns, and merges them into a single DataFrame. If the merged data exceeds a specified size limit, it automatically splits the data into smaller chunks, each saved as a separate XLSX file.

Limitations

  • XML parsing errors may occur if the XML files are not well-formed.
  • The script assumes consistent column structures across XLSX files for merging.

Feel free to customize this README according to your project's specific details and requirements!

xml_merge's People

Contributors

kvlrdhrs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.