<commit_before># Snap layer

The Snap layer for Juju enables layered charms to more easily deal with
snap packages in a simple and efficient manner. It provides consistent
configuration for users, allowing them the choice of pulling snaps
from the main snap store, or uploading them as Juju resources for deploys
in environments with limited network access.

## Configuration

To have the Snap layer install snaps automatically, declare the snaps in
layer.yaml:

    ```yaml
    includes:
      - layer:basic
      - layer:snap
    options:
      snap:
        telegraf:
          channel: stable
          devmode: false
          jailmode: false
          force_dangerous: false
          revision: null
    ```

In addition, you should declare Juju resource slots for the snaps. This
allows operators to have snaps distributed from their Juju controller
node rather than the snap store, and is necessary for when your charm
is deployed in network restricted environments.

    ```yaml
    resources:
      telegraf:
        type: file
        filename: telegraf.snap
        description: Telegraf snap
    ```

With the Juju resource defined, the operator may deploy your charm
using locally provided snaps instead of the snap store:

    ```sh
    juju deploy --resource telegraf=telegraf_0_19.snap cs:telegraf
    ```

If your charm needs to control installation, update and removal of
snaps itself then do not declare the snaps in layer.yaml. Instead, use
the API provided by the `charms.layer.snap` Python package.
            

## Usage

If you have defined your snaps in layer.yaml for automatic installation<commit_msg>Fix README.md formatting<commit_after># Snap layer

The Snap layer for Juju enables layered charms to more easily deal with
snap packages in a simple and efficient manner. It provides consistent
configuration for users, allowing them the choice of pulling snaps
from the main snap store, or uploading them as Juju resources for deploys
in environments with limited network access.

## Configuration

To have the Snap layer install snaps automatically, declare the snaps in
layer.yaml:

```yaml
includes:
    - layer:basic
    - layer:snap
options:
    snap:
    telegraf:
        channel: stable
        devmode: false
        jailmode: false
        force_dangerous: false
        revision: null
```

In addition, you should declare Juju resource slots for the snaps. This
allows operators to have snaps distributed from their Juju controller
node rather than the snap store, and is necessary for when your charm
is deployed in network restricted environments.

```yaml
resources:
    telegraf:
    type: file
    filename: telegraf.snap
    description: Telegraf snap
```

With the Juju resource defined, the operator may deploy your charm
using locally provided snaps instead of the snap store:

```sh
juju deploy --resource telegraf=telegraf_0_19.snap cs:telegraf
```

If your charm needs to control installation, update and removal of
snaps itself then do not declare the snaps in layer.yaml. Instead, use
the API provided by the `charms.layer.snap` Python package.
            

## Usage

If you have defined your snaps in layer.yaml for automatic installation
{'fraction_non_alphanumeric': 0.046009389671361506, 'fraction_numerical': 0.0018779342723004694, 'mean_word_length': 3.378082191780822, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2027804', 'n_tokens_mistral': 832, 'n_tokens_neox': 778, 'n_words': 415}