# Owlracle Python
[![Python application](https://github.com/alb2001/owlracle-python/actions/workflows/python-app.yml/badge.svg)](https://github.com/alb2001/owlracle-python/actions/workflows/python-app.yml)
[![Downloads](https://static.pepy.tech/badge/owlracle-python)](https://pepy.tech/project/owlracle-python)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI](https://img.shields.io/pypi/v/owlracle-python)](https://pypi.org/project/owlracle-python/)
A simple Python API wrapper for Owlracle
## Installation
```
pip install owlracle-python
```
## Obtaining API Key
To obtain an API key, you will need to register a new API key on https://owlracle.info/
## Getting Started
To get started, import the package, and initiate a `OwlracleAPI` instance object by passing your API key:
```
from owlracle_python import OwlracleAPI
owlracle = OwlracleAPI(api_key)
```
You can also pass an optional user agent:
```
owlracle = OwlracleAPI(api_key, useragent="User-Agent")
```
Or a different network:
```
owlracle = OwlracleAPI(api_key, network="bsc", useragent="User-Agent")
```
## Queries
Below are a set of queries supported by the [Owlracle API](https://owlracle.info/docs). All data is returned as a Python dictionary for easy data handling.
### Get Gas fee estimation
```
result = owlracle.get_gas_fee_estimation()
print(result)
```
You can also pass the `blocks`, `percentile`, `accept`, `feeinusd`, `eip1559`, `reportwei`, and `calcfrom` parameters:
```
result = owlracle.get_gas_fee_estimation(blocks=500, accept=99)
print(result)
```
### Get Gas history
```
result = owlracle.get_gas_history()
print(result)
```
You can also pass the `from_`, `to`, `candles`, `page`, `timeframe`, `tokenprice`, and `txfee` parameters:
```
result = owlracle.get_gas_history(from_=17849981, to=17949981)
print(result)
```
### Get API key information
By default, the api key supplied on object instance is the one that is checked:
```
result = owlracle.get_api_key_information()
print(result)
```
You can also supply another key to check
```
result = owlracle.get_api_key_information(api_key="randomkey")
print(result)
```
### Get API key credit recharge history
By default, the api key supplied on object instance is the one that is checked:
```
result = owlracle.get_api_key_credit_recharge_history()
print(result)
```
You can also supply another key to check
```
result = owlracle.get_api_key_credit_recharge_history(api_key="randomkey")
print(result)
```
### Get API key usage log
By default, the api key supplied on object instance is the one that is checked:
```
result = owlracle.get_api_key_usage_log()
print(result)
```
You can also supply another key to check
```
result = owlracle.get_api_key_usage_log(api_key="randomkey")
print(result)
```
You can also pass the `fromtime`, `totime`, and `limit` parameters:
```
result = owlracle.get_api_key_usage_log(fromtime=1692462951)
print(result)
```
You can also supply another key to check, while passing the parameters above
```
result = owlracle.get_api_key_usage_log(api_key="randomkey", fromtime=1692462951)
print(result)
```
### Get RPC endpoint
```
result = owlracle.get_rpc_endpoint()
pp.pprint(result)
```
## Testing
A set of tests have been included inside `tests` folder. You will need to setup an environment variable as `OwlracleAPIKey` with your API key
## Chain slugs
These can be obtained from the [API docs](https://owlracle.info/docs), or the `network` attribute using:
```
owlracle.get_rpc_endpoint()
```
## Authors
* [alb2001](https://github.com/alb2001)
## More information
* [owlracle-python on PyPI](https://pypi.org/project/owlracle-python)
* [Owlracle](https://owlracle.info/)
* [Owlracle API](https://owlracle.info/docs)
Raw data
{
"_id": null,
"home_page": "https://github.com/alb2001/owlracle-python",
"name": "owlracle-python",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "owlracle,api,wrapper,blockchain,gas,oracle",
"author": "alb2001",
"author_email": "alb2001@outlook.es",
"download_url": "https://files.pythonhosted.org/packages/e0/77/aadc7a78c8600aa1088e29c408bb09458537e65584e98b1a14ac3e22d95d/owlracle_python-0.1.1.tar.gz",
"platform": null,
"description": "# Owlracle Python\n[![Python application](https://github.com/alb2001/owlracle-python/actions/workflows/python-app.yml/badge.svg)](https://github.com/alb2001/owlracle-python/actions/workflows/python-app.yml)\n[![Downloads](https://static.pepy.tech/badge/owlracle-python)](https://pepy.tech/project/owlracle-python)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PyPI](https://img.shields.io/pypi/v/owlracle-python)](https://pypi.org/project/owlracle-python/)\n\nA simple Python API wrapper for Owlracle\n\n## Installation\n\n```\npip install owlracle-python\n```\n\n## Obtaining API Key\nTo obtain an API key, you will need to register a new API key on https://owlracle.info/\n\n\n## Getting Started\nTo get started, import the package, and initiate a `OwlracleAPI` instance object by passing your API key:\n```\nfrom owlracle_python import OwlracleAPI\nowlracle = OwlracleAPI(api_key)\n```\n\nYou can also pass an optional user agent:\n```\nowlracle = OwlracleAPI(api_key, useragent=\"User-Agent\")\n```\n\nOr a different network:\n```\nowlracle = OwlracleAPI(api_key, network=\"bsc\", useragent=\"User-Agent\")\n```\n\n## Queries\nBelow are a set of queries supported by the [Owlracle API](https://owlracle.info/docs). All data is returned as a Python dictionary for easy data handling.\n\n### Get Gas fee estimation\n```\nresult = owlracle.get_gas_fee_estimation()\nprint(result)\n```\n\nYou can also pass the `blocks`, `percentile`, `accept`, `feeinusd`, `eip1559`, `reportwei`, and `calcfrom` parameters:\n```\nresult = owlracle.get_gas_fee_estimation(blocks=500, accept=99)\nprint(result)\n```\n\n### Get Gas history\n```\nresult = owlracle.get_gas_history()\nprint(result)\n```\n\nYou can also pass the `from_`, `to`, `candles`, `page`, `timeframe`, `tokenprice`, and `txfee` parameters:\n```\nresult = owlracle.get_gas_history(from_=17849981, to=17949981)\nprint(result)\n```\n\n### Get API key information\nBy default, the api key supplied on object instance is the one that is checked:\n```\nresult = owlracle.get_api_key_information()\nprint(result)\n```\n\nYou can also supply another key to check\n```\nresult = owlracle.get_api_key_information(api_key=\"randomkey\")\nprint(result)\n```\n\n### Get API key credit recharge history\nBy default, the api key supplied on object instance is the one that is checked:\n```\nresult = owlracle.get_api_key_credit_recharge_history()\nprint(result)\n```\n\nYou can also supply another key to check\n```\nresult = owlracle.get_api_key_credit_recharge_history(api_key=\"randomkey\")\nprint(result)\n```\n\n### Get API key usage log\nBy default, the api key supplied on object instance is the one that is checked:\n```\nresult = owlracle.get_api_key_usage_log()\nprint(result)\n```\n\nYou can also supply another key to check\n```\nresult = owlracle.get_api_key_usage_log(api_key=\"randomkey\")\nprint(result)\n```\n\nYou can also pass the `fromtime`, `totime`, and `limit` parameters:\n```\nresult = owlracle.get_api_key_usage_log(fromtime=1692462951)\nprint(result)\n```\n\nYou can also supply another key to check, while passing the parameters above\n```\nresult = owlracle.get_api_key_usage_log(api_key=\"randomkey\", fromtime=1692462951)\nprint(result)\n```\n\n### Get RPC endpoint\n```\nresult = owlracle.get_rpc_endpoint()\npp.pprint(result)\n```\n\n## Testing\nA set of tests have been included inside `tests` folder. You will need to setup an environment variable as `OwlracleAPIKey` with your API key\n\n## Chain slugs\nThese can be obtained from the [API docs](https://owlracle.info/docs), or the `network` attribute using:\n```\nowlracle.get_rpc_endpoint()\n```\n\n\n## Authors\n* [alb2001](https://github.com/alb2001)\n\n\n## More information\n* [owlracle-python on PyPI](https://pypi.org/project/owlracle-python)\n* [Owlracle](https://owlracle.info/)\n* [Owlracle API](https://owlracle.info/docs)",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple Python API wrapper for Owlracle",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/alb2001/owlracle-python",
"Repository": "https://github.com/alb2001/owlracle-python"
},
"split_keywords": [
"owlracle",
"api",
"wrapper",
"blockchain",
"gas",
"oracle"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cdbf61a1e94f34ad8f0bdbd2ab70181bc7b4db7ba19d2e2c6834023b42e4836c",
"md5": "6d2739f0c734df03089b70a239c27e07",
"sha256": "41b8d6c6557f14c65543f19b3a6bfe36246fc34a81dd4ee170c93a153583c889"
},
"downloads": -1,
"filename": "owlracle_python-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6d2739f0c734df03089b70a239c27e07",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 4089,
"upload_time": "2024-01-26T10:31:39",
"upload_time_iso_8601": "2024-01-26T10:31:39.128383Z",
"url": "https://files.pythonhosted.org/packages/cd/bf/61a1e94f34ad8f0bdbd2ab70181bc7b4db7ba19d2e2c6834023b42e4836c/owlracle_python-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e077aadc7a78c8600aa1088e29c408bb09458537e65584e98b1a14ac3e22d95d",
"md5": "4a3b5aa1e9cd9adeb16826de1822cc78",
"sha256": "9852cf92c5dd3a3fb5bae1a14246bfea58f2febb00a5771f169056f2b9cd388c"
},
"downloads": -1,
"filename": "owlracle_python-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "4a3b5aa1e9cd9adeb16826de1822cc78",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 3667,
"upload_time": "2024-01-26T10:31:40",
"upload_time_iso_8601": "2024-01-26T10:31:40.245886Z",
"url": "https://files.pythonhosted.org/packages/e0/77/aadc7a78c8600aa1088e29c408bb09458537e65584e98b1a14ac3e22d95d/owlracle_python-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-26 10:31:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "alb2001",
"github_project": "owlracle-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "owlracle-python"
}