Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial matches are excluded #3

Open
ryanakuhl opened this issue Apr 12, 2018 · 0 comments
Open

Partial matches are excluded #3

ryanakuhl opened this issue Apr 12, 2018 · 0 comments

Comments

@ryanakuhl
Copy link

ryanakuhl commented Apr 12, 2018

As written, the company in Excel would need to be an identical match to that in the listing. May I suggest looking for a partial match? For example, I've missed a few that had 'Co' and not 'Company'.

Lines 206 - 214:
company_name = d.entries[entry].title.lower()
company_name = company_name.split('- ')
company_name = company_name[1].split(' (')
company_name = company_name[0]
company_name = company_name.replace('.', '')
company_name = company_name.replace(',', '')
if '&' in company_name:
company_name = company_name.replace('&', '&')
if company_name in lower and d.entries[entry].title[0:1:] == '4':

This code cleans the abbreviation at the end, then looks for a partial match. You also don't need 'd.entries[entry].title[0:1:] == '4':`' if you append the url to be '...&type=4&...'

Suggested alternative:

company_name = d.entries[entry].title.lower()
company_name = company_name.split('- ')
company_name = company_name[1].split(' (')
company_name = company_name[0]
company_name = company_name.replace('.com', ' com')
company_name = company_name.replace('.', '')
company_name = company_name.replace(',', '')
if '&' in company_name:
company_name = company_name.replace('&', '&')
if ''' in company_name:
company_name = company_name.replace(''', "'")
end = ['inc' , '& co' , 'corp', 'lp', 'llc', 'co', 'plc', 'lp', 'corporation', 'fund', 'incorporated', 'ltd', 'trust']
if company_name.split()[-1] in end:
company_name = company_name.split()[:-1]
company_name = ' '.join(company_name)
for s in lower:
if company_name in s and d.entries[entry].title[0:1:] == '4':

I really appreciate you putting this together. I'm still learning (Python and Github), but I tweaked it and added a GUI alert and also monitor 8k for short options. It's in my Repository if you're interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant