A source code searcher
Project description
escodesearcher
A source code searcher
Currently searching in a limited set of sites:
- Geeks for Geeks
- C plus plus
- Tutorials Point
- Programiz
Installation
pip install escodesearcher
Dependencies
- requests -
pip install requests
- beautifulsoup4 -
pip install beautifulsoup4
- google -
pip install google
- html2text -
pip install html2text
Usage
Use SearchCode
escodesearcher
can be used to fetch source code urls from the sites mentioned above or to fetch the source codes in these sites
To fetch and save the source codes
from escodesearcher import SearchCode
code_searcher = SearchCode()
keyword = "Merge sort C++"
source_codes = code_searcher.search(keyword)
for index,source_code in enumerate(source_codes):
with open('fetched_files/'+str(index)+'.txt', 'w', encoding='utf8') as f:
f.write(source_code)
To fetch urls only
from escodesearcher import UrlsFetcher
searcher = UrlsFetcher()
keyword = "Binary Search C++"
urls = searcher.fetch_urls(keyword)
print(urls)
Result is a list of urls from specific sites
To fetch source codes from specific url from the supported sites
from escodesearcher import FetchCode
code_grapper = FetchCode()
url = "https://www.tutorialspoint.com/binary-search-in-cplusplus"
print(code_grapper.fetch_code(url))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
escodesearcher-0.0.5.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file escodesearcher-0.0.5.tar.gz
.
File metadata
- Download URL: escodesearcher-0.0.5.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46cdc28525d2ed509a0ff3980e2aa76fb3120d377bb3c79f61eab0acda8a0d61 |
|
MD5 | d8077faee92e9b88248d2d928150640b |
|
BLAKE2b-256 | 54bb8061c4c43fb0e4aedc5fe02fa88163ccf88e596bbdf6cc2d0ebd58934dbc |
File details
Details for the file escodesearcher-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: escodesearcher-0.0.5-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94c6edc3b0eaa528b15f863659976f0c2745ee1aea9c7efab3118a5c9dd8dd99 |
|
MD5 | 662eb1601bedf1711b66d48e00bd48fc |
|
BLAKE2b-256 | 9804f3fc3008ed810ef9004001bf2d41ff238d5d0883daafbc940e54bbc160e5 |