<commit_before>defmodule Doex do

  @moduledoc"""

  An elixir implementation of the
  [DigitalOcean API v2](https://developers.digitalocean.com/documentation/v2/). From
  their documentation:

      The DigitalOcean API allows you to manage Droplets and resources within
      the DigitalOcean cloud in a simple, programmatic way using conventional
      HTTP requests. The endpoints are intuitive and powerful, allowing you to
      easily make calls to retrieve information or to execute actions.

      All of the functionality that you are familiar with in the DigitalOcean
      control panel is also available through the API, allowing you to script
      the complex actions that your situation requires.

      The API documentation will start with a general overview about the design
      and technology that has been implemented, followed by reference information
      about specific endpoints.

  This Elixir DigitalOcean (DO) API gives you access to the API through three means:

  * A command line escript tool called `doex`
  * A set of mix tasks `mix doex.*`, or
  * Directly from Elixir code using `Doex` module

  Each one of the mechanism above allow you to automate your infrastructure needs,
  it more comes down to preference and environment.


  ## Installation

  ### Command Line (Latest Version)

  To install the `doex` command line tool (whose only dependency is Erlang), then
  you can [install it using escript](https://hexdocs.pm/mix/master/Mix.Tasks.Escript.Install.html).


  ```bash
  # Install from GitHub
  mix escript.install github capbash/doex

  # Install form HEX.pm
  mix escript.install hex doex
  ```

  If you see a warning like

  ```bash
  warning: you must append "~/.mix/escripts" to your PATH
  if you want to invoke escripts by name
  ```

  Then, make sure to update your PATH variable.  Here's how on a Mac OS X, but each
  [environment is slightly different](https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path).

  ```bash
  vi ~/.bash_profile

  # Add a line like the following
  PATH="$HOME/.mix/escripts:$PATH"
  export PATH
  ```

  Start a new terminal session. You will know it's working when you can *find* it using *where*

  ```
  where doex
  ```

  ### Command Line (Other Versions)

  To install a specific version, branch, tag or commit, adjust any one of the following

  ```bash
  # Install from a specific version
  mix escript.install hex doex 1.2.3

  # Install from the latest of a specific branch
  mix escript.install github capbash/doex branch git_branch

  # Install from a specific tag
  mix escript.install github capbash/doex tag git_tag

  # Install from a specific commit
  mix escript.install github capbash/doex ref git_ref
  ```

  Again, checkout [mix escript.install](https://hexdocs.pm/mix/Mix.Tasks.Escript.Install.html) for
  more information about installing global tasks.

  ### Mix Tasks

  If you have an Elixir project that you want to interact with the
  DigitalOcean API, then you install the app by adding a dependency
  to your `mix.exs` file.

  ```elixir
  @deps [
    doex: "~> 0.3.0"
  ]
  ```

  This will give you access to `mix doex.*` tasks (instead of globally installing
  the `doex` escript). You will also have programtic access from your `Doex` module
  as well; so you could expose feature directly within your application as well.

  ## Configure DO Token

  Before you can use the DO API, you will need to configure access to your DigitalOcean
  account.  For this, you will need your [API TOKEN](https://www.digitalocean.com/community/tutorials/how-to-use-the-digitalocean-api-v2#how-to-generate-a-personal-access-token)

  Let's say your token is ABC123, then configure it as follows:

      # using escript
      doex init
      doex config token ABC123

      # using mix tasks
      mix doex.init
      mix doex.config token ABC123

  And to confirm it's set, run

      doex config

  And the output should look similar to:

      ssh_keys: []<commit_msg>Fix documentation about @deps install<commit_after>defmodule Doex do

  @moduledoc"""

  An elixir implementation of the
  [DigitalOcean API v2](https://developers.digitalocean.com/documentation/v2/). From
  their documentation:

      The DigitalOcean API allows you to manage Droplets and resources within
      the DigitalOcean cloud in a simple, programmatic way using conventional
      HTTP requests. The endpoints are intuitive and powerful, allowing you to
      easily make calls to retrieve information or to execute actions.

      All of the functionality that you are familiar with in the DigitalOcean
      control panel is also available through the API, allowing you to script
      the complex actions that your situation requires.

      The API documentation will start with a general overview about the design
      and technology that has been implemented, followed by reference information
      about specific endpoints.

  This Elixir DigitalOcean (DO) API gives you access to the API through three means:

  * A command line escript tool called `doex`
  * A set of mix tasks `mix doex.*`, or
  * Directly from Elixir code using `Doex` module

  Each one of the mechanism above allow you to automate your infrastructure needs,
  it more comes down to preference and environment.


  ## Installation

  ### Command Line (Latest Version)

  To install the `doex` command line tool (whose only dependency is Erlang), then
  you can [install it using escript](https://hexdocs.pm/mix/master/Mix.Tasks.Escript.Install.html).


  ```bash
  # Install from GitHub
  mix escript.install github capbash/doex

  # Install form HEX.pm
  mix escript.install hex doex
  ```

  If you see a warning like

  ```bash
  warning: you must append "~/.mix/escripts" to your PATH
  if you want to invoke escripts by name
  ```

  Then, make sure to update your PATH variable.  Here's how on a Mac OS X, but each
  [environment is slightly different](https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path).

  ```bash
  vi ~/.bash_profile

  # Add a line like the following
  PATH="$HOME/.mix/escripts:$PATH"
  export PATH
  ```

  Start a new terminal session. You will know it's working when you can *find* it using *where*

  ```
  where doex
  ```

  ### Command Line (Other Versions)

  To install a specific version, branch, tag or commit, adjust any one of the following

  ```bash
  # Install from a specific version
  mix escript.install hex doex 1.2.3

  # Install from the latest of a specific branch
  mix escript.install github capbash/doex branch git_branch

  # Install from a specific tag
  mix escript.install github capbash/doex tag git_tag

  # Install from a specific commit
  mix escript.install github capbash/doex ref git_ref
  ```

  Again, checkout [mix escript.install](https://hexdocs.pm/mix/Mix.Tasks.Escript.Install.html) for
  more information about installing global tasks.

  ### Mix Tasks

  If you have an Elixir project that you want to interact with the
  DigitalOcean API, then you install the app by adding a dependency
  to your `mix.exs` file.

  ```elixir
  @deps [
    {:doex, "~> 0.3.0"}
  ]
  ```

  This will give you access to `mix doex.*` tasks (instead of globally installing
  the `doex` escript). You will also have programtic access from your `Doex` module
  as well; so you could expose feature directly within your application as well.

  ## Configure DO Token

  Before you can use the DO API, you will need to configure access to your DigitalOcean
  account.  For this, you will need your [API TOKEN](https://www.digitalocean.com/community/tutorials/how-to-use-the-digitalocean-api-v2#how-to-generate-a-personal-access-token)

  Let's say your token is ABC123, then configure it as follows:

      # using escript
      doex init
      doex config token ABC123

      # using mix tasks
      mix doex.init
      mix doex.config token ABC123

  And to confirm it's set, run

      doex config

  And the output should look similar to:

      ssh_keys: []
{'fraction_non_alphanumeric': 0.06959115198210514, 'fraction_numerical': 0.005716416055672921, 'mean_word_length': 3.3245566899516388, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, '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': '2673065', 'n_tokens_mistral': 2415, 'n_tokens_neox': 2214, 'n_words': 1016}