Skip to content

Instantly share code, notes, and snippets.

@lpinner
Last active April 23, 2021 08:35
Show Gist options
  • Save lpinner/e6b9a25831d66c83e7e9bc3a26cc30b5 to your computer and use it in GitHub Desktop.
Save lpinner/e6b9a25831d66c83e7e9bc3a26cc30b5 to your computer and use it in GitHub Desktop.
Convert tab to chordpro format
#!/usr/bin/env python3
# -*- coding: iso-8859-1 -*-
######################################################################
# Copyright: lpinner 2021
# License: Apache 2.0
#####################################################################
import os
import subprocess
def tab_to_pro(f):
return subprocess.check_output(['chordpro', '--a2crd', f])
if __name__ == '__main__':
import os, sys
f = sys.argv[1]
o = os.path.splitext(f)[0] + '.pro'
assert f != o, "Input file (%s) can't be the same as the output file" % os.path.basename(f)
with open(o, 'wb') as p:
p.write(tab_to_pro(f))
@joshuadanpeterson
Copy link

Awesome! Thank you for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment