Metadata-Version: 2.4
Name: ca-biositing-webservice
Version: 0.0.2
Summary: REST API for CA Biositing project
Project-URL: Homepage, https://github.com/sustainability-software-lab/ca-biositing
Project-URL: Repository, https://github.com/sustainability-software-lab/ca-biositing.git
Project-URL: Issues, https://github.com/sustainability-software-lab/ca-biositing/issues
Author: SSEC Team
License: BSD 3-Clause License
        
        Copyright (c) 2025, University of Washington, eScience Institute, Scientific Software Engineering Center
        
        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.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.12
Requires-Dist: ca-biositing-datamodels
Requires-Dist: fastapi<0.115.0,>=0.111.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pwdlib[argon2]>=0.2.0
Requires-Dist: pyjwt<3,>=2.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: uvicorn<1,>=0.30.0
Description-Content-Type: text/markdown

# CA Biositing Web Service

FastAPI REST API for the
[CA Biositing](https://github.com/sustainability-software-lab/ca-biositing)
project — serving biomass feedstock data including USDA Census/Survey statistics
and laboratory analysis results.

Shares database models with the companion
[`ca-biositing-datamodels`](https://pypi.org/project/ca-biositing-datamodels/)
package.

## Installation

```bash
pip install ca-biositing-webservice
```

## Quick Start

```bash
uvicorn ca_biositing.webservice.main:app --reload
```

Interactive docs at `http://localhost:8000/docs`.

## API Overview

| Endpoint Family | Base Path                     | Description                                |
| --------------- | ----------------------------- | ------------------------------------------ |
| Auth            | `/v1/auth/token`              | JWT access tokens                          |
| Analysis        | `/v1/feedstocks/analysis/`    | Lab analysis data by resource and location |
| USDA Census     | `/v1/feedstocks/usda/census/` | USDA Census data by crop or resource       |
| USDA Survey     | `/v1/feedstocks/usda/survey/` | USDA Survey data by crop or resource       |

Each family includes discovery endpoints returning available crops, resources,
geoids, and parameters. All lookups are case-insensitive.

## Key Dependencies

- [`ca-biositing-datamodels`](https://pypi.org/project/ca-biositing-datamodels/)
  — shared database models
- [FastAPI](https://fastapi.tiangolo.com/) — web framework
- [Uvicorn](https://www.uvicorn.org/) — ASGI server
- [PyJWT](https://pyjwt.readthedocs.io/) — JWT authentication

## Links

- [Repository](https://github.com/sustainability-software-lab/ca-biositing)
- [Issue Tracker](https://github.com/sustainability-software-lab/ca-biositing/issues)

## Contributors

[![Contributors](https://contrib.rocks/image?repo=sustainability-software-lab/ca-biositing)](https://github.com/sustainability-software-lab/ca-biositing/graphs/contributors)

## Acknowledgement

We acknowledge software engineering support from the University of Washington
[Scientific Software Engineering Center (SSEC)](https://escience.washington.edu/software-engineering/ssec/),
as part of the Schmidt Sciences
[Virtual Institute for Scientific Software (VISS)](https://www.schmidtsciences.org/).

## License

CA Biositing Web Service is licensed under the open source
[BSD 3-Clause License](https://opensource.org/license/bsd-3-clause).
