Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arjunsharda/searchor
⚡️ Quick and easy searching tasks in one library.
https://github.com/arjunsharda/searchor
collaborate communityexchange github imgbot learn pypi-package python search search-engine searchor
Last synced: 3 days ago
JSON representation
⚡️ Quick and easy searching tasks in one library.
- Host: GitHub
- URL: https://github.com/arjunsharda/searchor
- Owner: ArjunSharda
- License: mit
- Created: 2022-08-27T16:55:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-04T19:56:00.000Z (4 months ago)
- Last Synced: 2024-10-13T09:52:15.813Z (3 months ago)
- Topics: collaborate, communityexchange, github, imgbot, learn, pypi-package, python, search, search-engine, searchor
- Language: Python
- Homepage: https://pypi.org/project/Searchor/
- Size: 729 KB
- Stars: 80
- Watchers: 5
- Forks: 34
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
Searchor
========
![PyPI](https://img.shields.io/pypi/v/searchor?color=green&logo=python&logoColor=green)
[![Discord](https://img.shields.io/discord/1026470859868741662)](https://discord.gg/fPXNMW7swn)# 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+](https://www.python.org/downloads/) is required**
```bash
# MacOS / Linux (via Terminal)
python3 -m pip install -U searchor# Windows (via CMD Prompt)
py -3 -m pip install -U searchor
```Quick Start
-----------
```python
>>> from searchor import Engine
>>> Engine.Google.search("Hello, World!"))
'https://www.google.com/search?q=Hello%2C%20World%21'
```
Custom Engine
-------------
```python
>>> 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
```bash
$ searchor Google "Hello World!" --copy
```Web Scrape
]}'
----------
```python
>>> from searchor import Information
>>> Information.scrape("https://google.com")
>>> '{'title': 'Google', 'paragraphs': [
```Get Information
---------------
```python
>>> 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](https://github.com/ArjunSharda/Searchor/tree/main/examples) folder!*Note*: Engine names follow the **UpperCamelCase** convention.(eg: ChromeWebStore).
Docker
------Building the docker image
```sh
$ docker build -t searchor .
```Running searchor on the docker container
```sh
$ 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 issuesMigration
---------
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:
```python
# Searchor 2.0.0
from searchor import search, Engine
search("Hello, World!", Engine.Google)
```
```python
# Searchor v2.2.0
from searchor import Engine
Engine.Google.search("Hello, World!")
```## Want to contribute?
Take a look at the [contributing guidelines](CONTRIBUTING.md)!
© Arjun Sharda 2022-present
All Rights Reserved