Skip to content

Project

synapseclient.entity.Project

Bases: Entity

Represents a project in Synapse.

Projects in Synapse must be uniquely named. Trying to create a project with a name that's already taken, say 'My project', will result in an error

ATTRIBUTE DESCRIPTION
name

The name of the project

alias

The project alias for use in friendly project urls.

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 project

project = Project('Foobarbat project')
project = syn.store(project)
Source code in synapseclient/entity.py
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
class Project(Entity):
    """
    Represents a project in Synapse.

    Projects in Synapse must be uniquely named. Trying to create a project with a name that's already taken, say
    'My project', will result in an error

    Attributes:
        name: The name of the project
        alias: The project alias for use in friendly project urls.
        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 project

            project = Project('Foobarbat project')
            project = syn.store(project)
    """

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

    _property_keys = Entity._property_keys + ["alias"]

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