Skip to main content

noo

Easily create new projects.

Lint

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[OpType] The operation to perform
var str The variable to compare, i.e. noo:year
value str The value to compare to

OpType

List of operation types:

Name Operation
eq Equals
ne Not Equals
gt Greater Than
lt Less Than
ge Greater Than or Equals
le Less Than or Equals

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

Metadata

Release files for pynoo 1.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynoo 1.4.4
File Size Uploaded
pynoo-1.4.4.tar.gz 12.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pynoo 1.4.4
File Interpreter ABI Platform
pynoo-1.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 29.4 kB

Release files / pynoo-1.4.4.tar.gz

Download URL pynoo-1.4.4.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bc007c84c75f67ec3aad7b26cb3aec43334d87407601d3f7989b925d958f84b1
BLAKE2b-256 checksum
How to use checksums
6bc9a2dd9795122230a1574f431f88f0366fbcde5c5348869efcb4ac9c0fb8de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.2 Linux/5.16.9-arch1-1

Release files / pynoo-1.4.4-py3-none-any.whl

Download URL pynoo-1.4.4-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f52ff2d4b48f8fc08dc1757a5f29dcb8b0bd17199b938d69f8a215fe3f9067b
BLAKE2b-256 checksum
How to use checksums
7df1855afd78ec285d8c554db1f047ec35db160bab6577c2b96dadbaef896475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.2 Linux/5.16.9-arch1-1

Release history Release notifications | RSS feed

This release

1.4.4 This release

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page