semvec/pypi-packages huggingface dataset:
datanews 0.0.7
Python client library for Datanews API
Requires Python: >=3.5

# Datanews Python

This is a client library for python 3, built to
interact with the Datanews API. You can find full api documentation
at [official documentation page](https://datanews.io/docs).

## Install

Use pip to install the library.

```python
pip install datanews
```

## Usage

To use the API, import the `datanews` package and provide the api key. Then, proceed to make
queries by calling corresponding functions of the library.

### Core API

```python
import datanews
datanews.api_key = 'API_KEY'

response = datanews.headlines(q='SpaceX')
articles = response['hits']
print(articles[0]['title']) 
```

### Monitoring API

To create monitors use the `datanews.Monitor` object.
To retrieve monitor runs use `Monitor.latest` function and pass `run_id`. Each
run object has a `last_run_id` field, which refers to previous run, or `None`,
if no runs were made previously (i.e. this was the first run). Please refer to
to [full documentation](https://datanews.io/docs/monitoring-overview) of monitoring API.

```python
import datanews
datanews.api_key = 'API_KEY'

# list all monitors
print(datanews.Monitor.list())

# create new monitor, pass query (list of keywords), and webhook url
monitor = datanews.Monitor.create(query='SpaceX', 'webhook'='https://mywebhook.com')

# get id of the monitor
id = monitor['id']

# list latest articles from the Monitor
articles = []
run_id = monitor.get('last_run_id', None)
done = run_id is None
while not done:
    run = datanews.Monitor.latest(run_id)
    articles.extend(run['articles'])
    run_id = run['last_run_id']
    done = run_id is None
```
document-scanner 0.1.9
Document scanner built using python opencv.
Requires Python: >=3.4

# Document Scanner

### An interactive document scanner built in Python using OpenCV

The scanner takes a poorly scanned image, finds the corners of the document, applies the perspective transformation to get a top-down view of the document, sharpens the image, and applies an adaptive color threshold to clean up the image.

On my test dataset of 300 images, the program correctly detected the corners of the document 92.8% of the time.

* The scanner can process an entire directory of images automatically and save the output in an output directory:

#### Here are some examples of images before and after scan:

<img src="https://github.com/endalk200/document-scanner/blob/main/sample_images/cell_pic.jpg" height="450"> <img src="https://github.com/endalk200/doc_scanner/blob/main/output/cell_pic.jpg" height="450">

<img src="https://github.com/endalk200/document-scanner/blob/main/sample_images/receipt.jpg" height="450"> <img src="https://github.com/endalk200/document-scanner/blob/master/output/receipt.jpg" height="450">

<img src="https://github.com/endalk200/document-scanner/blob/main/sample_images/math_cheat_sheet.JPG" height="450"> <img src="https://github.com/endalk200/document-scanner/blob/main/output/math_cheat_sheet.JPG" height="450">

<img src="https://github.com/endalk200/document-scanner/blob/main/sample_images/dollar_bill.JPG" width="350"> <img src="https://github.com/endalk200/document-scanner/blob/main/output/dollar_bill.JPG" width="350">


### Usage

You can use this script by downloading it from pypi
```bash
pip install document-scanner
```

aftter installing it from pypi index, you can use it from the terminal as follows.

```
python scan.py (--images <IMG_DIR> | --image <IMG_PATH>) [-i]
```
* The `-i` flag enables interactive mode, where you will be prompted to click and drag the corners of the document. For example, to scan a single image with interactive mode enabled:
```
python scan.py --image sample_images/desk.JPG -i
```
* Alternatively, to scan all images in a directory without any input:
```
python scan.py --images sample_images
```