Skip to main content

A simple Python API wrapper for Owlracle

Project description

Owlracle Python

Python application Downloads License: MIT PyPI

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. 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, or the network attribute using:

owlracle.get_rpc_endpoint()

Authors

More information

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

owlracle_python-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

owlracle_python-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file owlracle_python-0.1.1.tar.gz.

File metadata

  • Download URL: owlracle_python-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.5 Windows/10

File hashes

Hashes for owlracle_python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9852cf92c5dd3a3fb5bae1a14246bfea58f2febb00a5771f169056f2b9cd388c
MD5 4a3b5aa1e9cd9adeb16826de1822cc78
BLAKE2b-256 e077aadc7a78c8600aa1088e29c408bb09458537e65584e98b1a14ac3e22d95d

See more details on using hashes here.

File details

Details for the file owlracle_python-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for owlracle_python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41b8d6c6557f14c65543f19b3a6bfe36246fc34a81dd4ee170c93a153583c889
MD5 6d2739f0c734df03089b70a239c27e07
BLAKE2b-256 cdbf61a1e94f34ad8f0bdbd2ab70181bc7b4db7ba19d2e2c6834023b42e4836c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page