Metadata-Version: 2.3
Name: manufacturing-economic-monitor
Version: 0.2.0
Summary: Offline-tested CLI and dashboard for FRED manufacturing economic indicators.
Keywords: economics,fred,manufacturing,monitoring,streamlit
Author: Mohammadreza Ensafi
Author-email: Mohammadreza Ensafi <mze0069@auburn.edu>
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Dist: pydantic>=2.0
Requires-Dist: plotly>=5.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: requests>=2.32
Requires-Dist: streamlit>=1.36
Requires-Python: >=3.12
Project-URL: Repository, https://github.com/Mze0069/manufacturing-economic-monitor
Project-URL: Issues, https://github.com/Mze0069/manufacturing-economic-monitor/issues
Description-Content-Type: text/markdown

# Manufacturing Economic Monitor

A small CLI and Streamlit dashboard for fetching the FRED Industrial Production:
Manufacturing (`IPMAN`) series, validating the response, saving raw and processed
JSON files, and showing the latest valid manufacturing index.

## Setup

Install dependencies:

```powershell
uv sync
```

Set `FRED_API_KEY` in a local `.env` file when you need to refresh live data.

`.env` is ignored by Git. Do not commit API keys or downloaded live data.

## Tests

Run the fixture-backed test suite:

```powershell
uv run pytest
```

Run tests with coverage:

```powershell
uv run pytest --cov=manufacturing_monitor
```

Tests use committed files in `tests/fixtures/` and mocks/monkeypatching for
external behavior. Routine tests do not contact the live FRED API.

## CLI

Run the installed command:

```powershell
uv run manufacturing-monitor
```

The compatibility wrapper still works:

```powershell
uv run main.py
```

Default output files are:

- raw response: `data/raw/ipman_observations_raw.json`
- processed observations: `data/processed/ipman_observations_processed.json`

Run without contacting FRED:

```powershell
uv run manufacturing-monitor --project-info
```

Enable console diagnostics:

```powershell
uv run manufacturing-monitor --verbose
```

Write detailed diagnostics to a log file:

```powershell
uv run manufacturing-monitor --log-file logs/manufacturing-monitor.log
```

Default behavior does not print diagnostic logs. Logging records request events,
validation, saved-file locations, and failures, but not API keys or complete
request URLs.

## Dashboard

Run the Streamlit dashboard:

```powershell
uv run streamlit run src/manufacturing_monitor/dashboard.py
```

The dashboard uses the same API, Pydantic validation, and workflow code as the
CLI. It accepts a FRED API key through a password-style input and also allows the
local environment key from `.env`.

## Validation

Incoming FRED responses are validated with Pydantic before the app uses them.
The app rejects:

- non-object top-level responses
- missing or invalid `observations`
- invalid observation dates
- observation values that are neither numeric strings nor the known FRED `.`
  placeholder

Placeholder values are preserved in processed output but skipped when selecting
the latest valid manufacturing index.
