semvec/pypi-packages huggingface dataset:
denonavr-cli 4
A simple CLI for Denon AV receivers
Requires Python: >=3.9

============
denonavr-cli
============

denonavr-cli is a trivial CLI client for Denon AV receivers based
on the denonavr_ library.  Its biggest advantage is receiver
autodiscovery, so you don't have to specify the IP address.

When run without arguments, it scans the network for AVRs.  If it finds
exactly one, it displays its status::

    $ denonavr-cli
    Power: ON       Volume: -54.0 dB         Input: HEOS Music

Note that if there are more AVRs on the network, you need to specify
the host explicitly::

    $ denonavr-cli -H 192.168.1.6

After every call, the executable caches the host used, eliminating
the autodiscovery delay for subsequent commands (but ``-H`` always
overrides the cached value).  If the cached host is no longer
responding, it is discarded and autodiscovery is reenabled.  You can
also manually clear the cache via::

    $ denonavr-cli --host-cache=reset

To see the available commands and options::

    $ denonavr-cli --help

In general, commands without additional arguments print the current
status in a machine-readable format, e.g.::

    $ denonavr-cli volume
    -54.0

The commands that alter the state generally print the new value
after performing the action::

    $ denonavr-cli volume up 4
    -50.0


.. _denonavr: https://pypi.org/project/denonavr/
dinger-payment 2.0.8
This library purpose is helper for dinger payment encryption
Requires Python: >=3.7

# Dinger Prebuild Checkout From for generate URL

## Usage

### Encryption

```python
import json
from urllib.parse import urlencode, quote_plus

from dinger_payment import get_prebuild_form_url

if __name__ == '__main__':
    items = [
        {"name": "DiorAct Sandal", "amount": 250, "quantity": 1},
        {"name": "Aime Leon Dore", "amount": 250, "quantity": 1},
    ]
    data = {
        # items must be string
        "items": json.dumps(items),
        "customerName": "James",
        "totalAmount": 500,
        "merchantOrderId": "123456",
        # get from checkout-form page
        "clientId": "xxxx",
        # get from data-dashboard page
        "publicKey": "xxxx",
        # get from data-dashboard page
        "merchantKey": "xxxx",
        # your project name
        "projectName": "xxxx",
        # your account username
        "merchantName": "xxxx",
    }
    secretkey = "xxxx"
    public_key = "-----BEGIN PUBLIC KEY-----\n"
                 + "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCFD4IL1suUt/TsJu6zScnvsEdLPuACgBdjX82QQf8NQlFHu2v/84dztaJEyljv3TGPuEgUftpC9OEOuEG29z7z1uOw7c9T/luRhgRrkH7AwOj4U1+eK3T1R+8LVYATtPCkqAAiomkTU+aC5Y2vfMInZMgjX0DdKMctUur8tQtvkwIDAQAB"
                 + "\n-----END PUBLIC KEY-----"
    encrypted_payload, hash_value = get_prebuild_form_url(public_key=public_key, secretkey=secretkey, **data)
    host = "form.dinger.asia"  # for production
    # host = "prebuilt.dinger.asia" # for staging
    url = f"https://{host}?{urlencode({'payload': encrypted_payload, 'hashValue': hash_value}, quote_via=quote_plus)}"
    print(url)
```

### Decryption

```python
    from dinger_payment import decrypt_aes_ecb
    data = {'paymentResult': 'xxxx',
            'checksum': 'xxxx'}
    merchant_callback_key = "xxxx"
    
    # Example usage
    secret_key = callback_key  # Must be 32 characters or will be padded
    encrypted_data = data['paymentResult']  # Replace with actual encrypted data
    
    decrypted_value = decrypt_aes_ecb(encrypted_data, secret_key)
    print(decrypted_value)
```