Metadata-Version: 2.4
Name: parsimony-bls
Version: 0.5.0
Summary: U.S. Bureau of Labor Statistics connector for the parsimony framework
Project-URL: Homepage, https://www.bls.gov
Project-URL: Repository, https://github.com/ockham-sh/parsimony-connectors
Project-URL: Issues, https://github.com/ockham-sh/parsimony-connectors/issues
Author-email: "Ockham.sh" <team@ockham.sh>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: bls,connectors,data,finance,parsimony
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pandas<3,>=2.3.0
Requires-Dist: parsimony-core<0.6,>=0.5.0
Requires-Dist: pydantic<3,>=2.11.1
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=9.0.3; extra == 'dev'
Requires-Dist: respx>=0.22.0; extra == 'dev'
Requires-Dist: ruff>=0.15.10; extra == 'dev'
Provides-Extra: publish
Requires-Dist: parsimony-core[standard-onnx]<0.6,>=0.5.0; extra == 'publish'
Description-Content-Type: text/markdown

# parsimony-bls

US Bureau of Labor Statistics connector — labor market, employment, inflation (CPI), and producer price time series.

Part of the [parsimony-connectors](https://github.com/ockham-sh/parsimony-connectors) monorepo. Distributed standalone on PyPI as `parsimony-bls`.

## Connectors

| Name | Kind | Description |
|---|---|---|
| `bls_fetch` | fetch | Fetch a single BLS time series by `series_id` between two years. |
| `enumerate_bls` | enumerator | Enumerate popular BLS series across all surveys via the `/surveys` and `/timeseries/popular` endpoints. |

## Install

```bash
pip install parsimony-bls
```

Pulls in `parsimony-core>=0.4,<0.5` automatically. Verify discovery:

```bash
python -c "from parsimony import discover; print([p.name for p in discover.iter_providers()])"
```

## Configuration

The API key is **optional** — the plugin works without one but registering gives you higher rate limits.

```bash
export BLS_API_KEY="<your-key>"   # optional
```

Register for a free key at https://data.bls.gov/registrationEngine/.

## Quick start

```python
import asyncio
from parsimony_bls import CONNECTORS

async def main():
    connectors = CONNECTORS.bind_env()
    # LNS14000000 = US unemployment rate (seasonally adjusted)
    result = await connectors["bls_fetch"](
        series_id="LNS14000000",
        start_year="2020",
        end_year="2024",
    )
    print(result.data.head())

asyncio.run(main())
```

For multi-plugin composition (autoloads everything installed):

```python
from parsimony import discover
connectors = discover.load_all().bind_env()
```

## Provider

- Homepage: https://www.bls.gov
- Developer portal: https://www.bls.gov/developers/
- Series browser: https://data.bls.gov/

## License

See [LICENSE](./LICENSE).
