TL,DR: Assuming you still are connected to NIH, possibly a constrain by the database's rules of access.
I don't understand much why you want to re-define the generation of pubchempy's report of SMILES (which needn't be canonical ones). For example,
import pubchempy as pcp
c = pcp.Compound.from_cid(5090)
print(c.isomeric_smiles)
yields CS(=O)(=O)C1=CC=C(C=C1)C2=C(C(=O)OC2)C3=CC=CC=C3 (condensed from the documentation) works well (just checked with Python 3.9.8). Of course the above may be extended to query lists of compounds, too. Not for beauty, e.g.
import pubchempy as pcp
compounds = [5090, 5091, 5092]
for entry in compounds:
c = pcp.Compound.from_cid(entry)
print(c.isomeric_smiles)
regardless if using NIH's PUG (with time out after $\pu{30 s}$ server time, ref), or an interface like pubchempy which recommends e.g., grouping the requests in smaller portions as strategy.
TL,DR: Assuming you still are connected to NIH, possibly a constrain by the database's rules of access.
I don't understand much why you want to re-define the generation of pubchempy's report of SMILES (which needn't be canonical ones). For example,
import pubchempy as pcpc = pcp.Compound.from_cid(5090)print(c.isomeric_smiles)
yields CS(=O)(=O)C1=CC=C(C=C1)C2=C(C(=O)OC2)C3=CC=CC=C3 (condensed from the documentation) works well (just checked with Python 3.9.8). Of course the above may be extended to query lists of compounds, too. Not for beauty, e.g.
import pubchempy as pcpcompounds = [5090, 5091, 5092]for entry in compounds: c = pcp.Compound.from_cid(entry) print(c.isomeric_smiles)
regardless if using NIH's PUG (with time out after $\pu{30 s}$ server time, ref), or an interface like pubchempy which recommends e.g., grouping the requests in smaller portions as strategy.
TL,DR: Assuming you still are connected to NIH, possibly a constrain by the database's rules of access.
I don't understand much why you want to re-define the generation of
pubchempy's report of SMILES (which needn't be canonical ones). For example,yields
CS(=O)(=O)C1=CC=C(C=C1)C2=C(C(=O)OC2)C3=CC=CC=C3(condensed from the documentation) works well (just checked with Python 3.9.8). Of course the above may be extended to query lists of compounds, too. Not for beauty, e.g.reports
However,
pubchempyhas to follow NIH's rules of access like any other mode of access, i.e.regardless if using NIH's PUG (with time out after $\pu{30 s}$ server time, ref), or an interface like
pubchempywhich recommends e.g., grouping the requests in smaller portions as strategy.TL,DR: Assuming you still are connected to NIH, possibly a constrain by the database's rules of access.
I don't understand much why you want to re-define the generation of
pubchempy's report of SMILES (which needn't be canonical ones). For example,yields
CS(=O)(=O)C1=CC=C(C=C1)C2=C(C(=O)OC2)C3=CC=CC=C3(condensed from the documentation) works well (just checked with Python 3.9.8). Of course the above may be extended to query lists of compounds, too. Not for beauty, e.g.reports
However,
pubchempyhas to follow NIH's rules of access like any other mode of access, i.e.regardless if using NIH's PUG (with time out after $\pu{30 s}$ server time, ref), or an interface like
pubchempywhich recommends e.g., grouping the requests in smaller portions as strategy.More
VOTE
VOTE