Update main.py
Browse files
main.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from fastapi import FastAPI, HTTPException
|
2 |
from rdkit import Chem
|
3 |
from rdkit.Chem import Descriptors
|
4 |
from rdkit.Chem import rdMolDescriptors
|
@@ -40,9 +40,13 @@ def get_molecule_info(mol):
|
|
40 |
'number_of_rotatable_bonds': num_rotatable_bonds
|
41 |
}
|
42 |
|
|
|
|
|
|
|
43 |
|
44 |
-
|
45 |
-
|
|
|
46 |
if not name:
|
47 |
raise HTTPException(status_code=400, detail="No molecule name provided")
|
48 |
|
|
|
1 |
+
from fastapi import FastAPI, HTTPException, Request
|
2 |
from rdkit import Chem
|
3 |
from rdkit.Chem import Descriptors
|
4 |
from rdkit.Chem import rdMolDescriptors
|
|
|
40 |
'number_of_rotatable_bonds': num_rotatable_bonds
|
41 |
}
|
42 |
|
43 |
+
@app.get("/")
|
44 |
+
def home():
|
45 |
+
return "Hello! This is ChemDB."
|
46 |
|
47 |
+
|
48 |
+
@app.get("/molecule_info/{name}")
|
49 |
+
async def read_molecule_info(name: str, request: Request):
|
50 |
if not name:
|
51 |
raise HTTPException(status_code=400, detail="No molecule name provided")
|
52 |
|