Skip to main content

Generate new projects from git repositories

Project description

new

Build  PyPI version versions

Generate new projects from git repositories

new is a command to create new projects based on existing git repos. It simply shallow clones a repository to a directory with your specified new project name, and cleans up the git files like they were never there. It also supports 1:1 string replacement.

Installation Options

https://pypi.org/project/new-project/

PyPi

pip install new-project

Usage

You can create new project from any github repository with just the username and project name

The following command will create a new project for you based on this one, if you do not provide a full git url it will default to GitHub:

new myNewProject divanvisagie/new

You can also specify a URL to any git repository that you have access to:

new myNewProject git@gitlab.com:divan/new.git

These examples are just simple clones though, new also lets authors configure a repository so that it will prompt you to replace strings that you may want to rename for your project.

You can give it a try with:

new myNewProject divanvisagie/kotlin-tested-seed

You will see that it prompts you to replace the package name, just pressing enter will skip this and keep the name:

> new myNewProject divanvisagie/kotlin-tested-seed
Creating testbed from https://github.com/divanvisagie/kotlin-tested-seed.git 
Enumerating objects: 14, done.
Counting objects: 100% (14/14), done.
Compressing objects: 100% (9/9), done.
Total 14 (delta 0), reused 10 (delta 0), pack-reused 0

Enter replacement text for com.divanvisagie.example

    text       : com.divanvisagie.example
    description: The package name

> com.divanvisagie.mynewproject

The reason we see this is because the kotlin-tested-seed repository contains a .new.yml file at its root:

replace:
  strings:
    - match: com.divanvisagie.example
      description: The package name

You can configure as many match strings as you want in your own seed projects.

Development

Set up the python environment with:

python -m venv env

Install dependencies

pip install -r requirements.txt

Tests are run with pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

new-project-0.5.5.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

new_project-0.5.5-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file new-project-0.5.5.tar.gz.

File metadata

  • Download URL: new-project-0.5.5.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for new-project-0.5.5.tar.gz
Algorithm Hash digest
SHA256 83a7423738031db18d5725e81f0d11ce54f8eb5b2155dc343461659c31c47f7a
MD5 2ab74824395d7bcf51555270148cce30
BLAKE2b-256 4acc88efc56ddc755d481162aad4dc923bd2deff271deb1bfb4232781922d3f5

See more details on using hashes here.

File details

Details for the file new_project-0.5.5-py3-none-any.whl.

File metadata

  • Download URL: new_project-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for new_project-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 212c08d2e4dda3e11320bb78a827cae2003be17ca68f7c791e5c2c0fa44da31a
MD5 d87eec7c48c08b1c786b3fcbbd522971
BLAKE2b-256 e96e3110ad1eeff6bd8f005688e79636a6da437c018e956f4142666b9b7419fc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page