Skip to content

Folder

synapseclient.entity.Folder

Bases: Entity

Represents a folder in Synapse.

Folders must have a name and a parent and can optionally have annotations.

ATTRIBUTE DESCRIPTION
name

The name of the folder

parent

The parent project or folder

properties

A map of Synapse properties

annotations

A map of user defined annotations

local_state

Internal use only

Using this class

Creating an instance and storing the folder

folder = Folder(name='my data', parent=project)
folder = syn.store(folder)
Source code in synapseclient/entity.py
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
class Folder(Entity):
    """
    Represents a folder in Synapse.

    Folders must have a name and a parent and can optionally have annotations.

    Attributes:
        name: The name of the folder
        parent: The parent project or folder
        properties: A map of Synapse properties
        annotations: A map of user defined annotations
        local_state: Internal use only

    Example: Using this class
        Creating an instance and storing the folder

            folder = Folder(name='my data', parent=project)
            folder = syn.store(folder)
    """

    _synapse_entity_type = "org.sagebionetworks.repo.model.Folder"

    def __init__(
        self,
        name=None,
        parent=None,
        properties=None,
        annotations=None,
        local_state=None,
        **kwargs,
    ):
        if name:
            kwargs["name"] = name
        super(Folder, self).__init__(
            concreteType=Folder._synapse_entity_type,
            properties=properties,
            annotations=annotations,
            local_state=local_state,
            parent=parent,
            **kwargs,
        )