Metadata-Version: 2.4
Name: marketquery
Version: 0.1.0
Summary: A unified interface for market data APIs
Project-URL: Homepage, https://github.com/troyscribner/marketquery
Project-URL: Documentation, https://github.com/troyscribner/marketquery#readme
Project-URL: Repository, https://github.com/troyscribner/marketquery.git
Project-URL: Issues, https://github.com/troyscribner/marketquery/issues
Author-email: Troy Scribner <your.email@example.com>
License-Expression: MIT
License-File: LICENSE
Keywords: api,data,finance,market,stocks
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.8
Requires-Dist: alpha-vantage>=2.3.1
Requires-Dist: appdirs>=1.4.4
Requires-Dist: pandas>=1.3.0
Requires-Dist: polygon-api-client>=1.12.0
Requires-Dist: requests>=2.26.0
Requires-Dist: tiingo>=0.4.0
Requires-Dist: tqdm>=4.62.0
Requires-Dist: yfinance>=0.2.0
Provides-Extra: dev
Requires-Dist: black>=21.7b0; extra == 'dev'
Requires-Dist: flake8>=3.9.0; extra == 'dev'
Requires-Dist: isort>=5.9.0; extra == 'dev'
Requires-Dist: mypy>=0.910; extra == 'dev'
Requires-Dist: pytest-cov>=2.12.0; extra == 'dev'
Requires-Dist: pytest>=6.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# MarketQuery

A unified interface for market data APIs, providing a simple way to download historical market data from multiple providers.

## Features

- Support for multiple data providers:
  - Yahoo Finance (default)
  - Stooq
  - Tiingo
  - Alpha Vantage
  - Polygon.io
- Built-in caching system
- Consistent data format across providers
- Easy-to-use interface
- Support for multiple tickers
- Progress bars for long downloads

## Installation

```bash
pip install marketquery
```

## Quick Start

```python
import marketquery as mq

# Download data for a single ticker
data = mq.download('AAPL', start='2024-01-01', end='2024-01-31')

# Download data for multiple tickers
data = mq.download(['AAPL', 'GOOGL', 'MSFT'], start='2024-01-01', end='2024-01-31')

# Use a different provider
data = mq.download('AAPL', provider='tiingo', api_key='your_api_key')
```

## Environment Variables

MarketQuery supports configuration through environment variables. To use them:

1. Create a `.env` file in your project directory:
```bash
# Set default provider
MARKETQUERY_DEFAULT_PROVIDER=tiingo

# API keys for different providers
TIINGO_API_KEY=your_tiingo_api_key
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_api_key
ALPHA_VANTAGE_PREMIUM_API_KEY=your_alpha_vantage_premium_api_key
```

2. Load the environment variables in your code:
```python
from dotenv import load_dotenv
load_dotenv()  # Load environment variables from .env file

import marketquery as mq
data = mq.download('AAPL')  # Will use settings from .env file
```

Available environment variables:
- `MARKETQUERY_DEFAULT_PROVIDER`: Set default provider (e.g., 'yahoo', 'tiingo', 'alpha_vantage')
- `TIINGO_API_KEY`: API key for Tiingo
- `ALPHA_VANTAGE_API_KEY`: API key for Alpha Vantage
- `ALPHA_VANTAGE_PREMIUM_API_KEY`: Premium API key for Alpha Vantage

## Documentation

For detailed documentation, run:
```python
import marketquery as mq
mq.help()
```

## Cache Management

MarketQuery includes a built-in caching system to improve performance and reduce API calls. The cache is stored in your system's cache directory:

- macOS: `~/Library/Caches/marketquery`
- Linux: `~/.cache/marketquery`
- Windows: `%LOCALAPPDATA%\marketquery\Cache`

You can control caching behavior with the following parameters:
- `load=True/False`: Enable/disable loading from cache
- `save=True/False`: Enable/disable saving to cache
- `cache_dir`: Specify a custom cache directory

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
