'Key is mandatory and has to match JIRA project key requirements, usually only 2-10 uppercase characters.
If name is not specified it will use the key value.
If assignee is not specified it will use current user.
Parameter template_name is used to create a project based on one of the existing project templates.
If template_name is not specified, then it should use one of the default values.
The returned value should evaluate to False if it fails otherwise it will be the new project id.'

def create_project(self, key, name=None, assignee=None, type=u'Software', template_name=None):

    if (assignee is None):
        assignee = self.current_user()
    if (name is None):
        name = key
    url = (self._options[u'server'] + u'/rest/project-templates/latest/templates')
    r = self._session.get(url)
    j = json_loads(r)
    possible_templates = [u'JIRA    Classic', u'JIRA    Default    Schemes', u'Basic    software    development']
    if (template_name is not None):
        possible_templates = [template_name]
    template_key = u'com.atlassian.jira-legacy-project-templates:jira-blank-item'
    templates = []
    for template in _get_template_list(j):
        templates.append(template[u'name'])
        if (template[u'name'] in possible_templates):
            template_key = template[u'projectTemplateModuleCompleteKey']
            break
    payload = {u'name': name, u'key': key, u'keyEdited': u'false', u'projectTemplateWebItemKey': template_key, u'projectTemplateModuleKey': template_key, u'lead': assignee}
    if (self._version[0] > 6):
        payload[u'type'] = type
    headers = CaseInsensitiveDict({u'Content-Type': u'application/x-www-form-urlencoded'})
    r = self._session.post(url, data=payload, headers=headers)
    if (r.status_code == 200):
        r_json = json_loads(r)
        return r_json
    f = tempfile.NamedTemporaryFile(suffix=u'.html', prefix=u'python-jira-error-create-project-', delete=False)
    f.write(r.text)
    if self.logging:
        logging.error((u'Unexpected    result    while    running    create    project.    Server    response    saved    in    %s    for    further    investigation    [HTTP    response=%s].' % (f.name, r.status_code)))
    return False
