File: install.md

package info (click to toggle)
python-ntc-templates 3.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 17,104 kB
  • sloc: python: 735; makefile: 14; sh: 2
file content (35 lines) | stat: -rw-r--r-- 924 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Installation

> As of v2.0.0, this project uses [Poetry](https://python-poetry.org/) for packaging and distribution. In order to use poetry, the `templates` directory has been moved to `ntc_templates/templates`

Option 1: Install from PyPI.

```bash
$ pip install ntc-templates
```

Option 2: Install from a GitHub branch, such as develop as shown below.

```bash
$ pip install git+https://github.com/networktocode/ntc-templates.git@develop
```

# Define Custom Templates Directory

To use a custom templates directory set the environmental variable `NTC_TEMPLATES_DIR`.

**Requirements**

1. `index` file needs to be defined with standard structure.
2. Each custom template should be defined.

To manaully set variable:
```shell
export NTC_TEMPLATES_DIR=/path/to/new/location/templates
```

To set within your program:
```python
import os
os.environ["NTC_TEMPLATES_DIR"] = "/path/to/new/templates/location/templates"
```