Bing Website Finder (bwf) adds websites to a list of company names from the commandline.
Project description
Bing Website Finder
===================
--------------------------
## Purpose:
`bing_website_finder` (aka `bwf`) finds websites for an arbitrarily long list of company names.
<br>
## Requirements:
- Python >= 3.7
- A Bing Search API subscription
- A CSV full of company names
<br>
## Installation:
#### Direct download:
From the commandline run:
```sh
$ git clone https://github.com/rtruxal/company-website-finder.git
$ cd bing-website-finder/
$ pip install .
```
#### Without installing (python API):
```sh
$ git clone https://github.com/rtruxal/company-website-finder.git
$ cd bing-website-finder/
$ python --version `#check your python version to make sure it's >=3.7`
Python 3.7.2
$ python `#start python`
Python 3.7.2 (default, Jan 2 2119, 17:17:17) [MSC v.1111 2222 bit (DAM46)] :: Anaconda, Inc. on win3333
Type "help", "copyright", "credits" or "license" for more information.
```
And then:
```py
>>> from bing_website_finder.get_websites import init
>>> from os import path
>>>
>>> infile = path.realpath('./bing_website_finder/data/example_input_website_finder.csv')
>>> outfile = path.realpath('./results.csv')
>>> bing_api_key = '987654321deadbeef123456789'
>>>
>>> init(infile, outfile, verbose=False, api_key=bing_api_key)
```
#### From pypi (NOT IMPLEMENTED YET):
```sh
$ pip install bing-website-finder
```
<br>
## Configuration & Usage:
#### Create a CSV input file:
Your input CSV **must** include the following 2 columns (case sensitive):
- Company Name
- Website
Check out `bing_website_finder/data/example_input_website_finder.csv` (which was gathered from [a very old SEC website](https://www.sec.gov/rules/other/4-460list.htm)) for a practical example.
#### Permenantly store a Bing Search API Key in `config.py`:
Locate the `bing_website_finder/config.py` file & modify this line:
```py
DEFAULT_SEARCH_API_V7_KEY = 'CHANGE ME'
```
#### Python usage:
You can find the primary interface inside of `bing_website_finder/get_websites.py`.
It's called `init()`. Here is it's declaration as of v0.0.1:
```py
def init(infilepth, outfilepth, verbose=False, api_key=None, num_workers=5):
assert os.path.exists(infilepth), "Please check the infile path you've specified."
cache = pd.read_csv(infilepth)
workers = (Worker(cache, api_key) for i in range(num_workers))
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(_execute(workers, verbose, loop=loop))
finally:
cache.to_csv(outfilepth, index=False)
```
If you do not specify an `api_key` argument, the `DEFAULT_SEARCH_API_V7_KEY` variable in `bing_website_finder/config.py` will be used.
**IMPORTANT NOTE: THE PROGRAM WILL FAIL SILENTLY IF YOU LEAVE `api_key=None` & DO NOT MODIFY : `DEFAULT_SEARCH_API_V7_KEY` INSIDE OF `config.py`**
#### cmdline usage:
Insallation via pip automatically creates an executable and places it in your $PYTHONPATH.
If `/YOUR/PYTHON/ENV/bin`* is in your `$PATH`**, simply type:
```sh
$ bwf --help
```
or
```sh
$ bing_website_finder --help
```
if neither of these^ work after installation, you can always use:
```sh
$ python -m bwf --help
```
or
```sh
$ python -m bing_website_finder --help
```
\* - (`/YOUR/PYTHON/ENV/Scripts` on Windows)
\** - (`%PATH%` on Windows)
===================
--------------------------
## Purpose:
`bing_website_finder` (aka `bwf`) finds websites for an arbitrarily long list of company names.
<br>
## Requirements:
- Python >= 3.7
- A Bing Search API subscription
- A CSV full of company names
<br>
## Installation:
#### Direct download:
From the commandline run:
```sh
$ git clone https://github.com/rtruxal/company-website-finder.git
$ cd bing-website-finder/
$ pip install .
```
#### Without installing (python API):
```sh
$ git clone https://github.com/rtruxal/company-website-finder.git
$ cd bing-website-finder/
$ python --version `#check your python version to make sure it's >=3.7`
Python 3.7.2
$ python `#start python`
Python 3.7.2 (default, Jan 2 2119, 17:17:17) [MSC v.1111 2222 bit (DAM46)] :: Anaconda, Inc. on win3333
Type "help", "copyright", "credits" or "license" for more information.
```
And then:
```py
>>> from bing_website_finder.get_websites import init
>>> from os import path
>>>
>>> infile = path.realpath('./bing_website_finder/data/example_input_website_finder.csv')
>>> outfile = path.realpath('./results.csv')
>>> bing_api_key = '987654321deadbeef123456789'
>>>
>>> init(infile, outfile, verbose=False, api_key=bing_api_key)
```
#### From pypi (NOT IMPLEMENTED YET):
```sh
$ pip install bing-website-finder
```
<br>
## Configuration & Usage:
#### Create a CSV input file:
Your input CSV **must** include the following 2 columns (case sensitive):
- Company Name
- Website
Check out `bing_website_finder/data/example_input_website_finder.csv` (which was gathered from [a very old SEC website](https://www.sec.gov/rules/other/4-460list.htm)) for a practical example.
#### Permenantly store a Bing Search API Key in `config.py`:
Locate the `bing_website_finder/config.py` file & modify this line:
```py
DEFAULT_SEARCH_API_V7_KEY = 'CHANGE ME'
```
#### Python usage:
You can find the primary interface inside of `bing_website_finder/get_websites.py`.
It's called `init()`. Here is it's declaration as of v0.0.1:
```py
def init(infilepth, outfilepth, verbose=False, api_key=None, num_workers=5):
assert os.path.exists(infilepth), "Please check the infile path you've specified."
cache = pd.read_csv(infilepth)
workers = (Worker(cache, api_key) for i in range(num_workers))
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(_execute(workers, verbose, loop=loop))
finally:
cache.to_csv(outfilepth, index=False)
```
If you do not specify an `api_key` argument, the `DEFAULT_SEARCH_API_V7_KEY` variable in `bing_website_finder/config.py` will be used.
**IMPORTANT NOTE: THE PROGRAM WILL FAIL SILENTLY IF YOU LEAVE `api_key=None` & DO NOT MODIFY : `DEFAULT_SEARCH_API_V7_KEY` INSIDE OF `config.py`**
#### cmdline usage:
Insallation via pip automatically creates an executable and places it in your $PYTHONPATH.
If `/YOUR/PYTHON/ENV/bin`* is in your `$PATH`**, simply type:
```sh
$ bwf --help
```
or
```sh
$ bing_website_finder --help
```
if neither of these^ work after installation, you can always use:
```sh
$ python -m bwf --help
```
or
```sh
$ python -m bing_website_finder --help
```
\* - (`/YOUR/PYTHON/ENV/Scripts` on Windows)
\** - (`%PATH%` on Windows)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bwf-0.0.1.tar.gz
(30.8 kB
view details)
Built Distribution
bwf-0.0.1-py3-none-any.whl
(32.0 kB
view details)
File details
Details for the file bwf-0.0.1.tar.gz
.
File metadata
- Download URL: bwf-0.0.1.tar.gz
- Upload date:
- Size: 30.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b726b2b2a981ea621a54e50cc4242f936cb5af4043abebfda577d77f7d486f5d |
|
MD5 | aa2482c15fe641a9ba3ec0e915c73f31 |
|
BLAKE2b-256 | af93d6252b1bb160bbbe8e43602fb0d7f16acceac5329f231602d3beaa1ebd3c |
File details
Details for the file bwf-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: bwf-0.0.1-py3-none-any.whl
- Upload date:
- Size: 32.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f683b2d32c7c42206854700ef66304f5209812398ca0e2ab2c31dbbc9ae4650a |
|
MD5 | 1b0090a09f13ef94c81d0ec331e5338b |
|
BLAKE2b-256 | fdd7e5eabcb7fa79db8c9517da616eacc66507fbe108a80a643e1464d70b6eae |