Metadata-Version: 2.5
Name: openbb-fd
Version: 2.0.0
Summary: Integration of Jeroen Bouma's Finance Database with OpenBB
Author-email: piiq <piiq@tinag.ru>
License-File: LICENSE
Requires-Python: <4,>=3.12
Requires-Dist: openbb-core>=2.0.1
Requires-Dist: pandas>=3.1.1
Requires-Dist: pydantic<3.0.0,>=2.14.3
Requires-Dist: requests>=2.34.2
Description-Content-Type: text/markdown

# Finance Database provider for OpenBB

Finance Database by Jeroen Bouma offers an extensive collection of over 300,000 symbols across various financial instruments, including Equities, ETFs, Funds, Indices, Currencies, Cryptocurrencies, and Money Markets. It's designed to provide a comprehensive overview of sectors, industries, and types of investments.

## Introduction

This extension integrates the Finance Database datasets into OpenBB. It enhances the capabilities of OpenBB’s equity, crypto, and ETF search functionalities. This integration adds capabilities to search through a broad spectrum of financial instruments.

## Requirements

- Python 3.12+
- OpenBB Core 2.0.1+
- `uv` for local development

## Installation

Add the provider and the asset routers used by the examples to your uv project:

```bash
uv add openbb-fd openbb-equity openbb-etf openbb-crypto
```

Alternatively, for the latest version directly from the repository:

```bash
uv add git+https://github.com/piiq/openbb-fd.git
```

Rebuild the generated interface after changing installed extensions:

```bash
uv run openbb-build
```

## Local development

```bash
uv sync --locked
uv run openbb-build
uv run pytest
uv run ruff check .
uv run ty check
uv run rumdl check --config pyproject.toml README.md
```

The development group installs the equity, ETF, and crypto routers for the generated `obb` interface, plus the Platform API for HTTP integration tests. OpenBB 5 installs these asset routers through its optional `routers` extra; a provider installation alone does not install them.

Run the API and the live integration tests in separate terminals:

```bash
uv run openbb-api --host 127.0.0.1 --port 8000
uv run pytest integration
```

## Publishing

The `Publish to PyPI` workflow compares `[project].version` before and after each push to `main`. A changed version runs validation, builds the wheel and source distribution, and publishes them directly to PyPI. An unchanged version skips publishing. For pushes with multiple commits, the comparison covers the complete push.

Configure a [PyPI Trusted Publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) for the `openbb-fd` project with these values:

- Owner: `piiq`
- Repository: `openbb-fd`
- Workflow filename: `publish.yml`
- Environment: `pypi`

To release, set a new, unpublished version and update the lockfile before pushing the change to `main`:

```bash
uv version --bump patch
uv lock
```

## Usage

```python
from openbb import obb
```

Here are some command examples to demonstrate the usage of this integration:

To search for equities in a defense industry:

```bash
>>> sample = obb.equity.search(query="Defense", provider="fd")
>>> print(f"Total companies in the sample: {len(sample.to_df()['name'].unique())}")
Total companies in the sample: 880
```

To find ETFs matching certain criteria:

```python
>>> sample = obb.etf.search(query="Wheat", provider="fd")
>>> print(f"Total etfs in the sample: {len(sample.to_df()['name'].unique())}")
Total etfs in the sample: 10
```

For cryptocurrency analysis:

```python
>>> sample = obb.crypto.search(query="node", provider="fd")
>>> print(f"Total cryptos in the sample: {len(sample.to_df()['name'].unique())}")
Total cryptos in the sample: 10
```

## License

This project is licensed under the MIT License.
