A quick (and rather specific) XLS
to MD
conversion tool for my local pedagogy management system.
I'm improving programming skills as I go so please feel free to fork this repo and contribute, you can also: Report a Bug / Request Feature
I've made this tool to support my own pedagogy management system that uses a local database made of Markdown files. I wanted a quick way to import student data to track locally. The database keeps me in touch with student trajectories and also helps with understanding where they are coming from, i.e. what courses/skills they have already picked up. I'm hoping to use this for my own post-human pedagogy research but that's another discussion 😄.
This tool is pretty barebones and is meant to give me a blank canvas for every student based off of their unique ID's. I should mention that this tool is designed around the University of New South Wales' (Australia) system where I work, and if you plan to use it you will need to make adjustments where necessary. That said, if you are from UNSW and find this useful, I'm glad I could have been of help!
This tool is made in Python and the code is open for scrutiny. Dependencies are required before you can use it from the CLI but installing a working copy of Python should be enough to run. To get a local copy up and running follow these simple example steps. I'm working on an executable for later
Make sure you have Python installed in your system, if you're on a Mac you can use Homebrew to install. The Homebrew webpage has instructions on how to install brew
. Some dependencies are required and can be installed with both Homebrew and pip
once you have Python setup.
pip install pandas openpyxl
pandas
is needed for handling Excel files and openpyxl
for working with .xlsx files, make sure both are included when installing.
There is no installation needed, you simply can clone the repo to a folder on your system.
git clone https://github.com/haakmal/xls2md.git
PS. I still haven't gotten around to making an executable. If anyone with more experience in programming is willing to help, or explain how to reduce the file size I am all ears!
Please be advised that this tool is very specific for my needs and I would recommend if you are using this to tweak to your requirements.
- I have a template MD file for all my students, this is where I collect information I need and add to for instance their weekly reports, discussions with them, etc
- I have a spreadsheet of students with required information (name, class, email, etc) that is fetched from our LMS. The script extracts the heading of each column as YAML data for the MD files and each row becomes a separate student file. The filename for my database requirements is set as the first column which in this case is an ID number.
- I have a list of tutors that are assigned to a student, I keep them also as MD files for my database and the script fetches the file names from a folder I pick so I can assign the tutor to the students record.
The data.xlsx is an example of how the spreadsheet should be prepared. In the template file there are sections for where data is added from the script. For my purposes I have it set in two places, you may need to tweak this to your requirements: {{YAML_DATA}}
and {{TITLE_DATA}}
.
Once I have everything collected i.e. spreadsheet, template, list of tutors in a folder, run the script using a terminal; currently it can only be initiated from CLI. Follow these steps:
- Open a terminal
- Navigate to repo folder
- Depending on your version of Python start the program using one of these commands:
python main.py
python3 main.py
This should start the GUI which then becomes self explanatory. Follow instructions selecting appropriate options and click the convert button. Each row from the spreadsheet will be extracted as individual MD files ready for your database!
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star if you found this helpful! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Dr Haider Ali Akmal - Links
Project Link: https://github.com/haakmal/xls2md