Skip to main content

Easily create new projects.

Project description

noo

Easily create new projects.

Installation

pip install pynoo

or install from github

pip install git+https://github.com/py-noo/noo

Contributing

See contributing.

Usage

noo clone <name> <ref>

Noofile Specification

name: str
remote: str
read: [Read]
steps: [Step]
Field Type Description
name str The name of the noofile definition
remote str The remote location of the template
read list[Read] The list of variables to read on setup
steps list[Step] The list of steps to run

Read

name: str
prompt: str
default: ?str
Field Type Description
name str The name of the variable to read
prompt str The prompt to display when reading the variable
default ?str An optional default value

Step

A step defines a single step in the process of setting up a project.

name: str
actions: [Action]
conditions: ?[Condition]
Field Type Description
name str The name of the setup step
actions list[Action] The list of actions in the step
conditions ?list[Condition] An optional list of conditions required for the step to run

Condition

A condition is a function that must be true for a step to run.

op: eq | ne | gt | lt | ge | le
var: str
value: str
Field Type Description
op Literal[eq ne
var str The variable to compare, i.e. noo:year
value str The value to compare to

Action

An action defined a single action within a step. This is the base of all steps, for example replacing a string with a different given string.

Replace action

Replace actions are used to replace a specific string in a file. The src field specifies the string that should be replaced in the file, and the dest field specifices the string to replace it with. The dest field is formatted with defined variables.

A list of files can be provided, and each file will have the same transform applied to them.

- action: replace
  files: [str]
  src: str
  dest: str

Delete action

Delete actions are used to delete files.

- action: delete
  files: [str]

Create action

Create actions are used to create files. The file field specifies the file to be created, and the content field specifics the content to be placed into the file. The content field is formatted with defined variables.

- action: create
  file: str
  content: ?str

Rename action

Rename actions are used to rename files. The file field specifies the file to be renamed, and the dest field specifies the new name of the file. The dest field is formatted with defined variables.

- action: rename
  file: str
  dest: str

Variables

Variables are defined in the read section of the noofile. All variables set in the read section will be available in the steps section.

Variables are used in the format $${scope}:{name}, for example $$noo:year or $$var:author. Variables with the noo scope are built into noo and will always be available. Variables with the var scope are defined in the read section.

The variables defined by noo are:

  • noo:year - The current year
  • noo:month - The current month
  • noo:day - The current day
  • noo:hour - The current hour
  • noo:minute - The current minute
  • noo:second - The current second
  • noo:name - The name of the project

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

pynoo-1.2.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

pynoo-1.2.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pynoo-1.2.0.tar.gz.

File metadata

  • Download URL: pynoo-1.2.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.16.9-arch1-1

File hashes

Hashes for pynoo-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f86b475b64c052eb0a9ba21f2e68d94ca4aacf3707b03bd59b15a80ce319a424
MD5 24b55c550be6bd150f53783623c70018
BLAKE2b-256 a4a99d853d235a27f39ddea0abdceaf1d410c55d4c32d3a511e1f81e76f5e72e

See more details on using hashes here.

File details

Details for the file pynoo-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pynoo-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.16.9-arch1-1

File hashes

Hashes for pynoo-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d1716c6fc94f29821511f9d9a693a370008b193479d4151f4b37f24d3b3c3e6
MD5 ea3e9198400f703353e8b0f2312cbf79
BLAKE2b-256 5048d39ddf2c37abb7b056657fb4ddabd0858454afad1a4993e63b396d14683e

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