Skip to content

CLI

Parameters:

Name Type Description Default
type str

Which kinds of project structure you want to create.

required
name str

The name for your python project.

required
demo bool

Create a demo python project.

required
Source code in pystru/cli.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@cli.command(name='create', help='Create a python project.')
@click.option('--type', default='basic', help='Which kinds of project structure you want to create.')
@click.option('--name', default='myPythonProject', help='The name for your python project.')
@click.option('--demo', default=False, help='Create a demo python project.')
def create_project(type: str, name: str, demo: bool):
    """
    Parameters
    ----------
    type : str
        Which kinds of project structure you want to create.
    name : str
        The name for your python project.
    demo : bool
        Create a demo python project.
    """
    meta_data.update({"repo_name": name})

    if type == 'tiny':
        s = structure.tiny

    elif type == 'basic':
        s = structure.basic

    cf = CreateFoldersAndFiles(templates_dir=templates_dir, meta_data=meta_data, **s)
    cf.create()

    if demo:
        create_demo()