How to load a big number of maps and assign them to variations of a material?
Working with you having some structure setup with your naming, let's say you have an object called "book1" and you have images "book1_diffuse.png" and "book1_roughness.png" you can create a material called "book1" that uses both images and then assign the material to the object.

import bpy
from glob import glob
import os

# adjust this to point to your texture directory
# can start with // to refer to the current blend file dir
texture_dir = '//textures'

os.chdir(bpy.path.abspath(texture_dir))
diffuse_imgs = glob('*_diffuse.png')
for img in diffuse_imgs:
    mat_name = img.split('_')[0]
    mat = bpy.data.materials.new(mat_name)
    mat.use_nodes = True
    m_nodes = mat.node_tree.nodes
    m_links = mat.node_tree.links
    diff_node = m_nodes['Diffuse BSDF']

    imgnode = m_nodes.new('ShaderNodeTexImage')
    imgnode.location.x = diff_node.location.x - 200
    imgnode.location.y = diff_node.location.y
    bpy.ops.image.open(filepath=img)
    imgnode.image = bpy.data.images[img]
    m_links.new( diff_node.inputs['Color'], imgnode.outputs['Color'] )

    roughnode = m_nodes.new('ShaderNodeTexImage')
    roughnode.location.x = imgnode.location.x - 200
    roughnode.location.y = imgnode.location.y - 50
    roughimg = mat_name+'_roughness.png'
    bpy.ops.image.open(filepath=roughimg)
    roughnode.image = bpy.data.images[roughimg]
    m_links.new( diff_node.inputs['Roughness'], roughnode.outputs['Color'] )

    uvnode = m_nodes.new('ShaderNodeUVMap')
    uvnode.location.x = roughnode.location.x - 200
    uvnode.location.y = roughnode.location.y - 100
    uvnode.uv_map = 'UVMap'
    m_links.new(imgnode.inputs['Vector'], uvnode.outputs['UV'])
    m_links.new(roughnode.inputs['Vector'], uvnode.outputs['UV'])

    bpy.data.objects[mat_name].active_material = mat


You can easily expand that to include any number of image textures for each material and add in a mix and glossy node if you wanted. You can find the node types you can use listed here.

If you have a random number of book objects, you could create the materials and add them to a list as you go, then go through the list of objects and pick a random material to assign to each.