Metadata-Version: 2.4
Name: bwac
Version: 0.1.0
Summary: Barentswatch REST API Client
Author-email: Thomas Roehr <roehr@simula.no>
Maintainer-email: Thomas Roehr <roehr@simula.no>
License: 3-Clause BSD License / New BSD License
        
        Copyright (c) 2025 Simula Research Laboratory, Oslo, Norway
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
        list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
        this list of conditions and the following disclaimer in the documentation
        and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its contributors
        may be used to endorse or promote products derived from this software without
        specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
        ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
        WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: homepage, https://github.com/2maz/barentswatch-apiclient
Project-URL: documentation, https://2maz.github.io/barentswatch-apiclient
Project-URL: repository, https://github.com/2maz/barentswatch-apiclient
Keywords: barentswatch,client
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: BSD License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: pandas
Requires-Dist: pydantic
Requires-Dist: pydantic-settings
Requires-Dist: tqdm
Provides-Extra: dev
Requires-Dist: isort; extra == "dev"
Requires-Dist: jupyter-book<2; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: sphinx-autoapi; extra == "dev"
Requires-Dist: tox; extra == "dev"
Provides-Extra: test
Requires-Dist: coverage; extra == "test"
Requires-Dist: httpx; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"
Requires-Dist: pytest-console-scripts; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: pydot; extra == "test"
Requires-Dist: tox; extra == "test"
Dynamic: license-file

# bwac - barentswatch API Client

The script in this repository allows to collect AIS messages send via the barentswatch REST API for AIS data.

## Installation

Install from source:

```
git clone https://github.com/2maz/barentswatch-apiclient.git

python3 -m venv venv-barents-watch
. venv-barents-watch/bin/activate

pip install ./barentswatch-apiclient
```

## Usage

Create an account and register a client (see http://developer.barentswatch.no/docs/appreg).
Create a .env file with the credentials for accessing the

```
BARENTS_WATCH_CLIENT_ID=your@email.com:yourapp
BARENTS_WATCH_CLIENT_SECRET=XXXXX
```

To download data from the livestream by creating daily CSV files of the format AIS_YYYY_mm_dd.csv use

```
$> bwac live
```

To retrieve data from the historic api for a specific timeframe, which can be a maximum of 14 days in the past (this limit is set by barentswatch):

```
$> bwac historic --from-date 2026-04-14T00:00:00+00:00 --to-date 2026-04-15T23:59:59+00:00

```

## License
This work is licensed under the [BSD-3-Clause License](https://github.com/2maz/ai4copsec-barentswatch/blob/main/LICENSE).
Data is made accessible via barentswatch.no and licensed under [Norwegian License for Public Data](https://data.norge.no/nlod) (see also https://www.barentswatch.no/artikler/api-vilkar/).

## Copyright

Copyright (c) 2025-2026 [Simula Research Laboratory, Oslo, Norway](https://www.simula.no/research/research-departments)

## Acknowledgments

All data is provided by the live AIS API from [barentswatch.no](https://developer.barentswatch.no/docs/AIS/live-ais-api/).

The development of this client is part of the EU-project [AI4COPSEC](https://ai4copsec.eu) which receives funding
 from the Horizon Europe framework programme under Grant Agreement N. 101190021.
