Metadata-Version: 2.3
Name: lobsterdata
Version: 0.1.0
Summary: Python client for the LOBSTER financial data API
Keywords: lobster,finance,order book,market data,nasdaq
Author: Ruihong Huang
Author-email: Ruihong Huang <ruihong.huang@lobsterdata.com>
License: MIT License
         
         Copyright (c) 2026 rhuang10
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering
Requires-Dist: requests>=2.32.5
Requires-Python: >=3.13
Project-URL: Homepage, https://lobsterdata.com
Project-URL: Repository, https://github.com/rhuang10/lobsterdata
Project-URL: Bug Tracker, https://github.com/rhuang10/lobsterdata/issues
Description-Content-Type: text/markdown

# lobsterdata

Python client for the [LOBSTER](https://lobsterdata.com) financial data API.

LOBSTER provides high-quality, tick-level order book data for NASDAQ-listed stocks, widely used in academic finance research.

## Installation

```bash
pip install lobsterdata
```

## Quick start

```python
from lobsterdata import LobsterClient

client = LobsterClient(
    api_key="your_api_key",
    api_secret="your_api_secret",
    is_pilot=False,   # True → dev.lobsterdata.com, False → lobsterdata.com
)

# Submit a data request
result = client.submit_request(
    symbol="AAPL",
    start_date="2025-02-03",
    end_date="2025-02-07",
    level=10,
    exchange="NASDAQ",
)
request_id = result["data"]["request_id"]

# Download when ready
filepath = client.download_request(request_id, download_dir="./downloads")

# Or download + delete everything that is ready in one call
saved = client.download_and_cleanup(download_dir="./downloads")
```

See the [`examples/`](examples/) directory for a complete polling workflow.

## API reference

| Method | Description |
|---|---|
| `submit_request(symbol, start_date, end_date, level, exchange)` | Submit a new data construction request |
| `list_requests()` | List all requests for the authenticated user |
| `get_request(request_id)` | Look up a single request by ID |
| `list_alive_requests()` | Requests with status `waiting`, `running`, or undeleted `finished` |
| `list_downloadable_requests()` | Finished requests with data available for download |
| `download_request(request_id, download_dir)` | Download a completed request's data file |
| `delete_request(request_id)` | Delete a request and its file from the server |
| `download_and_cleanup(download_dir)` | Download all available files then delete them from the server |

## Credentials

Set your credentials as environment variables (copy `.env.example` → `.env`):

```bash
export LOBSTER_API_KEY="your_api_key"
export LOBSTER_API_SECRET="your_api_secret"
export LOBSTER_IS_PILOT="false"
```

## License

MIT
