newproject-cli


Namenewproject-cli JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/utox39/new-project-cli
SummaryA command-line tool to create new projects
upload_time2024-01-19 19:19:31
maintainer
docs_urlNone
authorutox39
requires_python>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements attrs click colorama jsonschema jsonschema-specifications markdown-it-py mdurl mypy-extensions packaging pathspec platformdirs Pygments PyYAML referencing rich rpds-py shellingham tomli typer typing_extensions
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # new-project-cli

[![codecov](https://codecov.io/gh/utox39/new-project-cli/graph/badge.svg?token=LLIV4AFVY6)](https://codecov.io/gh/utox39/new-project-cli)
[<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/newproject-cli">
](https://pypi.org/project/newproject-cli/)
[<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dw/newproject-cli">
](https://pypistats.org/packages/newproject-cli)
[<img alt="GitHub Workflow Status (with event)" src="https://img.shields.io/github/actions/workflow/status/utox39/new-project-cli/newproject-cli-tests.yaml">
](https://github.com/utox39/new-project-cli/actions/workflows/newproject-cli-tests.yaml)
---

[![asciicast](https://asciinema.org/a/RduB1EVKNj1zp9Gw0kCbptpFZ.svg)](https://asciinema.org/a/RduB1EVKNj1zp9Gw0kCbptpFZ)

- [Description](#description)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
    - [Customization](#customization)
- [Roadmap](#roadmap)
- [Contributing](#contributing)

## Description

Create a new project from the terminal.

This tool will help you create a minimal structure for your new project.

You can create new:

- Bash projects
- C projects
- Cpp projects
- Go projects
- Java projects
- Lua projects
- OCaml projects
- PHP projects
- Python projects
- Ruby projects
- Rust projects
- Vlang projects
- Web projects (html, css, javascript)

and open them in:

- [Visual Studio Code](https://code.visualstudio.com/)
- [PyCharm](https://www.jetbrains.com/pycharm/)
- [IntelliJ IDEA](https://www.jetbrains.com/idea/)

### Why these programming languages?

I mainly based myself on the percentages reported by
[Stackoverflow's 2023 Developer Survey](https://survey.stackoverflow.co/2023/)
for the
["Programming, scripting, and markup languages"](https://survey.stackoverflow.co/2023/#section-most-popular-technologies-programming-scripting-and-markup-languages)
section, and I selected the most used languages and those
that I consider to be the most promising or interesting

### Default development directories tree

```
$HOME
└──Developer
   └── projects
       ├── bash_projects
       ├── c_projects
       ├── cpp_projects
       ├── go_projects
       ├── java_projects
       ├── lua_projects
       ├── ocaml_projects
       ├── php_projects
       ├── python_projects
       ├── ruby_projects
       ├── rust_projects
       ├── vlang_projects
       └── web_projects
```

### Projects created via commands

E.g: To create a new Rust project, newproject use the following command:

```console
$ cargo new project_name
```

So it use the default command to create a new cargo package.

The same is for Ruby, OCaml and Vlang.

## Requirements

- [Python >= 3.10](https://www.python.org/)
- [pip](https://packaging.python.org/en/latest/tutorials/installing-packages/)

#### To create a Rust projects

- [Rust](https://www.rust-lang.org/learn/get-started)

#### To create a Ruby projects

- [Ruby](https://www.ruby-lang.org/en/documentation/installation/)
- [bundler](https://rubygems.org/gems/bundler)

#### To create a OCaml projects

- [OCaml](https://ocaml.org/install)
- [dune](https://ocaml.org/install)

## Installation

Easy as you can see here:

```console
$ pip install newproject-cli
```

Please note: After installing newproject with pip if you have not added ~/.local/bin (macOS/Linux) to $PATH you will be
asked to do so with a warning that should look like this:

```console
WARNING: The script newproject is installed in '/home/ubuntu/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
```

## Usage

#### Create a new python project

```console
$ newproject --python project_name
```

#### Create a new web project

```console
$ newproject --web project_name
```

This command will create a very simple web project with this structure:

```
project_name
├── README.md
├── index.html
├── scripts
│   └── index.js
└── styles
    └── style.css
```

#### Create a new project and open it in Visual Studio Code

WARNING: In order to open the new project in your favorite IDE you need to have the shell command

```console
$ newproject --code --python project_name
```

### Customization

The default yaml config file is located in site_packages

#### How can I find the default config file?

```console
$ pip3 show newproject-cli
Name: newproject-cli
Version: 0.x.x
Summary: A command-line tool to create new projects
Home-page: https://github.com/utox39/new-project-cli
Author: utox39
Author-email: francescomoccaldi39@gmail.com
License: MIT
Location: path/to/site-packages <-- LOOK HERE
Requires: jsonschema, pyyaml, rich, typer, typing_extensions
Required-by:

$ cd path/to/site-packages/newproject/config
```

#### YAML config file in ~/.config/newproject (macOS/Linux only)

The default configuration file is located in the site_packages folder, but you can also use a configuration file that
you
can create in the ~/.config/newproject folder.

ATTENTION: Using this config file does not involve updating to the latest features involving the default
config file (located in the site_packages), therefore it requires manual intervention

Let's see how you can do it:

- Create the configuration folder and the YAML config file

```console
$ cd ~/.config
$ mkdir newproject
$ touch newproject_config.yaml
```

- Open the YAML file in your editor of choice

- Copy the contents
  of [this](https://github.com/utox39/new-project-cli/blob/main/newproject/config/newproject_config.yaml) file into the
  YAML file

- Done

#### Customize the Development folder

In newproject_config.yaml:

```yaml
development_dir_path: path/to/your/development/folder/
```

E.g:

```yaml
development_dir_path: Documents/projects/
```

#### Customize a programming language projects folder

In newproject_config.yaml:

```yaml
project_folder_names:
  python_projects_dir_name: python_projects
```

#### Customize a programming language file content

In newproject_config.yaml:

You can customize the content of the files only of the following programming languages:

- Bash
- C
- Cpp
- Go
- Java
- Lua
- PHP
- Python
- Web projects (html, css, javascript)

```yaml
cpp:
  file_content: |
    #include <iostream>

    int main()
    {
        std::cout<<"hello world"<<'\n';
        return 0;
    }
```

#### Customize the .gitignore for a specific programming language

In newproject_config.yaml:

You can customize the content of the .gitignore only of the following programming languages:

- Bash
- C
- Cpp
- Go
- Java
- Lua
- PHP
- Python
- Web projects (html, css, javascript)

```yaml
python:
  gitignore_content: |
    DS_Store
    .env
    .vscode/
    .idea/
    test/
    venv/
```

#### Customize the default .gitignore

```yaml
default_gitignore_content: |
  .DS_Store
  .env
  .vscode/
  .idea/
  test/
  foo/
```

## Roadmap

- Improve customization
- Add more programming languages
- Add more IDE
- Improve user output and experience
- Publish this project to package managers

## Contributing

If you would like to contribute to this project just create a pull request which I will try to review as soon as
possible.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/utox39/new-project-cli",
    "name": "newproject-cli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "",
    "author": "utox39",
    "author_email": "francescomoccaldi39@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/25/cc/32868cf94342cd401302e9820c443e63f202c3418bf66ab1a5812138faff/newproject_cli-1.0.1.tar.gz",
    "platform": null,
    "description": "# new-project-cli\n\n[![codecov](https://codecov.io/gh/utox39/new-project-cli/graph/badge.svg?token=LLIV4AFVY6)](https://codecov.io/gh/utox39/new-project-cli)\n[<img alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/newproject-cli\">\n](https://pypi.org/project/newproject-cli/)\n[<img alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dw/newproject-cli\">\n](https://pypistats.org/packages/newproject-cli)\n[<img alt=\"GitHub Workflow Status (with event)\" src=\"https://img.shields.io/github/actions/workflow/status/utox39/new-project-cli/newproject-cli-tests.yaml\">\n](https://github.com/utox39/new-project-cli/actions/workflows/newproject-cli-tests.yaml)\n---\n\n[![asciicast](https://asciinema.org/a/RduB1EVKNj1zp9Gw0kCbptpFZ.svg)](https://asciinema.org/a/RduB1EVKNj1zp9Gw0kCbptpFZ)\n\n- [Description](#description)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Customization](#customization)\n- [Roadmap](#roadmap)\n- [Contributing](#contributing)\n\n## Description\n\nCreate a new project from the terminal.\n\nThis tool will help you create a minimal structure for your new project.\n\nYou can create new:\n\n- Bash projects\n- C projects\n- Cpp projects\n- Go projects\n- Java projects\n- Lua projects\n- OCaml projects\n- PHP projects\n- Python projects\n- Ruby projects\n- Rust projects\n- Vlang projects\n- Web projects (html, css, javascript)\n\nand open them in:\n\n- [Visual Studio Code](https://code.visualstudio.com/)\n- [PyCharm](https://www.jetbrains.com/pycharm/)\n- [IntelliJ IDEA](https://www.jetbrains.com/idea/)\n\n### Why these programming languages?\n\nI mainly based myself on the percentages reported by\n[Stackoverflow's 2023 Developer Survey](https://survey.stackoverflow.co/2023/)\nfor the\n[\"Programming, scripting, and markup languages\"](https://survey.stackoverflow.co/2023/#section-most-popular-technologies-programming-scripting-and-markup-languages)\nsection, and I selected the most used languages and those\nthat I consider to be the most promising or interesting\n\n### Default development directories tree\n\n```\n$HOME\n\u2514\u2500\u2500Developer\n   \u2514\u2500\u2500 projects\n       \u251c\u2500\u2500 bash_projects\n       \u251c\u2500\u2500 c_projects\n       \u251c\u2500\u2500 cpp_projects\n       \u251c\u2500\u2500 go_projects\n       \u251c\u2500\u2500 java_projects\n       \u251c\u2500\u2500 lua_projects\n       \u251c\u2500\u2500 ocaml_projects\n       \u251c\u2500\u2500 php_projects\n       \u251c\u2500\u2500 python_projects\n       \u251c\u2500\u2500 ruby_projects\n       \u251c\u2500\u2500 rust_projects\n       \u251c\u2500\u2500 vlang_projects\n       \u2514\u2500\u2500 web_projects\n```\n\n### Projects created via commands\n\nE.g: To create a new Rust project, newproject use the following command:\n\n```console\n$ cargo new project_name\n```\n\nSo it use the default command to create a new cargo package.\n\nThe same is for Ruby, OCaml and Vlang.\n\n## Requirements\n\n- [Python >= 3.10](https://www.python.org/)\n- [pip](https://packaging.python.org/en/latest/tutorials/installing-packages/)\n\n#### To create a Rust projects\n\n- [Rust](https://www.rust-lang.org/learn/get-started)\n\n#### To create a Ruby projects\n\n- [Ruby](https://www.ruby-lang.org/en/documentation/installation/)\n- [bundler](https://rubygems.org/gems/bundler)\n\n#### To create a OCaml projects\n\n- [OCaml](https://ocaml.org/install)\n- [dune](https://ocaml.org/install)\n\n## Installation\n\nEasy as you can see here:\n\n```console\n$ pip install newproject-cli\n```\n\nPlease note: After installing newproject with pip if you have not added ~/.local/bin (macOS/Linux) to $PATH you will be\nasked to do so with a warning that should look like this:\n\n```console\nWARNING: The script newproject is installed in '/home/ubuntu/.local/bin' which is not on PATH.\nConsider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\n```\n\n## Usage\n\n#### Create a new python project\n\n```console\n$ newproject --python project_name\n```\n\n#### Create a new web project\n\n```console\n$ newproject --web project_name\n```\n\nThis command will create a very simple web project with this structure:\n\n```\nproject_name\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 index.html\n\u251c\u2500\u2500 scripts\n\u2502   \u2514\u2500\u2500 index.js\n\u2514\u2500\u2500 styles\n    \u2514\u2500\u2500 style.css\n```\n\n#### Create a new project and open it in Visual Studio Code\n\nWARNING: In order to open the new project in your favorite IDE you need to have the shell command\n\n```console\n$ newproject --code --python project_name\n```\n\n### Customization\n\nThe default yaml config file is located in site_packages\n\n#### How can I find the default config file?\n\n```console\n$ pip3 show newproject-cli\nName: newproject-cli\nVersion: 0.x.x\nSummary: A command-line tool to create new projects\nHome-page: https://github.com/utox39/new-project-cli\nAuthor: utox39\nAuthor-email: francescomoccaldi39@gmail.com\nLicense: MIT\nLocation: path/to/site-packages <-- LOOK HERE\nRequires: jsonschema, pyyaml, rich, typer, typing_extensions\nRequired-by:\n\n$ cd path/to/site-packages/newproject/config\n```\n\n#### YAML config file in ~/.config/newproject (macOS/Linux only)\n\nThe default configuration file is located in the site_packages folder, but you can also use a configuration file that\nyou\ncan create in the ~/.config/newproject folder.\n\nATTENTION: Using this config file does not involve updating to the latest features involving the default\nconfig file (located in the site_packages), therefore it requires manual intervention\n\nLet's see how you can do it:\n\n- Create the configuration folder and the YAML config file\n\n```console\n$ cd ~/.config\n$ mkdir newproject\n$ touch newproject_config.yaml\n```\n\n- Open the YAML file in your editor of choice\n\n- Copy the contents\n  of [this](https://github.com/utox39/new-project-cli/blob/main/newproject/config/newproject_config.yaml) file into the\n  YAML file\n\n- Done\n\n#### Customize the Development folder\n\nIn newproject_config.yaml:\n\n```yaml\ndevelopment_dir_path: path/to/your/development/folder/\n```\n\nE.g:\n\n```yaml\ndevelopment_dir_path: Documents/projects/\n```\n\n#### Customize a programming language projects folder\n\nIn newproject_config.yaml:\n\n```yaml\nproject_folder_names:\n  python_projects_dir_name: python_projects\n```\n\n#### Customize a programming language file content\n\nIn newproject_config.yaml:\n\nYou can customize the content of the files only of the following programming languages:\n\n- Bash\n- C\n- Cpp\n- Go\n- Java\n- Lua\n- PHP\n- Python\n- Web projects (html, css, javascript)\n\n```yaml\ncpp:\n  file_content: |\n    #include <iostream>\n\n    int main()\n    {\n        std::cout<<\"hello world\"<<'\\n';\n        return 0;\n    }\n```\n\n#### Customize the .gitignore for a specific programming language\n\nIn newproject_config.yaml:\n\nYou can customize the content of the .gitignore only of the following programming languages:\n\n- Bash\n- C\n- Cpp\n- Go\n- Java\n- Lua\n- PHP\n- Python\n- Web projects (html, css, javascript)\n\n```yaml\npython:\n  gitignore_content: |\n    DS_Store\n    .env\n    .vscode/\n    .idea/\n    test/\n    venv/\n```\n\n#### Customize the default .gitignore\n\n```yaml\ndefault_gitignore_content: |\n  .DS_Store\n  .env\n  .vscode/\n  .idea/\n  test/\n  foo/\n```\n\n## Roadmap\n\n- Improve customization\n- Add more programming languages\n- Add more IDE\n- Improve user output and experience\n- Publish this project to package managers\n\n## Contributing\n\nIf you would like to contribute to this project just create a pull request which I will try to review as soon as\npossible.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A command-line tool to create new projects",
    "version": "1.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/utox39/new-project-cli/issues",
        "Homepage": "https://github.com/utox39/new-project-cli",
        "Repository": "https://github.com/utox39/new-project-cli"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "14f8dc85d6e6fb292023df17c139402c8972f9c6e19b365cd0fa0095385a92c3",
                "md5": "a7b2366a569953b874a5d16ea488d088",
                "sha256": "db96977ac8c73d21cf2e2832fd7b05d766cd4e0a3bef885c0c9000e8f8c1e017"
            },
            "downloads": -1,
            "filename": "newproject_cli-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a7b2366a569953b874a5d16ea488d088",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 13649,
            "upload_time": "2024-01-19T19:19:26",
            "upload_time_iso_8601": "2024-01-19T19:19:26.638151Z",
            "url": "https://files.pythonhosted.org/packages/14/f8/dc85d6e6fb292023df17c139402c8972f9c6e19b365cd0fa0095385a92c3/newproject_cli-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25cc32868cf94342cd401302e9820c443e63f202c3418bf66ab1a5812138faff",
                "md5": "c19d6130443d3b2979ae5fd0f072b06d",
                "sha256": "a42e524b20ed7ed1515307328d04f7f966a31b3ff2a9471a5eb42470827dcd9e"
            },
            "downloads": -1,
            "filename": "newproject_cli-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c19d6130443d3b2979ae5fd0f072b06d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 13150,
            "upload_time": "2024-01-19T19:19:31",
            "upload_time_iso_8601": "2024-01-19T19:19:31.562769Z",
            "url": "https://files.pythonhosted.org/packages/25/cc/32868cf94342cd401302e9820c443e63f202c3418bf66ab1a5812138faff/newproject_cli-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-19 19:19:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "utox39",
    "github_project": "new-project-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "23.1.0"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.7"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "jsonschema",
            "specs": [
                [
                    "==",
                    "4.20.0"
                ]
            ]
        },
        {
            "name": "jsonschema-specifications",
            "specs": [
                [
                    "==",
                    "2023.11.2"
                ]
            ]
        },
        {
            "name": "markdown-it-py",
            "specs": [
                [
                    "==",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "mdurl",
            "specs": [
                [
                    "==",
                    "0.1.2"
                ]
            ]
        },
        {
            "name": "mypy-extensions",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "23.2"
                ]
            ]
        },
        {
            "name": "pathspec",
            "specs": [
                [
                    "==",
                    "0.12.1"
                ]
            ]
        },
        {
            "name": "platformdirs",
            "specs": [
                [
                    "==",
                    "4.1.0"
                ]
            ]
        },
        {
            "name": "Pygments",
            "specs": [
                [
                    "==",
                    "2.17.2"
                ]
            ]
        },
        {
            "name": "PyYAML",
            "specs": [
                [
                    "==",
                    "6.0.1"
                ]
            ]
        },
        {
            "name": "referencing",
            "specs": [
                [
                    "==",
                    "0.32.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    "==",
                    "13.7.0"
                ]
            ]
        },
        {
            "name": "rpds-py",
            "specs": [
                [
                    "==",
                    "0.15.2"
                ]
            ]
        },
        {
            "name": "shellingham",
            "specs": [
                [
                    "==",
                    "1.5.4"
                ]
            ]
        },
        {
            "name": "tomli",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "typer",
            "specs": [
                [
                    "==",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "typing_extensions",
            "specs": [
                [
                    "==",
                    "4.9.0"
                ]
            ]
        }
    ],
    "lcname": "newproject-cli"
}
        
Elapsed time: 0.18329s