How to unwrap a mesh from view in python. blender 2.8
Use the mesh coords
The issue with your script is you are mixing objects and operators.
Here is the autocomplete of the project from view operator in the console.
&gt;&gt;&gt; bpy.ops.uv.project_from_view(
project_from_view()
bpy.ops.uv.project_from_view(orthographic=False, camera_bounds=True, correct_aspect=True, clip_to_bounds=False, scale_to_bounds=False)
Project the UV vertices of the mesh as seen in current 3D view

Trying with C.object.uv. will throw same error as in question since an object has no property uv.
At issue with operators that use the view is they are designed to be run from within that view (it has context) via a button or menu item. Using in script will often require passing an override context or other dicking around, however for this would simply write the UV directly from the mesh coordinates.
To convert the context object to a mesh
&gt;&gt;&gt; bpy.ops.object.convert(
convert()
bpy.ops.object.convert(target='MESH', keep_original=False, angle=1.22173, thickness=5, seams=False, faces=True, offset=0.01)
Convert selected objects to another type

So with a curve object as context object
&gt;&gt;&gt; bpy.ops.object.convert(target='MESH')
{'FINISHED'}

eg this can be called directly after adding the font object and setting its body text.
Using the mesh coordinates
The UV operator template in Text Editor &gt; Templates &gt; Python &gt; Operator UV  adds a UV that is pretty much an orthogonal projection from above as it uses the x and y vertex coordinate as UV.
Here I've tweaked it to normalize the U and V to 0, 1 range.  To have same aspect would scale by the minimum of the X and Y range.

import bpy
import bmesh
import numpy as np
from mathutils import Matrix

def main(obj):
    me = obj.data
    bm = bmesh.new()
    bm.from_mesh(me)
    #bm = bmesh.from_edit_mesh(me)
    x, y, z = np.array([v.co for v in bm.verts]).T
    S = Matrix.Diagonal(
        ( 1 / (x.max() - x.min()),
          1 / (y.max() - y.min()))
          )
    uv_layer = bm.loops.layers.uv.verify()
    
    # adjust uv coordinates
    for face in bm.faces:
        for loop in face.loops:
            loop_uv = loop[uv_layer]
            # use xy position of the vertex as a uv coordinate
            loop_uv.uv = S @ loop.vert.co.xy

    bm.to_mesh(me)
    me.update()

# Test call    
main(bpy.context.object)