Spaces:
Sleeping
Sleeping
Create converter.py
Browse files- converter.py +7 -0
converter.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from pubchempy import get_compounds
|
2 |
+
|
3 |
+
def polymer_name_to_smiles(polymer_name: str):
|
4 |
+
compounds = get_compounds(polymer_name, 'name')
|
5 |
+
if compounds:
|
6 |
+
return compounds[0].canonical_smiles
|
7 |
+
return None
|