Varia library working group XPPL.
https://gitea.xpub.nl/XPUB/XPPL
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
531 B
22 lines
531 B
#import click
|
|
#from flask import Flask
|
|
from app import app, db
|
|
from app.models import Book
|
|
from csv import DictReader
|
|
import argparse
|
|
|
|
ap = argparse.ArgumentParser("import csv into flask")
|
|
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)
|
|
|
|
#app = Flask(__name__)
|
|
books = db.session.query(Book).all()
|
|
#print(books)
|
|
|
|
# @app.cli.command()
|
|
# @click.argument('name')
|
|
# def import_csv(name):
|
|
# print("hello")
|
|
|