Input/Output operations on resources.
Bases: object
Serializer for a graph of connected resources.
Parameters: |
|
---|
list of weak references to the object (if defined)
Dumps the given resource and all resources linked to it into a set of representation files in the given directory.
Bases: pygraph.classes.digraph.digraph
Specialized digraph for resource instances.
Nodes are resources, edges represent relationships between resources. Since resources are wrapper objects generated on the fly, the presence of a resource in the graph is determined by its underlying entity, using the entity class and its ID as a key.
Builds a graph of dependencies among the given resource classes.
The dependency graph is a directed graph with member resource classes as nodes. An edge between two nodes represents a member or collection attribute.
Parameters: |
|
---|
Traverses the graph of resources that is reachable from the given resource.
If a resource dependency graph is given, links to other resources are only followed if the dependency graph has an edge connecting the two corresponding resource classes; otherwise, a default graph is built which ignores all direct cyclic resource references.
Resource : | a thelma.resources.MemberResource instance. |
---|---|
Returns: | a ResourceGraph instance representing the graph of resources reachable from the given resource. |
Dumps the given resource to the given stream using the specified MIME content type (defaults to CSV).
Convenience function. See thelma.resources.io.ConnectedResourcesSerializer.to_files() for details.
If no directory is given, the current working directory is used. The given context type defaults to CSV.
Convenience function. See thelma.resources.io.ConnectedResourcesSerializer.to_zipfile() for details.
The given context type defaults to CSV.
Collects all resources connected to the given resource and returns a dictionary mapping member resource classes to new collections containing the members found.
Loads resources from the specified file into the given collection resource.
If no content type is provided, an attempt is made to look up the extension of the given filename in the MIME content type registry.
Loads resources from the given stream into the given collection resource.
Loads a collection resource of the given registered resource type from a representation contained in the given URL.
Returns: | collection resource |
---|
Loads resources contained in the given ZIP archive into each of the given collections.
The ZIP file is expected to contain a list of file names obtained with the get_collection_filename() function, each pointing to a file of zipped collection resource data.
Parameters: |
|
---|