Skip to content

Read CWLs without storing them #26

Description

@almanilsson
          The file could be read without storing it I think. I assume that you will receive 1 workflow in CWL and you can verify and parse it without storing it locally, something similar to:
async def score_workflows(file: UploadFile = File(...)):
    # Read the contents of the uploaded file
    contents = await file.read()
    
    # Parse the YAML content as a CWL workflow (this tests whether the file is a YAML file)
    try:
        cwl_content = yaml.safe_load(contents)
    except yaml.YAMLError as e:
        return {"error": "Invalid YAML file", "details": str(e)}
    
    # Extract information from the CWL workflow
    extracted_info = extract_info_from_cwl(cwl_content)

_Originally posted by @vedran-kasalica in https://github.com/Workflomics/workflomics-QCmetric/pull/22#discussion_r1716904798_
            

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions