import Pkg

function package_list()::Vector{String}
    project_toml::String = package_directory("Project.toml",)
    pkg_list::Vector{String} = sort(
        unique(
            strip.(
                collect(
                    keys(
                        Pkg.TOML.parsefile(project_toml)["deps"]
                        )
                    )
                )
            )
        )
    return pkg_list
end

function print_list_of_package_imports(io::IO = stdout)::Nothing
    pkg_list::Vector{String} = sort(unique(package_list()))
    println("##### Beginning of file")
    println()
    println("# Automatically generated by: ")
    println("# PredictMD.print_list_of_package_imports()")
    println()
    for i = 1:length(pkg_list)
        println(io, "import $(pkg_list[i])",)
    end
    println()
    println("##### End of file")
    println()
    return nothing
end
