Simple Clojure function(s)

  • Job DurationLess than a month
  • Project LevelMedium Level
  • Project deadlineExpired

Project detail

I want a set of Clojure functions that will take an input (a list of resources) and will output a line of strings (see example below). I then want this function to be outputed to a file in the same directory (I have attached the example file that I want). This is very simple. I want a copy and replace, it should be template like where I can add future python lines to the string.

**INPUT:**
;; This variable defines a set of models, two in this example.
;; In each model you also have the data members or columns for the model.
(def models
‘((books
(id :int :primary)
(title :str :index)
(author :str :index)
(isbn :str :index))
(papers
(id :int :primary)
(title :str :index)
(pub_year :int)
(primary_author_name :string :index))))

**OUTPUT:**
The following should be the output file. As you can see I have done it for the first model in the Clojure def, i.e. Books. So the function should take any models and output something like below.
Note that the model data elements should match (where I have title, author and isbn).

from flask import (
Blueprint,
abort,
flash,
redirect,
render_template,
request,
jsonify,
url_for,
)
from app import db
from app.models import Book
from app.book.forms import *
book = Blueprint(‘book’, __name__)

@book.route(‘/new’, methods=[‘GET’, ‘POST’])
def new_book():
form = NewBookForm()
if form.validate_on_submit():
book = Book(
title = form.title.data,
author = form.author.data,
isbn = form.isbn.data)
db.session.add(book)
db.session.commit()
return render_template(‘book/new_book.html’, form=form)

Industry Categories

Freelancer type required for this project