I have a local git repo and I'm trying to find a way to get a specific version of my xlsx file into my Python code so I can process it using pandas.
I found gitpython lib; but I'm not sure how to use it correctly.
repo = Repo(path_to_repo)
commit = repo.commit(sha)
targetfile = commit.tree / 'dataset.xlsx'
I don't know what to do next. I tried to load it to pandas using path; but, of course, it just loads my last version.
How to load previous version of xlsx to pandas?
git checkout <commit-hash>orgit switch --detach <hash>for instance, orgit restoreto extract one particular file)? Then you can just use your OS's ordinary file facilities to read the file, now that it's not in Git any more.