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[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 yearnoo:month
- The current monthnoo:day
- The current daynoo:hour
- The current hournoo:minute
- The current minutenoo:second
- The current secondnoo:name
- The name of the project
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pynoo-1.4.1.tar.gz
.
File metadata
- Download URL: pynoo-1.4.1.tar.gz
- Upload date:
- Size: 12.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec048c61ccffe3683c92fbced599d9c8cc28f9cd888f8f181ce1cf0bff7e7055 |
|
MD5 | 4b1a5d9341ffed29901853a4f0d314eb |
|
BLAKE2b-256 | 2f1fc11df37fb0a8e526ec82fada6f41663878800daa56b5b446fce9c169c3d5 |
File details
Details for the file pynoo-1.4.1-py3-none-any.whl
.
File metadata
- Download URL: pynoo-1.4.1-py3-none-any.whl
- Upload date:
- Size: 16.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba3a83be0493581445107a798b2bf4c0f4be4db85b075edd0afe9ab93117aede |
|
MD5 | a0143af15ee0d3f344963fcbc7dbc1d4 |
|
BLAKE2b-256 | 23d14bf6bb9d7134a9224196049dbf4951d2585f2bf33ce0e3aed76ad1ac7b77 |