Code Monkey home page Code Monkey logo

python-task's Introduction

Note: There's extensive commentary and documentation on every file.

How this code is organized

There are 4 files that implement functions and classes, they are:

  • DataScraper.py: Implements most of the classes and the solution for the third task, that scrapes the web, and returns a summary of the top 5 pages from google, that is relevant to the query of the user.

  • OverlappingLines.py: Implements the solution for the first task, checking whether two lines overlap or not. There is also another function that checks if any set of lines do have a overlap, so the user can input N lines and expect True if they overlap, False otherwise.

  • Searchers.py: Class implementation for the GoogleSearcher, can be easily extended to include other search engines.

  • VersionString.py: Implementation for the second task, to check that given two version strings, check if the first is equal, higher or lower than the second.

Also, there is a fifth file, called sergio_marques_test.py, which has all the tests for all the classes and functions for the four files above. It uses unittesting and can by run by issuing python sergio_marques_test.py.

Requirements

Code was tested on Python 3.7, the libraries used are:

google:2.0.2 -> https://pypi.org/project/google/
requests-mock:1.5.2 -> https://pypi.org/project/requests-mock/
beautifulsoup4:4.6.3 -> https://pypi.org/project/beautifulsoup4/
nltk:3.4 -> https://pypi.org/project/nltk/
numpy:1.15.4 -> https://pypi.org/project/numpy/
scikit-learn:0.20.1 -> https://pypi.org/project/scikit-learn/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.