<commit_before>RubySwift
=========

A ruby wrapper of the [Swift Digital Suite Mail House API](https://suite.swiftdigital.com.au).

This is currently a relatively crude wrapper and does not tidy responses from Swift a lot.

INSTALLATION
------------
  You can install the library via Rubygems:

    $ gem install ruby-swift

  Or within your Gemfile if you're using Bundler:

    gem "ruby-swift"

USAGE
-----
  Initialize the connection:

```ruby
swift = RubySwift.new("API_PASSWORD")
```

  Does a person exist?

```ruby
swift.person_exists?("<EMAIL>") # -> true
```

  Read a person:

```ruby
person = swift.read_person("<EMAIL>")
```

  Add someone to a mail group:

```ruby
swift.add_group_member("<EMAIL>", "Group Name") # -> "0"
```

  Remove someone from a mail group:

```ruby
swift.remove_group_member("<EMAIL>", "Group Name") # -> "0"
```

  Create a person:

```ruby
swift.write_person(email: "<EMAIL>", first_name: "Dennis", last_name: "Ritchie") # -> "0"
```

  Update person:

```ruby
swift.update_person(email: "<EMAIL>", first_name: "Donald", last_name: "Knuth") # -> "0"
```

  Create or update existing person:

```ruby
swift.write_or_update_person(email: "<EMAIL>", first_name: "Dennis", last_name: "Ritchie") # -> "0"
```

  Create a group:

```ruby
swift.write_group("Group name") # -> "0"
```

  Read all groups:

```ruby
groups = swift.read_groups
```

  Read all members of a group:

```ruby
people = swift.read_persons("Group Name")
```

  Remove a group:

```ruby
swift.remove_group("Group Name") # -> "0"
```

  Remove a person:

```ruby
swift.remove_person("<EMAIL>") # -> "0"
```

TODO
----
  * Tidy up responses (Hashie?)
  * Return true/false instead of "0" for write actions
<commit_msg>Fixed URL in README<commit_after>RubySwift
=========

A ruby wrapper of the [Swift Digital Suite Mail House API](https://suite.swiftdigital.com.au/login).

This is currently a relatively crude wrapper and does not tidy responses from Swift a lot.

INSTALLATION
------------
  You can install the library via Rubygems:

    $ gem install ruby-swift

  Or within your Gemfile if you're using Bundler:

    gem "ruby-swift"

USAGE
-----
  Initialize the connection:

```ruby
swift = RubySwift.new("API_PASSWORD")
```

  Does a person exist?

```ruby
swift.person_exists?("<EMAIL>") # -> true
```

  Read a person:

```ruby
person = swift.read_person("<EMAIL>")
```

  Add someone to a mail group:

```ruby
swift.add_group_member("<EMAIL>", "Group Name") # -> "0"
```

  Remove someone from a mail group:

```ruby
swift.remove_group_member("<EMAIL>", "Group Name") # -> "0"
```

  Create a person:

```ruby
swift.write_person(email: "<EMAIL>", first_name: "Dennis", last_name: "Ritchie") # -> "0"
```

  Update person:

```ruby
swift.update_person(email: "<EMAIL>", first_name: "Donald", last_name: "Knuth") # -> "0"
```

  Create or update existing person:

```ruby
swift.write_or_update_person(email: "<EMAIL>", first_name: "Dennis", last_name: "Ritchie") # -> "0"
```

  Create a group:

```ruby
swift.write_group("Group name") # -> "0"
```

  Read all groups:

```ruby
groups = swift.read_groups
```

  Read all members of a group:

```ruby
people = swift.read_persons("Group Name")
```

  Remove a group:

```ruby
swift.remove_group("Group Name") # -> "0"
```

  Remove a person:

```ruby
swift.remove_person("<EMAIL>") # -> "0"
```

TODO
----
  * Tidy up responses (Hashie?)
  * Return true/false instead of "0" for write actions

{'fraction_non_alphanumeric': 0.17989571263035922, 'fraction_numerical': 0.005214368482039398, 'mean_word_length': 3.982683982683983, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 37, 'https://': 2, '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': '3642902', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1144, 'n_words': 351}