Skip to content

Support for reading in edgelists from a file handle (instead of a file) #22

@davidjurgens

Description

@davidjurgens

Some large edgelists need to be stored on disk in a compressed format. However, zenlib requires pass the edgelist the file name, which prevents reading in these kinds of edge lists without first decompressing them. It would be nice to be able to read them in from an open file handle instead of the handle. This lets the caller perform any necessary file decompression first and then having zenlib read them as normal. For example:

f = os.path.join("mypath", "myfile.elist")
G = zen.edgelist.read(f)

would become

f = os.path.join("mypath", "myfile.elist.gz")
fh = gzip.open(f)
G = zen.edgelist.read(fh)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions