Metadata-Version: 2.1
Name: bro
Version: 0.2.7
Summary: Open source python library for accessing BRO API
Author: VIKTOR
Author-email: support@viktor.ai
License: see LICENSE.txt
Project-URL: Source code, https://github.com/viktor-platform/bro
Project-URL: Example VIKTOR application, https://demo.viktor.ai/public/bro-app
Project-URL: Source code VIKTOR application, https://github.com/viktor-platform/bro-app
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: xmltodict==0.13.0
Requires-Dist: requests==2.28.2
Requires-Dist: lxml==4.9.2
Requires-Dist: pyproj==3.4.1

![](https://img.shields.io/badge/release-v0.2.7-green)

# BRO
This package can access the REST API from the [BRO](https://www.broloket.nl/ondergrondgegevens). Currently, this package provides
functionality to request CPTs from the BRO when you provide a region of interest. The format is based on the REST API of the BRO, which is described [here](https://publiek.broservices.nl/sr/cpt/v1/swagger-ui/#/default/) for CPTs.

Current options include retrieval of the following objects: 
1. CPTs (format: bytes, dict)

The package also allows export of the retrieved data in GeoJSON format. 

**Note 1**: The BRO is only available for the Netherlands, other locations are not supported.

**Note 2**: The API of the BRO is limited and requesting large amounts of data may result in instability.

## Installation

```python
pip install bro
```

## Use
Example usage to retrieve CPTs from the BRO as dictionaries. 
```python
from datetime import datetime

import Envelope
import Point
import get_cpt_characteristics_and_return_cpt_objects

begin_date = datetime(2015, 1, 1).strftime("%Y-%m-%d")
end_date = datetime(2023, 3, 3).strftime("%Y-%m-%d")

# Define small square area that returns 5 valid cpts
lower_corner = Point(51.92269686635185, 4.469594207611851)
upper_corner = Point(51.923034432171065, 4.470094707426648)

area = Envelope(lower_corner, upper_corner)
cpts = get_cpt_characteristics_and_return_cpt_objects(begin_date, end_date, area, as_dict= True)


```

## LICENSE

```
MIT License

Copyright (c) 2023 VIKTOR

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

```

## Publish
- update changelog with version number
- update `bro/__version__.py`
- tag with version number
