Git Product home page Git Product logo

searchor's Introduction

Searchor

GitHub repo size

Json-Generator

 forks

PyPI Discord

Description

Searchor is an all-in-one PyPi Python Library that simplifies web scraping, obtaining information on an topic, and generating search query URLs. Searchor is an a efficient tool for Python developers, with many web development needs in one, with support of over 100+ Engines and custom engines allowed, making it easy for developers to use for their web programming needs in Python without relying on many third-party dependencies. Furthermore, Searchor has a wide range of support, including command line interface and pip.

Installation

Python 3.7+ is required

# MacOS / Linux (via Terminal)
python3 -m pip install -U searchor

# Windows (via CMD Prompt)
py -3 -m pip install -U searchor

Quick Start

>>> from searchor import Engine
>>> Engine.Google.search("Hello, World!"))
'https://www.google.com/search?q=Hello%2C%20World%21'

Custom Engine

>>> from searchor import Engine
>>> Engine.new("Colgate", "https://www.colgate.com/en-us/search/all?term=")
>>> Engine.Colgate.search("Hi world!")
'https://www.colgate.com/en-us/search/all?term=Hi%20world!"

Searchor CLI Quick Start

$ searchor Google "Hello World!" --copy


Web Scrape

>>> from searchor import Information
>>> Information.scrape("https://google.com")
>>> '{'title': 'Google', 'paragraphs': [<p style="font-size:8pt;color:#70757a">© 2023 - <a href="/intl/en/policies/privacy/">Privacy</a> - <a href="/intl/en/policies/terms/">Terms</a></p>]}'

Get Information

>>> from searchor import Information
>>> Information.getinfo("GitHub")
>>> 'GitHub, Inc. is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous integration, and wikis for every project. Headquartered in California, it has been a subsidiary of Microsoft since 2018.'

Take a look at more examples in the examples folder!

Note:  Engine names follow the UpperCamelCase convention.(eg: ChromeWebStore).

Docker

Building the docker image

$ docker build -t searchor .

Running searchor on the docker container

$ docker run --rm -it searchor sh
/usr/src/searchor/examples # python searchamazon.py
https://www.amazon.com/s?k=Hello%2C%20World%21

v2.5.2 Changes

v2.5.0

  • [ADDED] Added a new Enum class Information.
  • [ADDED] Added getinfo function in the Information Enum to gather information about a given topic, using Wikipedia.
  • [ADDED] Add web_scraper function in the Information Enum, to web scrape a URL that is given.
  • [ADDED] Added bs4 and requests as dependencies.
  • [MODIFIED] The Searchor Package is now officially becoming a library, and is therefore no longer considered a package.

v2.5.2

  • [FIXED] Fixed issue with web scraping, with attribute errors, and CLI issues

Migration

Instead of different functions for each engine, Searchor v2.2.0 uses a single function with an Engine enum. This makes it easier to use and maintain. If you're migrating from v2.0.0, compare the differences between the following snippets:

# Searchor 2.0.0
from searchor import search, Engine
search("Hello, World!", Engine.Google)
# Searchor v2.2.0
from searchor import Engine
Engine.Google.search("Hello, World!")

Want to contribute?

Take a look at the contributing guidelines!


© Arjun Sharda 2022-present
All Rights Reserved

searchor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

searchor's Issues

Adding One new query search engine!!!

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

Additional information
Added line for new query engine and tried to enhance the customer satisfaction regarding search for entertainment site directly

Making README more appealing

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature

  • Acknowledge the contributing by mentioning them in README file
  • Contributors would automatically be added to the list
  • Create a link to CONTRIBUTING.md in README
  • Adding Socalify element to the README to make it more appealing

Provide any alternatives to the feature you've considered

Additional information

Glimpse

image

Add Custom search engine

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

This adds a custom search engine. As a user of Searchor, I can see it's really annoying to not have the option and is one of the disadvantages of Searchor. I think a custom search engine would be really useful.

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

Add G2 search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Adds G2 Search queries function, will be added in v2.1.2

Provide any alternatives to the feature you've considered
N/A

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

ELIGIBLE FOR HACKTOBERFEST IF V2.1.2 IS RELEASED AFTER OCTOBER 1ST, 2022 AND BEFORE OCTOBER 31, 2022. READ MORE ABOUT HACKTOBERFEST HERE

Adding Docker Hub search engine query

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
Docker Hub's registries access easily

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

Additional information
Helpful in Devops

Improve documentation on README

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

The readme documentation looks organized, but I think we should make it more clear for each example provided.

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

Additional Query Parameters

Describe the feature
This feature would aim to expand upon the previous Engine class by adding additional (and optional) query parameters that are specific to each URL. This could be, for example,

  1. https://www.google.com/search?q=someSearch&num=10 | generate a URL that will fetch a specific # of results for a query
  2. https://chrome.google.com/webstore/search/someSearc?_feature=5stars | generate a URL that will fetch only 5 star extensions

as result of changing the Engine class to support this, the search function would also be tweaked in the process.

Provide any alternatives to the feature you've considered
Allowing the search function to directly accept additional query params as kwargs or a dictionary parameter to allow broader functionality at the user's discretion. This is similar to the original proposal.

Additional information
This is based off the assumption that this project would want to move beyond minimalistic search querying. In the case a user would want to generate a URL with additional query parameters past the standard search query, they would have to manually write a wrapper for the search function which is for sure an inconvenience.

Add auto labeler for PRs and Issues

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

This workflow will automatically label PRs and Issues based on the text of the issue / PR.

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

I can work on this.

Add FedEx search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->
Adds FedEx search queries function.

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?
No

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

ELIGIBLE FOR HACKTOBERFEST IF V2.1.2 IS RELEASED AFTER OCTOBER 1ST, 2022 AND BEFORE OCTOBER 31, 2022. READ MORE ABOUT HACKTOBERFEST HERE

Add USPS search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Adds USPS search queries function
Will be added in v2.1.2

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

ELIGIBLE FOR HACKTOBERFEST IF V2.1.2 IS RELEASED AFTER OCTOBER 1ST, 2022 AND BEFORE OCTOBER 31, 2022. READ MORE ABOUT HACKTOBERFEST HERE

Add UPS search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Adds UPS search query function

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?
N/A
Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

ELIGIBLE FOR HACKTOBERFEST IF V2.1.2 IS RELEASED AFTER OCTOBER 1ST, 2022 AND BEFORE OCTOBER 31, 2022. READ MORE ABOUT HACKTOBERFEST HERE

Order engines by alphabetical order

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
As many people will propose engines to add, it'll be great to order them alphabetically in the __init__.py file in src/seachor

Provide any alternatives to the feature you've considered
None

Additional information
For information I first thought DuckDuckGo wasn't available, and had to go through the code to see I was wrong, therefore this issue

Add info scraper

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

This will add a information scraper to get information about a topic that is given using Wikipedia.

I will be working on this.

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

N/A

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

N/A

Add Atlassian Search

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Adds Atlassian search

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?
no

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

I will be working on this

Add Reddit search

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

  • Adds search query for Reddit

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

Add blogger search query

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

  • Adds search query for blogger.com

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

Collaborate with our research project?

Hello, I am Krishna Shah. I founded DeepShift Labs which is a research group researching general intelligence and biomimetic robotics. Our project involves a lot of web scraping and I think your project and experience will be valuable to our project. Do you want to collaborate with us?

If you want to learn more about our project, please visit our GitHub repository: https://github.com/DeepShift-Labs/MAGIST-Algorithm

We also have a website if you want to learn even more about our projects.

Multiple incorrect engine names

Bug Description
Searching for a query using the Atlassian and Lycos engines throws an error due to incorrect spelling in init.py file.

Screenshots
image

Additional context
I will raise a PR to fix this.

Add AWS search

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Adds AWS search

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

No

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

I will be working on this

`dquote>` after executing query with `!` and `" "`

Describe the bug
After executing a query with an exclamation mark and double quotes, the shell waits for the other quote to complete.

To Reproduce
Execute the following commands

  1. This works properly
searchor search Google 'Hello World!' --copy
  1. This works properly too
searchor search Google "Hello World" --copy
  1. This command waits for the other quote
searchor search Google "Hello World!" --copy

Expected behavior
The terminal shouldn't be waiting for the other quote.

Device Information
OS : Ubuntu:20.04
terminal: zsh 5.8 (x86_64-ubuntu-linux-gnu)

Screenshots
Screenshot from 2022-10-25 12-08-51

Additional context

Adds Spotify Search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->
Adds Spotify search query function (https://open.spotify.com/)
Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?
N/A
Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->
N/A

Add AT&T search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->
Adds AT&T search query function

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?
N/A

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

I will be working on this. please assign

Naming convention for engine names not mentioned anywhere

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
Lets the user know the naming convention used for engines

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

Additional information

Add a pull request template

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Add a pull request template.

No help needed.

Provide any alternatives to the feature you've considered
N/A

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

Searchor CLI

I think it would be cool if Searchor could be used directly from the command line and not just when it's called from a python program.

a sample search could be like:
$ searchor google "coding memes" --open

If you agree with this idea, please assign me to work on this.
I'm actually very interested in this project, and I would really love to work on improving it, even after Hacktoberfest 2022

Add Ebay search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Adds Ebay search query function
(v2.1.2)

Provide any alternatives to the feature you've considered
N/A

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

ELIGIBLE FOR HACKTOBERFEST IF V2.1.2 IS RELEASED AFTER OCTOBER 1ST, 2022 AND BEFORE OCTOBER 31, 2022. READ MORE ABOUT HACKTOBERFEST HERE

Add Medium Search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Adds medium search query function (https://medium.com/)

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?

N/A

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

N/A

Open URL in the browser

Describe the feature
This feature will ask the user (using a optional parameter) if they want to open the outputted url in their default browser.

Copy URL to clipboard

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
The URL generated will be directly copied to clipboard

Provide any alternatives to the feature you've considered

Additional information
Dependencies : pyperclip library

Add Pinterest search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->
Added Pinterest to the Engines.

Provide any alternatives to the feature you've considered
Any other alternatives to the feature request you are asking for if we decide not to go with your feature request?
No

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

Add PyPi search queries function

Is your feature request related to a problem? Please describe if so, otherwise leave this blank..

Describe the feature
<-- A clear and concise description of the feature. What will it do, what will it affect, etc. -->

Add PyPi search queries function to v2.1.2.

Provide any alternatives to the feature you've considered
N/A

Additional information
<-- If you have anything additional to say, you can say it here. Otherwise you can leave this blank. -->

ELIGIBLE FOR HACKTOBERFEST IF V2.1.2 IS RELEASED AFTER OCTOBER 1ST, 2022 AND BEFORE OCTOBER 31, 2022. READ MORE ABOUT HACKTOBERFEST HERE

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.