def add_project(<EOL>self,<EOL>title,<EOL>tags=None):
self.refresh<EOL>project = title.strip()<EOL>if "<STR_LIT::>" != project[-<NUM_LIT:1>]:<EOL><INDENT>project += "<STR_LIT::>"<EOL><DEDENT>if tags:<EOL><INDENT>if isinstance(tags, list):<EOL><INDENT>if "<STR_LIT:@>" not in tags[<NUM_LIT:0>]:<EOL><INDENT>tagString = ("<STR_LIT>").join(tags)<EOL>tagString = "<STR_LIT:@>" + tagString<EOL><DEDENT>else:<EOL><INDENT>tagString = ("<STR_LIT:U+0020>").join(tags)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>tagString = tags<EOL><DEDENT>tagString = tagString.strip()<EOL>project += "<STR_LIT:U+0020>" + tagString<EOL><DEDENT>newProject = self._get_object(<EOL>regex=re.compile(<EOL>r'<STR_LIT>', re.UNICODE),<EOL>objectType="<STR_LIT>",<EOL>content=project<EOL>)<EOL>oldContent = self.to_string(indentLevel=<NUM_LIT:1>)<EOL>newContent = self.to_string(<EOL>indentLevel=<NUM_LIT:1>, projects=self.projects + newProject)<EOL>if self.parent:<EOL><INDENT>doc = self.parent._update_document_tree(<EOL>oldContent=oldContent,<EOL>newContent=newContent<EOL>)<EOL><DEDENT>self.content = self.content.replace(self.to_string(indentLevel=<NUM_LIT:0>, title=False), self.to_string(<EOL>indentLevel=<NUM_LIT:0>, title=False, projects=self.projects + newProject))<EOL>doc = self<EOL>while doc.parent:<EOL><INDENT>doc = doc.parent<EOL><DEDENT>doc.refresh<EOL>if not self.parent:<EOL><INDENT>parent = self<EOL><DEDENT>else:<EOL><INDENT>parent = doc.get_project(self.title)<EOL><DEDENT>thisProject = parent.get_project(title)<EOL>self.refresh<EOL>return thisProject<EOL>
*Add a project to this taskpaper object*

        **Key Arguments:**
            - ``title`` -- the title for the project.
            - ``tags`` -- tag string (*"@one @two(data)"*) or list of tags (*['one', 'two(data)']*)
            - ``oldContent`` -- the old content to be replaced in parent object (user sould not need to give this)
            - ``newContent`` -- the replacement text for the parent object  (user sould not need to give this)

        **Return:**
            - ``project`` -- the new taskpaper project object

        **Usage:**

            To add a sub-project to a taskpaper document or project use:

            .. code-block:: python

                newProject = doc.add_project(
                    title="this is a projects I added",
                    tags="@with @tags"
                )