semvec/pypi-packages huggingface dataset:
crypto-payments 1.1.2
Receive cryptocurrency payment, generate hd cryptocurrency wallet addresses and verifying payment made to an address.
License: MIT
Keywords: electrum web network internet btc bitcoin blockchain hd wallet crptocurrency crypto merchant

What is HD Merchant Wallet ?
===============
It is a simple lightweight tool for receiving cryptocurrency payment, generating hd cryptocurrency wallet addresses and verifying payment made to an address. You can
receive cryptocurrency payment easily in any python script or web app in just 3 simple steps. It perfectly works with electrum wallet so you can receive payment with this tool and spend your coins with electrum wallet.

Installation
==============
pip install merchant-wallet

Running
========

  
 - Get your master public key from a local or personal wallet e.g Electrum.
 - Generate addresses with this script, addresses will correspond with addresses on your electrum wallet, so you can easily spend your coins.
 - Give address for payment and verify transaction using this tool.


Accept Bitcoin on a website In 3 Steps
======================
 
          from merchant_wallet.backends.btc import BitcoinBackend
          
          
          btc = BitcoinBackend('master_public_key_gotten_from_an_offline_wallet')
          
          btc.generate_new_address(index=0) #index=0 will give the first address displayed on your electrum wallet, increase index to get more addresses as displayed on your wallet
          
          btc.confirm_address_payment(
            address="1Ge6rDuyCdYVGhXZjcK4251q67GXMKx6xK", total_crypto_amount=0.01, confirmation_number=3
          )#Confirm payment on the address with the specified confirmation and amount it will return a tuple of transaction status and value of transaction
          
          #Returned values
          #Unconfirmed payment -> (UNCONFIRMED_ADDRESS_BALANCE, transaction_hash)
          #Confirmed payment -> (CONFIRMED_ADDRESS_BALANCE, sent_value)
          #Underpaid payment -> (UNDERPAID_ADDRESS_BALANCE, remaining value)
          #No transaction -> (NO_HASH_ADDRESS_BALANCE, None )
          btc.confirm_address_payment(
            address="1Ge6rDuyCdYVGhXZjcK4251q67GXMKx6xK", total_crypto_amount=0.01, confirmation_number=5000, tx_hash='hash_returned_when_transaction_was_unconfirmed'
          )
Note
======================    
  This tool depends on blockcypher for verifying blockchain transactions and uses forex-python tool for calculating crypto prices
    
 
 
Helper methods
======================    
  
- bitcoin.convert_to_fiat( amount, currency)
- bitcoin.convert_from_fiat(amount, currency)
- Check tests for more
                 
Todo
======================              
 - Add more crypto currency support
 - Add support for local private blockchain service e.g bitcoind
    
**LICENSE**
=========
MIT
pyautomaton 0.2.2
a simple library to define reusable Finite State Machines with a fluent delcarative style
License: MIT
Requires Python: >=3.8,<4.0

# PyAutomaton

## Description 
PyAutomaton is a simple library implementing Mealy state machines, thus meaning that the events produced by the automaton are determined by the tuple (state, event) and not only on the current state, as happens with Moore state machines. 

## Installation 

```
pip install pytautomaton
```

## Basic Usage
PyAutomaton offers the possibility of declare State Machines by using a fluent descriptive style.
For example, given the state machine in the following figure: 
![turntile-picture](docs/imgs/turntile.png)

the code implementing this state machine is: 
```python
fsm = Automaton().start_from("locked").go_in("locked").when("push") \
                    .coming_from("locked").go_in("unlocked").when("coin") \
                    .coming_from("unlocked").go_in("unlocked").when("coin") \
                    .coming_from("unlocked").go_in("locked").when("push")
```

And the machine can run by invoking the fsm object as follow: 
```python
fsm('push')
```
each invocation triggers a state transition and returns the corresponding action, if any.

## Dump and restore the state machine 
It is possible to dump a state machine. A state machine dump is self consistent, thus meaning that it emodies both the state machine configuration as well as the current state of the automaton:
```python
dumped_machine = Automaton.dump(fsm)
machine = Automaton.load(dumped_machine)
```
The dump is produced in json format.