PyWormholescan serves as a Python wrapper for interacting with the Wormholescan API.
Project description
PyWormholescan
PyWormholescan is a Python wrapper that simplifies interaction with the Wormholescan API. It allows developers to leverage the power of Wormholescan's data and functionality using pure Python syntax.
Installation
pip install pywormholescan
Usage
-
Import the WormholescanAPI class.
from pywormholescan import WormholescanAPI, Network
-
Create an instance of WormholescanAPI by specifying a network, either MAINNET or TESTNET.
w = WormholescanAPI(network=Network.MAINNET)
-
Explore the available methods:
Refer to the official Wormholescan API documentation for a comprehensive list of available methods and their parameters.
Note
URL path variables are required arguments and can be passed either as positional or keyword arguments. However, URL query variables must be passed as keyword arguments.
This module allows developers to use standard Python syntax. Non-required query variables, such as pageSize
from the core API, can be written in snake case (page_size
). However, required query variables, such as time_span
, must be written with snake case.
Examples
# Check health status.
>>> w.get_health_check()
{'status': 'OK'}
# Get token by chain and address.
# In this example, notice how path variables can be passed as positional arguments.
>>> token_info = w.get_token_by_chain_and_address(1, "85VBFQZC9TZkfaptBWjvUw7YbZjy52A6mjtPGjstQAmQ")
>>> print(token_info)
{'symbol': 'W', 'coingeckoId': 'wormhole', 'decimals': 6}
>>> print(token_info["symbol"]) # Access token symbol from response
'W'
# Alternatively, pass path variables as keyword arguments.
>>> w.get_token_by_chain_and_address(chain_id=1, token_address="HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3")
{'symbol': 'PYTH', 'coingeckoId': 'pyth-network', 'decimals': 6}
# Get top assets by volume.
# Required query variables like the example below, must be passed as is (in snake case).
>>> w.get_top_assets_by_volume(time_span="7d")
{'assets': [{'emitterChain': 2, 'symbol': 'USDC', 'tokenChain': 2, 'tokenAddress': '000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 'volume': '50816690.58171399'}, ...]} # Remainder of output snipped for brevity.
Naming Conventions:
PyWormholescan follows Python snake_case conventions for both method names and arguments, ensuring consistency and readability.
Documentation
For detailed method descriptions, parameters, and example usage, refer to the official Wormholescan API documentation.
Contribution Guidelines
We welcome contributions from the community! If you have bug fixes, improvements, or new features for PyWormholescan, we encourage you to get involved.
Here's a quick guide to contributing:
- Fork the repository: Create a fork of the PyWormholescan repository on GitHub.
- Clone your fork: Clone your forked repository to your local machine.
- Create a new branch: Create a new branch for your contribution.
- Make changes: Implement your changes and write clear code with docstrings.
- Test your changes: Thoroughly test your changes to ensure they don't introduce regressions.
- Commit your changes: Commit your changes with a descriptive commit message.
- Push your changes: Push your changes to your forked repository on GitHub.
- Create a pull request: Create a pull request from your branch to the main branch of the upstream PyWormholescan repository.
Additional Tips:
- Adhere to code style: Follow the existing code style and formatting conventions for consistency.
- Write clear documentation: If you're adding new features, provide clear documentation within the code using docstrings.
- Communicate effectively: Clearly explain your changes and reasoning in the pull request description.
- Review process: We will review your pull request and provide feedback.
We appreciate your contributions to PyWormholescan ❤!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pywormholescan-0.1.2.tar.gz
.
File metadata
- Download URL: pywormholescan-0.1.2.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8042e29ca993893f4eabcf707e83aa179c38ce24c2f05edfdadc6f59f861b039 |
|
MD5 | b1fb6d5a0af87d75cbaa0d98bcab9d44 |
|
BLAKE2b-256 | c6ca9aec0bd3169928bf4fec607380419401a1363d6d0c5f47ee0f4ccee3133c |
File details
Details for the file pywormholescan-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: pywormholescan-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34b3e425a88f34b3be70a73e281a5c6caeb38b290719722fdf5e9f88eb933406 |
|
MD5 | 5db95228008b3c760199525f230dc7f9 |
|
BLAKE2b-256 | 79a42f0bf759f2c4d85c36caa1f732dbc4029388cf02f6e237269b5fae31f3e9 |