Skip to main content

A Python module for interacting with blockchain data using the Bitex blockchain explorer

Project description

Bitex


The Bitex Python module provides an easy and convenient way to interact with blockchain data using the blockchain explorer. Whether you're interested in querying cryptocurrency addresses, retrieving balances, exploring transactions, or getting detailed information about blocks, Bitex has you covered.

Installation

To install the Bitex module, you can use the following pip command:

pip install bitex-blockchain-explorer

Usage

Import the bitex module and follow these steps to interact with blockchain data:

import bitex

# Define the cryptocurrency address
address = '1FeexV6bAHb8ybZjqQMjJrcCrHGW9sb6uF'

# Initialize the Bitex blockchain explorer
blockchain = bitex.Bitex()

# Search for the address on different chains
chains = blockchain.search(address)

# Choose a chain (e.g., 'btc') for further operations
chain = 'btc'

# Get the balance for the selected address
balance = blockchain.balance(chain, address)

# Convert the balance from satoshi to BTC format
balance_btc = blockchain.format_balance(balance['confirmed'])
print(f'Balance: {balance_btc:.8f} {chain.upper()}')

# Retrieve a limited number of transactions for the address
limit = 3
transactions = blockchain.transactions(chain, address, limit=limit)

# Access transaction details
if transactions:
    example_transaction = transactions[2]  # Get the third transaction
    txid = example_transaction.txid
    block = example_transaction.block
    block_height = block.height
    block_position = block.position

    # Get more details about the transaction
    transaction_details = example_transaction.details()

    # Extract specific details
    transaction_txid = transaction_details.txid
    transaction_size = transaction_details.size
    # ... (other details)

    # Get transaction details as a dictionary
    transaction_details_dict = transaction_details.get()

# Note: Replace 'your_crypto_address_here' with your actual cryptocurrency address

Features

  • Search for addresses on different chains.
  • Retrieve balance information for a given address.
  • Convert balance from satoshi to BTC format.
  • Get transaction details and block information.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

bitex-blockchain-explorer-0.1.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file bitex-blockchain-explorer-0.1.1.tar.gz.

File metadata

File hashes

Hashes for bitex-blockchain-explorer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1d319d38874f77bc486e37afee6d5245b459b0fb11e299c1cb7dce50fd8c24c2
MD5 101ea71740a3b1bf342fdba5699883ae
BLAKE2b-256 49bd6fa4989ba8701fe8057644fb20d95d7595c8f5ba9b766d255524f156a67a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bitex_blockchain_explorer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1c4c39bd6a8ad37131b366d8133c3f3f0ae121618550805016dc1bf6b2b36b5
MD5 2fc5e7cc5cce85198bf4248f00bbad9b
BLAKE2b-256 a0123866ec103fe1670d1bd0278cbcf71f5213d06e651da851c6f77d6d2d39e4

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