Metadata-Version: 2.1
Name: aurastream-client
Version: 0.1.0
Summary: An aurastream_client library for interacting with the AuraStream API
Author: Usama Ali
Author-email: usamaali012@gmail.com
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: requests (>=2.31.0)
Requires-Dist: python-dotenv (==1.0.0)


# AuraStream Client Library

The AuraStream Client Library is a Python package designed to interact with the AuraStream API to fetch financial data. This guide will walk you through the installation, configuration, and usage of the library.

## Installation

Install the AuraStream Client Library using pip:

```bash
pip install aurastream_client
```
## Usage

Here is a simple example of how to use the library to post data and get a response:

### Example 1: Providing Input Data through User Input

If both `API_KEY` and `data` parameters are `None`, the user will be prompted to input the data:

```python
from aurastream_client import get_data

# Execute the function without parameters
data, status_code = get_data()
print(data, status_code)
```

When prompted, enter the data in the following format (Please follow the format strictly):
```
Enter data: {'API_KEY': 'your_api_key_here', 'data': {'ticker_list': ['^GSPC'], 'start': '2020-01-01', 'end': '2023-01-01', 'source': 'yahoo', 'data_format': 'json'}}
```

### Example 2: Passing Data through Parameters

#### Configuration

Before using the library, you need to set up your AuraStream API key. You can do this by setting an environment variable:

```bash
export AURASTREAM_API_KEY='your_api_key_here'
```
OR
You can directly pass the `api_key` and `data` as parameters:

```python
from aurastream_client import get_api_key, get_data

# Ensure your API key is configured as per the Configuration section
api_key = get_api_key()  # or use your own method to provide the API key

# Define your parameters to send in the POST request
data = {
    'ticker_list': ['^GSPC'],  # List of tickers to retrieve data for
    "start": '2020-01-01',  # Start date for data retrieval in any format
    "end": '2023-01-01',  # End date for data retrieval in any format
    "source": 'yahoo',
    # String specifying the data source. This should match the data provider you have linked with your account on the AuraStream web portal. Valid options depend on the providers you have configured and authorized.
    "data_format": 'json'  # Format of the data returned, options are 'json' and 'csv' only
}

# Execute the function with parameters
response_data, status_code = get_data(api_key, data)
print(response_data, status_code)
```

## License

This project is licensed under the MIT License. See the LICENSE file for details.

## Contact

For any issues or inquiries, please contact our support team at support@aurastream.com.
