Skip to main content

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

  1. Import the WormholescanAPI class.

    from pywormholescan import WormholescanAPI, Network
    
  2. Create an instance of WormholescanAPI

    w = WormholescanAPI(network=Network.MAINNET)
    
  3. 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:

  1. Fork the repository: Create a fork of the PyWormholescan repository on GitHub.
  2. Clone your fork: Clone your forked repository to your local machine.
  3. Create a new branch: Create a new branch for your contribution.
  4. Make changes: Implement your changes and write clear code with docstrings.
  5. Test your changes: Thoroughly test your changes to ensure they don't introduce regressions.
  6. Commit your changes: Commit your changes with a descriptive commit message.
  7. Push your changes: Push your changes to your forked repository on GitHub.
  8. Create a pull request: Create a pull request from your branch to the main branch of the upstream PyWormholescan repository.

Additional Tips:

  1. Adhere to code style: Follow the existing code style and formatting conventions for consistency.
  2. Write clear documentation: If you're adding new features, provide clear documentation within the code using docstrings.
  3. Communicate effectively: Clearly explain your changes and reasoning in the pull request description.
  4. Review process: We will review your pull request and provide feedback.

We appreciate your contributions to PyWormholescan ❤!

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

pywormholescan-0.1.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

pywormholescan-0.1.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file pywormholescan-0.1.0.tar.gz.

File metadata

  • Download URL: pywormholescan-0.1.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for pywormholescan-0.1.0.tar.gz
Algorithm Hash digest
SHA256 30c7449bb8b9e3720dadcd410e08839a8717f15511bd94c9c64bf1e22e78d16b
MD5 caa4dd61531bcd6e8aa70eedba42d8e4
BLAKE2b-256 b45cb270537cf92b294fbf0c32effb5acc3277c12a7a32e4ef29d030e79a0e86

See more details on using hashes here.

File details

Details for the file pywormholescan-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pywormholescan-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43e4117e155f3dcdee163902dc8029e8d1a2b382159b7f9a75e3b92346551bea
MD5 f95a06b5cfb2fc315e9a413c7fe2647e
BLAKE2b-256 4b39825bc1a539c58dbb53b2cab4153487a1162fab12f7cd834aaec0a539bffd

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