user6691: I have managed to retrive a user address from a dapp connector wallet using JS:
api_promise = window.cardano.{wallet}.enable();
api_promise.then(function(api) {
  addr_promise = api.getUsedAddresses();
  addr_promise.then(
    function(addr) {
      value[0];  // this is a CBOR address !
...

I get this type of (presumably CBOR) address: 012f4d0b584ecb52e4e4b8e78e4ce77a6f822e59ede3277305fd526b71824b2d2740284cf6a28e2a512cc4a00f41004c18ed728a0f7a04eb29
Apparently with some skill it could be read using this -> https://cbor.me.
# Is there any method to extract a shelley addr_34.... using JS or python?
Working implementations are available in node.js, but I'm using flask (python + JS). And I'm struggling to make it work wit packages cbor2 and bech32.
For example I tried cbor2.loads(bytes(addr_str, 'utf-8')) without success.
My further goal is to query blockfrost.

user1894: First install the npm module:
npm i @emurgo/cardano-serialization-lib-browser

Then you need a wasm loader module
class wasm {
  async load() {
    if (this._wasm) return;
    /**
     * @private
     */
    this._wasm = await import(
      "@emurgo/cardano-serialization-lib-browser/cardano_serialization_lib"
    );
  }

  get Cardano() {
    return this._wasm;
  }
}

export default new wasm();

Then import into your module/component using:
import WASMLoader from "../../utils/Loader";

Now you should be able to use wasm module to convert the CBOR address into bech32 (addr1.., stake1.. etc)
const getAddressToBech32 = async () => {
    await WASMLoader.load();
    const address = (await api.getUsedAddresses())[0];
    return WASMLoader.Cardano.Address.from_bytes(Buffer.from(address,"hex")).to_bech32();
};

Now that you have a bech32 address you should be able to use with for blockfrost API queries

user837: You can also use typhonjs used by typhonwallet. It's a Pure JS library not dependent on WASM.
Install
npm i @stricahq/typhonjs

Usage
const typhonjs =  require("@stricahq/typhonjs");

const bech32Address = typhonjs.utils
  .getAddressFromHex("012f4d0b584ecb52e4e4b8e78e4ce77a6f822e59ede3277305fd526b71824b2d2740284cf6a28e2a512cc4a00f41004c18ed728a0f7a04eb29")
  .getBech32();


6691: <p>I have managed to retrive a user address from a dapp connector wallet using JS:</p>
<pre><code>api_promise = window.cardano.{wallet}.enable();
api_promise.then(function(api) {
  addr_promise = api.getUsedAddresses();
  addr_promise.then(
    function(addr) {
      value[0];  // this is a CBOR address !
...
</code></pre>
<p>I get this type of (presumably CBOR) address: <code>012f4d0b584ecb52e4e4b8e78e4ce77a6f822e59ede3277305fd526b71824b2d2740284cf6a28e2a512cc4a00f41004c18ed728a0f7a04eb29</code>
Apparently with some skill it could be read using this -&gt; <code>https://cbor.me</code>.</p>
<p><strong># Is there any method to extract a shelley <code>addr_34....</code> using JS or python?</strong></p>
<p>Working implementations are available in node.js, but I'm using flask (python + JS). And I'm struggling to make it work wit packages <code>cbor2</code> and <code>bech32</code>.
For example I tried <code>cbor2.loads(bytes(addr_str, 'utf-8'))</code> without success.</p>
<p>My further goal is to query blockfrost.</p>
 1894: <p>First install the npm module:</p>
<pre><code>npm i @emurgo/cardano-serialization-lib-browser
</code></pre>
<p>Then you need a wasm loader module</p>
<pre><code>class wasm {
  async load() {
    if (this._wasm) return;
    /**
     * @private
     */
    this._wasm = await import(
      &quot;@emurgo/cardano-serialization-lib-browser/cardano_serialization_lib&quot;
    );
  }

  get Cardano() {
    return this._wasm;
  }
}

export default new wasm();
</code></pre>
<p>Then import into your module/component using:</p>
<pre><code>import WASMLoader from &quot;../../utils/Loader&quot;;
</code></pre>
<p>Now you should be able to use wasm module to convert the CBOR address into bech32 (addr1.., stake1.. etc)</p>
<pre><code>const getAddressToBech32 = async () =&gt; {
    await WASMLoader.load();
    const address = (await api.getUsedAddresses())[0];
    return WASMLoader.Cardano.Address.from_bytes(Buffer.from(address,&quot;hex&quot;)).to_bech32();
};
</code></pre>
<p>Now that you have a bech32 address you should be able to use with for blockfrost API queries</p>
 837: <p>You can also use <a href="https://www.npmjs.com/package/@stricahq/typhonjs" rel="nofollow noreferrer">typhonjs</a> used by typhonwallet. It's a Pure JS library not dependent on WASM.</p>
<p>Install</p>
<pre><code>npm i @stricahq/typhonjs
</code></pre>
<p>Usage</p>
<pre><code>const typhonjs =  require(&quot;@stricahq/typhonjs&quot;);

const bech32Address = typhonjs.utils
  .getAddressFromHex(&quot;012f4d0b584ecb52e4e4b8e78e4ce77a6f822e59ede3277305fd526b71824b2d2740284cf6a28e2a512cc4a00f41004c18ed728a0f7a04eb29&quot;)
  .getBech32();
</code></pre>
