user31947: Here I'd like to generate the other address use xpub.
Is there any library (python) could help to derive the new address from extended key?
such as:
gen_new_pub(xpub, new_path) to get the derived public key. 
Of course, the library supposes could support 
gen_new_prv(xprv, new_path) to generate the corresponding private key according to the xprv and path.

user56633: here is a python BIP32 library: https://github.com/pezcore/obsidian
the command line interface is in bin/oku. Make sure the top level project forlder is on your PYTHONPATH and you can use it like this :
$ oku -p44/0/0/0 xpub661MyMwAqRbcF3DZvDPYWEzuFxL1Xt6RDdjGsuinnueNLiUSUYb7gaXEWxGMS4T96kDrBTdxxfVx6vqhYT9ZcJdNcevVpzjK2HYFN2PGmke
Root key info -------------------------------------------------------------------------------------------------
depth    : 0
index    : 00000000
parent   : 00000000
chaincode: 31D8745D939CD85B7E956A03908AA09C6E2FB7A3A7D74D3A90889DF5FED6AAA9
keydata  : 03B72E8FB7C8F2CA7664C8DADC23AD452888F0347C790E6473245AC2EF9E541724
BIP32 str: xpub661MyMwAqRbcF3DZvDPYWEzuFxL1Xt6RDdjGsuinnueNLiUSUYb7gaXEWxGMS4T96kDrBTdxxfVx6vqhYT9ZcJdNcevVpzjK2HYFN2PGmke

Derived Key info ----------------------------------------------------------------------------------------------
path     : 44/0/0/0
depth    : 4
index    : 00000000
parent   : A18376A9
chaincode: 17D3059131888335A8D3A664A015F519FD89D811154492725823D9829A1D6EE3
keydata  : 023FEED34B38497B005CA91BEA5AD5B1FCD0318DA01AC7EFDD1635B72FE3055CD3
BIP32 str: xpub6EikzRzgQiSsjiL3nz2SUZTi964wvqa1Je1WtRr5cXEwFEbMJvhas6BauDXoAVRhShfrJVTF1CKoq8zFmA9x72KocKxmRPBy4DizNPxLw9g

leaves--------------------------------------------------------------------------------------------------
 0 1LDB6EomUoB4uXaqutFes9uduQ9Mz7PgHh 021367BDC3D91C499DE400BA561F526C77DC4241CCA7768C7A6A76B4A0AAF32CAF
 1 1CfZgDBKAy9W6o4wJiGjCeMe4HPb3sibsY 037FEB277F7EE6EE89DC8CE25F6DDACEA12BCF9D937E5606A83CBC0A25C302CE8D
 2 1L5CaYTqgyimJwT8RY2WBBtMuVxzPdH2X3 039D2328D0617BDA04C7D1F775B2E5C9A16105D9E4F14F922ACC61869689E3F53F
 3 1AkdX6HckmWsq2j1RCWqM46n4ZEbgvbRdk 03DDC12460B3EE9152B89F9074E83D45A5823327BC2F947296E02157BB4939E20F
 4 1PTCkaUS7jVVvQ7VwDGNK4nNNdt6XVqLbE 03E8DDB7AE466FD33D61DA6D26B69C0647BB743AB5C88E7D949BDE4F2707FD7C18
 5 1CPWrifcbSNR3VjuqYZeSxWqqbCsiD8Mvk 024DD8FBDA96181F354AC9983BCC65CED733F991B2149003F6E064C84722C538F4
 6 16ir5E3NZbqKhYaUZVp33NvX2iJijxN6GL 02807DB9F04E1EDCECC5975E0444F7A93C78C2124FE1D10BBF7B948E47A914ADF6
 7 1BgeRDg7rfzwP4nWWEGPAzMheQJgQnC8Yk 034B8D9372A533F0320DA504CD73F21DB3E32E7A13C4241A52F92551C558F28E7A
 8 1F98cQLJsErpztRiB46qxcoKUToQcpCneY 034266D06746682BEDC0B617B98596C3FF1D6BB57E6D0C2C36A680CDAFA6EB0DB5

The pubkey derivation functionality is in detemrinistic.py take a look at the node_from_str() function to see about creating PubBIP32Node and PrivBIP32Node objects from xpub and xpriv BIP32 extended key strings.
Take a look at the ckd() methods of the classes in this file to see how the actual public and private child key derivation is performed. 

user62219: the btclib library (https://github.com/dginst/btclib) is a python3 type annotated library for bitcoin cryptography; it provides BIP32 functions, tested to successfully reproduce the BIP32 test vectors (https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki).
Among the btclib functions you can find:

bip32.ckd(xparentkey, index) [child key derivation]
bip32.xpub_from_xprv(xparentkey) [neutered derivation] 
bip32.derive(xkey, path) [child key path derivation]
bip32.address_from_xpub(xpub) [address derivation]
bip32.mprv_from_seed(seed) [master private key from seed]


31947: <p>Here I'd like to generate the other address use xpub.</p>

<p>Is there any library (python) could help to derive the new address from extended key?</p>

<p>such as:</p>

<p>gen_new_pub(xpub, new_path) to get the derived public key. </p>

<p>Of course, the library supposes could support </p>

<p>gen_new_prv(xprv, new_path) to generate the corresponding private key according to the xprv and path.</p>
 56633: <p>here is a python BIP32 library: <a href="https://github.com/pezcore/obsidian" rel="nofollow noreferrer">https://github.com/pezcore/obsidian</a></p>

<p>the command line interface is in <code>bin/oku</code>. Make sure the top level project forlder is on your <code>PYTHONPATH</code> and you can use it like this :</p>

<pre><code>$ oku -p44/0/0/0 xpub661MyMwAqRbcF3DZvDPYWEzuFxL1Xt6RDdjGsuinnueNLiUSUYb7gaXEWxGMS4T96kDrBTdxxfVx6vqhYT9ZcJdNcevVpzjK2HYFN2PGmke
Root key info -------------------------------------------------------------------------------------------------
depth    : 0
index    : 00000000
parent   : 00000000
chaincode: 31D8745D939CD85B7E956A03908AA09C6E2FB7A3A7D74D3A90889DF5FED6AAA9
keydata  : 03B72E8FB7C8F2CA7664C8DADC23AD452888F0347C790E6473245AC2EF9E541724
BIP32 str: xpub661MyMwAqRbcF3DZvDPYWEzuFxL1Xt6RDdjGsuinnueNLiUSUYb7gaXEWxGMS4T96kDrBTdxxfVx6vqhYT9ZcJdNcevVpzjK2HYFN2PGmke

Derived Key info ----------------------------------------------------------------------------------------------
path     : 44/0/0/0
depth    : 4
index    : 00000000
parent   : A18376A9
chaincode: 17D3059131888335A8D3A664A015F519FD89D811154492725823D9829A1D6EE3
keydata  : 023FEED34B38497B005CA91BEA5AD5B1FCD0318DA01AC7EFDD1635B72FE3055CD3
BIP32 str: xpub6EikzRzgQiSsjiL3nz2SUZTi964wvqa1Je1WtRr5cXEwFEbMJvhas6BauDXoAVRhShfrJVTF1CKoq8zFmA9x72KocKxmRPBy4DizNPxLw9g

leaves--------------------------------------------------------------------------------------------------
 0 1LDB6EomUoB4uXaqutFes9uduQ9Mz7PgHh 021367BDC3D91C499DE400BA561F526C77DC4241CCA7768C7A6A76B4A0AAF32CAF
 1 1CfZgDBKAy9W6o4wJiGjCeMe4HPb3sibsY 037FEB277F7EE6EE89DC8CE25F6DDACEA12BCF9D937E5606A83CBC0A25C302CE8D
 2 1L5CaYTqgyimJwT8RY2WBBtMuVxzPdH2X3 039D2328D0617BDA04C7D1F775B2E5C9A16105D9E4F14F922ACC61869689E3F53F
 3 1AkdX6HckmWsq2j1RCWqM46n4ZEbgvbRdk 03DDC12460B3EE9152B89F9074E83D45A5823327BC2F947296E02157BB4939E20F
 4 1PTCkaUS7jVVvQ7VwDGNK4nNNdt6XVqLbE 03E8DDB7AE466FD33D61DA6D26B69C0647BB743AB5C88E7D949BDE4F2707FD7C18
 5 1CPWrifcbSNR3VjuqYZeSxWqqbCsiD8Mvk 024DD8FBDA96181F354AC9983BCC65CED733F991B2149003F6E064C84722C538F4
 6 16ir5E3NZbqKhYaUZVp33NvX2iJijxN6GL 02807DB9F04E1EDCECC5975E0444F7A93C78C2124FE1D10BBF7B948E47A914ADF6
 7 1BgeRDg7rfzwP4nWWEGPAzMheQJgQnC8Yk 034B8D9372A533F0320DA504CD73F21DB3E32E7A13C4241A52F92551C558F28E7A
 8 1F98cQLJsErpztRiB46qxcoKUToQcpCneY 034266D06746682BEDC0B617B98596C3FF1D6BB57E6D0C2C36A680CDAFA6EB0DB5
</code></pre>

<p>The pubkey derivation functionality is in <code>detemrinistic.py</code> take a look at the <code>node_from_str()</code> function to see about creating <code>PubBIP32Node</code> and <code>PrivBIP32Node</code> objects from xpub and xpriv BIP32 extended key strings.</p>

<p>Take a look at the <code>ckd()</code> methods of the classes in this file to see how the actual public and private child key derivation is performed. </p>
 62219: <p>the btclib library (<a href="https://github.com/dginst/btclib" rel="nofollow noreferrer">https://github.com/dginst/btclib</a>) is a python3 type annotated library for bitcoin cryptography; it provides BIP32 functions, tested to successfully reproduce the BIP32 test vectors (<a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" rel="nofollow noreferrer">https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki</a>).</p>

<p>Among the btclib functions you can find:</p>

<ul>
<li>bip32.ckd(xparentkey, index) [child key derivation]</li>
<li>bip32.xpub_from_xprv(xparentkey) [neutered derivation] </li>
<li>bip32.derive(xkey, path) [child key path derivation]</li>
<li>bip32.address_from_xpub(xpub) [address derivation]</li>
<li>bip32.mprv_from_seed(seed) [master private key from seed]</li>
</ul>
