diff --git a/main.py b/main.py index 85e525c..c8bf353 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,22 @@ from fastapi import FastAPI +from isbnlib import meta app = FastAPI() @app.get('/') async def root(): - return {"message": "Hello World"} \ No newline at end of file + return {"message": "Hello World"} + +@app.post('/checkin/{isbn}') +async def checkin(isbn): + return{"Checked in": isbn} + +@app.get('/checkout/{isbn}') +async def checkout(isbn): + return{"Checked Out": isbn} + +@app.put('/lookup/{isbn}') +async def lookup(isbn): + info = meta(isbn, service='Default') + return{"Title": info['Title']} diff --git a/test.py b/test.py new file mode 100644 index 0000000..ed3e46d --- /dev/null +++ b/test.py @@ -0,0 +1,10 @@ +from isbnlib import meta + + +isbn = '9780747532743' +infowiki = meta(isbn, service='wiki') +infoopenl = meta(isbn, service='openl') + + +print(infowiki) +print(infoopenl) \ No newline at end of file