Python Package: MAKEITLITT

Python Package: MAKEITLITT

How to make progress and convert it into a Python Package?

Started this project a couple of weeks ago when I was working on a script realizing that the method I created could be generalized and could be used more often.

Then after a long notion of discussion with friends in open source community, concluded that how often we create a method, module, class, extended functionality, which feels like should had been the part of the built-in types or its corresponding extensions!

So to club together these custom dynamic?methods, modules, classes, creating general modules for repetitive tasks, etc.. under a common umbrella which will make it litt ??, hence the name of the package: MAKEITLITT

YOU are most welcome to contribute to this project! #opensourcedevelopment

Github Repo: MAKEITLITT

Getting Started

Most of the modeules are standalone but for few make require some additional packages which will taken care up by PIP.

Prerequisites

You need python 3 and any IDE installed. To install python:

Go to https://www.python.org/downloads/ and download any 3.x version for python        

Installation

Install the package using PYPI (pip)

pip install makeitlitt        

  1. For Stackoverflow module: To get the stack overflow results for the query we search daily for confirmation???

module name: stackoverflow

Import Statement:

from makeitlitt import stackoverflow        

Method name: get_stackoverflow_result(query, limit=2, **parameters)

Method Documentation:

Parameters
query [STRING]: stack overflow query to search
limit [INT]: Number of answers to display per page (DEFAULT - 2)


Optional keyword arguments::
@ans_format [INT]:
> 0 - Display only code snippets from answer (DEFAULT)
> 1 - Display detailed answer


@result [INT]:
> 0 [DEFAULT] - To print the result
> 1 - To get search_result {DICTIONARY} as return for search result
> 2 - Get result as key:value pair data with raw inputs and only formated answer body


Verified [BOOL] | (Under development) :
<TRUE> - To display only the Verified Accepted Correct Answer on the Stack overflow page.
<FALSE> - To display all the result within the limit. [DEFAULT]


Return:
search_result {DICTIONARY}:
> 'result_title': [STRING] <Title of the Result>
> 'page-n': [STRING] <page_data>, Where 'n' is page number & page_data is formated page result
> 'pages': [INT] <Number of pages in result>:        

Examples:

  • To print results of code snippets from stack overflow for mention query

from makeitlitt import stackoverflow as sf
sf.get_stackoverflow_result("list slicing in python")        

  • To get all raw scrapped data as a dictionary - answer format as snippet

from makeitlitt import stackoverflow as s
search_results_snippets = sf.get_stackoverflow_result("list slicing in python",result=2)         

  • To get all raw scrapped data as a dictionary - answer format as detailed

from makeitlitt import stackoverflow as s
search_results_snippets = sf.get_stackoverflow_result("list slicing in python", ans_format=1, result=2)         

>> 2. For fetching all the search result URLs on Google search engine for a search query:

To get the URL search results for the query to perform scrapping, SEO analysis or any other user case. Module name: stackoverflow

Method name: get_google_searchResult_Links(query, domain_name=0)

Method Documentation:

Parameters:
query [STRING]: Query to search.
domain [STRING]: To filter the result based on a particular website.
                [Default]: 0 --> Get All results irrespective of domain name

Return:
result_links [List]:
    [...,] - Result Urls scraped for the search page
    [-1] - If no result found for filtered website with requested query
    [0] - If no result found on the Internet        

Examples:

  • To get all the URLs of searched query as result

from makeitlitt import stackoverflow as sf
sf.get_google_searchResult_Links("How to create a pancake?")        

  • To get all the URLs of searched query from a particular domain

from makeitlitt import stackoverflow as s
sf.get_google_searchResult_Links("How to create a dictionary in python?", domain_name="stackoverflow.com")f        

If you read so far, then don't forget to add a ?on the github repo. YOU are most welcome to contribute to this project! #python3 #packaging #opensourcedevelopment #makeitlitt #learningandgrowing

No alt text provided for this image

Seems like Diwali dhamaka

Shubham Saini

Application Development Analyst at Accenture

2 年

????

要查看或添加评论,请登录

Siddharth Verma的更多文章

社区洞察

其他会员也浏览了