[dgplug-users] Need feedback for my python script.

Abhishek Singh asraisingh at gmail.com
Tue Dec 12 01:26:31 PST 2017


On Tue, Dec 12, 2017 at 12:17 PM, Jaysinh Shukla <jaysinhp at gmail.com> wrote:

> On Fri, Dec 08, 2017 at 01:12:24AM +0530, Abhishek Singh wrote:
> > Hello Everyone,
> >
> > I'm Abhishek Singh. Today I created a python script to get the email id
> of
> > LinkedIn users who share their email ids in there profile description
> using
> > google custom search engine API. It eases hassles in searching and
> getting
> > email ids of various peoples at various job roles from different
> > organizations. Tried to use all the lessons which I got from dgplug
> > training in this small script including git and markdown lessons.
> >
> > Feedback will be appreciated.
> >
> > Link to git repo: https://github.com/asraisingh/linkedin-email-extractor
> >
> >
> > Abhishek Singh
> > www.iabhishek.me
>
> Hello Abhisek,
>
>   Nice to see you are applying what you had learned. I skimmed your
> code and below are my initial level comments.
>
> 1. "LEE saves the link to the profile and ..." It should be "LEE saves
> the link of the profile and ..." source README.md [1]
>
> 2. You have created no functions. All of your logic is written under the
> one if block. I am finding one nested function "google_search". I
> personally don't like wrapping things under a nested function. You
> should isolate operations into functions.
>
> 3. Exporting to ".xsl" is a possible option, but I will recommend
> choosing more generic formats like CSV [2].
>
> 4. I will not prefer to commit options statically. Options like output
> file name, expected file format should be available from the command
> line. A user has to visit the source for identifying available command
> line options. Take an example of tar [3] utility. Do you go to source
> for identifying options? Use argparse [4] module and construct a decent
> command line options.
>
> 5. Mentioning library dependencies to a file is an extremely required
> thing.  You should use tools like Virtualenv [5] for isolating your
> environment.  Please search for a decent tutorial or ask me here for
> further help.
>
> 6. Avoid pointless comments. A comment should describe "Why" and not
> "What". Writing comment is an art. Don't describe obvious stuff. What
> function does should never be part of the comment. I should be able to
> judge what it does from its signature. Such things can improve by
> improving or reading code managed by minded people.
>
> 7. Function comments are written as docstring [6]. Source [7]
>
> 8. I will suggest storing API credentials at environment variables and
> read the environment variable in code.
>
>
> I will love to comment on performance once above suggestions are mat.
> Please reply with your concerns. Thanks!
>
>
> 1: https://github.com/asraisingh/linkedin-email-extractor/
> blame/master/README.md#L3
> 2: https://en.wikipedia.org/wiki/Comma-separated_values
> 3: https://www.gnu.org/software/tar/
> 4: https://docs.python.org/3/library/argparse.html
> 5: https://virtualenv.pypa.io/en/stable/
> 6: https://www.python.org/dev/peps/pep-0257/
> 7: https://github.com/asraisingh/linkedin-email-extractor/blob/
> master/lee.py#L44


Thank You Jaysinh, for your feedback. I will let you know, once I will
commit the changes you suggested.


More information about the Users mailing list