Question: Is there a way to do this programmatically? I have an

`Address ShelleyAddr`

obtained from

`deserialiseFromBech32 AsShelleyAddress`

and need its

`Plutus.V1.Ledger.Crypto.PubKeyHash`

Answer: 
There is now the function `shelleyPayAddrToPlutusPubKHash` in `cardano-api` which returns `Maybe PubKeyHash` because in the case of a script credential there is no corresponding public key hash.
This compiles with a recent version of `cardano-node` and `plutus`:

```
import Plutus.V1.Ledger.Api (PubKeyHash)
import Cardano.Ledger.Alonzo.TxInfo (transKeyHash)
import Cardano.Api (ShelleyAddr)
import Cardano.Api.Shelley (Address (ShelleyAddress))   
import Cardano.Ledger.Shelley.API (Credential (KeyHashObj, ScriptHashObj))

addrToPkh :: Address ShelleyAddr -> PubKeyHash
addrToPkh (ShelleyAddress net (ScriptHashObj sh) sr) = transKeyHash sh
addrToPkh (ShelleyAddress net (KeyHashObj kh) sr) = transKeyHash kh

```