<commit_before># Top
Elixir wrapper for Top, to demonstrate use of ports.

## Installation
The package can be installed by adding `port_demo` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [{:port_demo, github: "https://github.com/GeoffreyPS/on_ports/tree/master/port_demo}]
end
```

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/port_demo](https://hexdocs.pm/port_demo).
<commit_msg>Add better installation information, basic usage<commit_after># Top
Elixir wrapper for Top, example project for using ports.


## Installation

```sh
## clone the repository
<EMAIL>:GeoffreyPS/on_ports.git

## navigate to the mix project
cd port_demo

## run the REPL
iex -S mix
```


## Usage
The application has two functions: `Top.report/0` and `Top.report/1`. 
The 0 arity version will return a map with the current high-level information reported from Top. The single arity version accepts a key name as a string, and returns the value. 

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/port_demo](https://hexdocs.pm/port_demo).

{'fraction_non_alphanumeric': 0.1143717080511663, 'fraction_numerical': 0.002257336343115124, 'mean_word_length': 4.732758620689655, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 9, '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': '4696880', 'n_tokens_mistral': 426, 'n_tokens_neox': 412, 'n_words': 148}