|
|
|
@ -10,10 +10,16 @@ ap.add_argument("csv", help = "csv file to import")
|
|
|
|
|
ap.add_argument("--limit", type=int, default = None, help = "limit to x number of x")
|
|
|
|
|
args = ap.parse_args()
|
|
|
|
|
|
|
|
|
|
print(args)
|
|
|
|
|
with open(args.csv) as f:
|
|
|
|
|
for row in DictReader(f):
|
|
|
|
|
#print(row['Title'])
|
|
|
|
|
book = Book (row['Title'], "", "", row['Format'], row['Shelf'])
|
|
|
|
|
db.session.add(book)
|
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#app = Flask(__name__)
|
|
|
|
|
books = db.session.query(Book).all()
|
|
|
|
|
#books = db.session.query(Book).all()
|
|
|
|
|
#print(books)
|
|
|
|
|
|
|
|
|
|
# @app.cli.command()
|
|
|
|
|