Maryland is not found in subdivisions as a US state
Testing a lookup for "Maryland"
In [3]: pycountry.subdivisions.lookup('Maryland')
Out[3]: Subdivision(code='LR-MY', country_code='LR', name='Maryland', parent_code=None, type='County')
It does show up under US-MD
In [7]: pycountry.subdivisions.lookup('US-MD')
Out[7]: Subdivision(code='US-MD', country_code='US', name='Maryland', parent_code=None, type='State')
I ran into the same issue here, for the ambiguous subdivisions pycountry finds the first one and returns. If you want to find a subdivision within a particular country you could do something like
{subdiv.name.lower(): subdiv for subdiv in pycountry.subdivisions.get(country_code='US')}, and then you have a mapping for subdivisions within a country.
@jamesshieh @mmaroli is correct you can also use our newly implement search_fuzzy method in main thanks to #175
pycountry.subdivisions.search_fuzzy('Maryland')
[SubdivisionHierarchy(code='LR-MY', country_code='LR', name='Maryland', parent_code=None, type='County'), SubdivisionHierarchy(code='US-MD', country_code='US', name='Maryland', parent_code=None, type='State')]