alphasquared-py


Namealphasquared-py JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/rhettre/alphasquared-py
SummaryThe unofficial Python client for the AlphaSquared API
upload_time2024-09-08 00:55:14
maintainerNone
docs_urlNone
authorRhett Reisman
requires_python>=3.9
licenseMIT
keywords alphasquared coinbase gemini kraken orderbook trade bitcoin ethereum btc eth client api wrapper exchange crypto currency trading trading-api fear-and-greed-index
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AlphaSquared Python Client

This is an unofficial Python client for the AlphaSquared API. It allows users to interact with the API to retrieve asset information, strategy values, and hypothetical data for cryptocurrency trading.

## Features

- Easy-to-use Python wrapper for the AlphaSquared API
- Supports authentication using API tokens
- Implements rate limiting to comply with API usage rules
- Provides methods to retrieve asset information, strategy values, and hypothetical data
- Includes error handling and logging functionality
- Fetch comprehensive asset data (price, risk, market cap, etc.)
- Get custom strategy values
- Built-in caching to reduce API calls
- Automatic rate limiting to comply with API rules

## Installation

Install the package using pip:

```bash
pip install alphasquared-py
```

## Authentication

To use the AlphaSquared API, you need to obtain an API token from your AlphaSquared account dashboard. Once you have your token, you can authenticate as follows:

```python
from alphasquared import AlphaSquared

api = AlphaSquared("YOUR_API_TOKEN")
```

## Usage

### Retrieving Asset Information

```python
btc_info = api.get_asset_info("BTC")
print(btc_info)
```

### Getting Strategy Values

```python
strategy_values = api.get_strategy_values("My Custom Strat")
print(strategy_values)
```

### Fetching Hypothetical Data

```python
eth_hypotheticals = api.get_hypotheticals("ETH")
print(eth_hypotheticals)
```

### Fetching Comprehensive Asset Data

```python
btc_comprehensive = api.get_comprehensive_asset_data("BTC")
print(btc_comprehensive)
```

### Getting Strategy Action and Value for a Specific Risk Level

```python
action, value = api.get_strategy_value_for_risk("My Custom Strat", 50)
print(f"Action: {action}, Value: {value}")
```

### Getting Current Risk Level

```python
current_risk = api.get_current_risk("BTC")
print(current_risk)
```

### Getting Strategy Action and Value Based on Current Risk

This example demonstrates how to get the current risk for an asset, then use that risk level to determine the strategy action and value:

```python
# Get the current risk for BTC
btc_risk = api.get_current_risk("BTC")
print(f"Current BTC Risk: {btc_risk}")

# Define your strategy name in AlphaSquared
strategy_name = "My Custom Strat"

# Get the strategy action and value for the current risk
action, value = api.get_strategy_value_for_risk(strategy_name, btc_risk)
print(f"For risk {btc_risk}: Action = {action.upper()}, Value = {value}")
```

## Error Handling

The client includes built-in error handling. You can check for errors in the API responses:

```python
result = api.get_asset_info("INVALID_ASSET")
if api.has_error(result):
    print("An error occurred:", result["error"])
```

## Rate Limiting

The client automatically handles rate limiting to ensure compliance with the API's usage rules (6 requests per minute).

## Caching

The client uses caching to reduce the number of API calls. You can set the cache TTL (time-to-live) when initializing the client. The default cache TTL is 5 minutes.

```python
api = AlphaSquared("YOUR_API_TOKEN", cache_ttl=300)  # 5 minutes
```

## Documentation

For more information about the AlphaSquared API, consult the [official API documentation](https://alphasquared.io/api-docs).

## License

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

## Disclaimer

This project is not affiliated with, maintained, or endorsed by AlphaSquared. Use this software at your own risk. Trading cryptocurrencies carries a risk of financial loss. The developers of this software are not responsible for any financial losses or damages incurred while using this software.

## Support

For any issues, questions, or assistance, please open an issue on the GitHub repository or contact AlphaSquared support at admin@alphasquared.io.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rhettre/alphasquared-py",
    "name": "alphasquared-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "alphasquared, coinbase, gemini, kraken, orderbook, trade, bitcoin, ethereum, BTC, ETH, client, api, wrapper, exchange, crypto, currency, trading, trading-api, fear-and-greed-index",
    "author": "Rhett Reisman",
    "author_email": "rhett@rhett.blog",
    "download_url": "https://files.pythonhosted.org/packages/83/ef/cf0019bbd796c336939bd692e83f11c59f68390ab1aecc85522b090ea18b/alphasquared_py-0.3.0.tar.gz",
    "platform": null,
    "description": "# AlphaSquared Python Client\n\nThis is an unofficial Python client for the AlphaSquared API. It allows users to interact with the API to retrieve asset information, strategy values, and hypothetical data for cryptocurrency trading.\n\n## Features\n\n- Easy-to-use Python wrapper for the AlphaSquared API\n- Supports authentication using API tokens\n- Implements rate limiting to comply with API usage rules\n- Provides methods to retrieve asset information, strategy values, and hypothetical data\n- Includes error handling and logging functionality\n- Fetch comprehensive asset data (price, risk, market cap, etc.)\n- Get custom strategy values\n- Built-in caching to reduce API calls\n- Automatic rate limiting to comply with API rules\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install alphasquared-py\n```\n\n## Authentication\n\nTo use the AlphaSquared API, you need to obtain an API token from your AlphaSquared account dashboard. Once you have your token, you can authenticate as follows:\n\n```python\nfrom alphasquared import AlphaSquared\n\napi = AlphaSquared(\"YOUR_API_TOKEN\")\n```\n\n## Usage\n\n### Retrieving Asset Information\n\n```python\nbtc_info = api.get_asset_info(\"BTC\")\nprint(btc_info)\n```\n\n### Getting Strategy Values\n\n```python\nstrategy_values = api.get_strategy_values(\"My Custom Strat\")\nprint(strategy_values)\n```\n\n### Fetching Hypothetical Data\n\n```python\neth_hypotheticals = api.get_hypotheticals(\"ETH\")\nprint(eth_hypotheticals)\n```\n\n### Fetching Comprehensive Asset Data\n\n```python\nbtc_comprehensive = api.get_comprehensive_asset_data(\"BTC\")\nprint(btc_comprehensive)\n```\n\n### Getting Strategy Action and Value for a Specific Risk Level\n\n```python\naction, value = api.get_strategy_value_for_risk(\"My Custom Strat\", 50)\nprint(f\"Action: {action}, Value: {value}\")\n```\n\n### Getting Current Risk Level\n\n```python\ncurrent_risk = api.get_current_risk(\"BTC\")\nprint(current_risk)\n```\n\n### Getting Strategy Action and Value Based on Current Risk\n\nThis example demonstrates how to get the current risk for an asset, then use that risk level to determine the strategy action and value:\n\n```python\n# Get the current risk for BTC\nbtc_risk = api.get_current_risk(\"BTC\")\nprint(f\"Current BTC Risk: {btc_risk}\")\n\n# Define your strategy name in AlphaSquared\nstrategy_name = \"My Custom Strat\"\n\n# Get the strategy action and value for the current risk\naction, value = api.get_strategy_value_for_risk(strategy_name, btc_risk)\nprint(f\"For risk {btc_risk}: Action = {action.upper()}, Value = {value}\")\n```\n\n## Error Handling\n\nThe client includes built-in error handling. You can check for errors in the API responses:\n\n```python\nresult = api.get_asset_info(\"INVALID_ASSET\")\nif api.has_error(result):\n    print(\"An error occurred:\", result[\"error\"])\n```\n\n## Rate Limiting\n\nThe client automatically handles rate limiting to ensure compliance with the API's usage rules (6 requests per minute).\n\n## Caching\n\nThe client uses caching to reduce the number of API calls. You can set the cache TTL (time-to-live) when initializing the client. The default cache TTL is 5 minutes.\n\n```python\napi = AlphaSquared(\"YOUR_API_TOKEN\", cache_ttl=300)  # 5 minutes\n```\n\n## Documentation\n\nFor more information about the AlphaSquared API, consult the [official API documentation](https://alphasquared.io/api-docs).\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for more information.\n\n## Disclaimer\n\nThis project is not affiliated with, maintained, or endorsed by AlphaSquared. Use this software at your own risk. Trading cryptocurrencies carries a risk of financial loss. The developers of this software are not responsible for any financial losses or damages incurred while using this software.\n\n## Support\n\nFor any issues, questions, or assistance, please open an issue on the GitHub repository or contact AlphaSquared support at admin@alphasquared.io.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The unofficial Python client for the AlphaSquared API",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/rhettre/alphasquared-py"
    },
    "split_keywords": [
        "alphasquared",
        " coinbase",
        " gemini",
        " kraken",
        " orderbook",
        " trade",
        " bitcoin",
        " ethereum",
        " btc",
        " eth",
        " client",
        " api",
        " wrapper",
        " exchange",
        " crypto",
        " currency",
        " trading",
        " trading-api",
        " fear-and-greed-index"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8bc8423b7ca805a8bc1d91e1d9f68a19c15613e1e985868e2c9b23322e693491",
                "md5": "d64594bbd77ce604f73237a0778a1f4b",
                "sha256": "2bf93611df68d7d0ac1635eddc7e4b2d40cff7e75a95dbf3912007cdb0f28d3a"
            },
            "downloads": -1,
            "filename": "alphasquared_py-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d64594bbd77ce604f73237a0778a1f4b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6223,
            "upload_time": "2024-09-08T00:55:12",
            "upload_time_iso_8601": "2024-09-08T00:55:12.831949Z",
            "url": "https://files.pythonhosted.org/packages/8b/c8/423b7ca805a8bc1d91e1d9f68a19c15613e1e985868e2c9b23322e693491/alphasquared_py-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "83efcf0019bbd796c336939bd692e83f11c59f68390ab1aecc85522b090ea18b",
                "md5": "0bc5280560daf66ff98327016b06e497",
                "sha256": "35ef8c1ee8cbb47ef8b546341d5744d92996874a456715016fd74704154daafc"
            },
            "downloads": -1,
            "filename": "alphasquared_py-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0bc5280560daf66ff98327016b06e497",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7360,
            "upload_time": "2024-09-08T00:55:14",
            "upload_time_iso_8601": "2024-09-08T00:55:14.202616Z",
            "url": "https://files.pythonhosted.org/packages/83/ef/cf0019bbd796c336939bd692e83f11c59f68390ab1aecc85522b090ea18b/alphasquared_py-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-08 00:55:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rhettre",
    "github_project": "alphasquared-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "alphasquared-py"
}
        
Elapsed time: 0.33227s