Could you please suggest a Python library which detects chords out of notes like this:

>>> chord ('A C# E G')
It's A7 chord ^_^

What I've already tried:

Detects only more or less basic chords

It does exactly what I need, but is quite tricky to work with because of deprecated requirements and no documentation.

The amazingly powerful library made at MIT. Looks very promising, but displays chord names like this:

>>> chord.Chord('D F# C E').pitchedCommonName
'D-whole-tone tetramirror'

while I'm looking for the following output:


So the library I'm looking for:

  • is able to recognize advanced chords
  • outputs common abbreviated chord names
  • is well-documented


  • has a pip installation
  • has easy-to-install requirements
  • has clean and minimalistic syntax

Thank you very much in advance!

  • 1
    If it is Python, it’ll work on a Mac.
    – Eric S
    Commented Oct 6, 2019 at 14:32

1 Answer 1


Mingus can kind of do what you're asking for:

>>> from mingus.core import chords
>>> chords.determine('A C# E G'.split(),  shorthand=True)
['A7', 'C#dim|AM']
>>> chords.determine('D F# A C E'.split(),  shorthand=True)
['D9', 'Am|DM', 'Am|D7', 'F#m7b5|DM', 'F#m7b5|D7']

For more examples see the documentation.

Note that to get your second example correct I had to include the fifth which is the A note. Without it, it's not a proper D9 chord. To handle such situations, you could create some kind of lookup table so that if mingus doesn't return any result for your notes you pick the closest matching one.

  • Thanks a lot! For some reason, it throws the following error: >>> from mingus.core import chords File "/Users/zenberry/anaconda3/lib/python3.7/site-packages/mingus/core/chords.py", line 769 raise NoteFormatError, "Unrecognised note '%s' in chord '%s'"\ Might you probably know how to deal with this? Many thanks!
    – ZenBerry
    Commented Apr 15, 2020 at 14:38
  • 1
    I think you have accidentally installed the python2 version of the package. If you clear it out and install the python3 version it should work. Commented Apr 15, 2020 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.