Person canonical name with a "Jr."

Issue #38 resolved
Lars Gustäbel
created an issue
import imdb
i = imdb.IMDb()
p = i.get_person("0002035")
print p["canonical name"]

This code prints

Jr., Sammy Davis

This is bad if you want to sort a list of Person objects according to the surname. I don't know if this is intentional but I would prefer the following notation:

Davis Jr., Sammy

I attached small patch that seems to fix the issue.

Thanks you very much for your work on imdbpy!

Comments (4)

  1. Davide Alberani repo owner
    • changed status to open

    Hi, first of all, thanks for the patch!

    The problem exists, indeed.

    I'm just trying to understand what is the best thing to do managing persons with multiple names and surnames.

    Beside this, I have a major doubt: do you think that the Jr. suffix should be bound to the surname or to the name?

    Isn't "Sammy Jr., Davis" "Davis, Sammy Jr." a better output?

    Thanks.

    (EDITED to fix the example)

  2. Log in to comment