<commit_before>## Collmex API PHP SDK

[![Build Status](https://travis-ci.org/mjaschen/collmex.png?branch=master)](https://travis-ci.org/mjaschen/collmex) [![Latest Stable Version](https://poser.pugx.org/mjaschen/collmex/v/stable.png)](https://packagist.org/packages/mjaschen/collmex)

This library provides a wrapper for the Collmex API. It's not complete yet, some record types (and maybe
some features) are missing.

Please create a Pull Request if you've implemented a new type/feature or create Issues for bugs/feature requests.

There is (or least should be…) a *Type* class for every Collmex record type ("Satzart"). Currently only the
base types (`MESSAGE`, `LOGIN`, `NEW_OBJECT_ID`) and a few normal record types (`CMXKND`, `CMXINV`, `CMXABO`, `CMXUMS`)
are implemented.

### Installation

Add the dependency to your `composer.json`:

```javascript
{
    "require" : {
        "mjaschen/collmex" : "~0.2.0"
    }
}
```

### Usage/Examples

#### Request information from Collmex API

Load a Collmex *Customer* record:

```php
<?php

use \MarcusJaschen\Collmex\Client\Curl as CurlClient;
use \MarcusJaschen\Collmex\Request;
use \MarcusJaschen\Collmex\Type\CustomerGet;

// initialize HTTP client
$collmexClient = new CurlClient("USER", "PASSWORD", "CUSTOMER_ID");

// create request object
$collmexRequest = new Request($collmexClient);

// create a record type; we're querying the API for customer with ID=12345<commit_msg>README updated<commit_after>## Collmex API PHP SDK

[![Build Status](https://travis-ci.org/mjaschen/collmex.png?branch=master)](https://travis-ci.org/mjaschen/collmex) [![Latest Stable Version](https://poser.pugx.org/mjaschen/collmex/v/stable.png)](https://packagist.org/packages/mjaschen/collmex)

This library provides a wrapper for the Collmex API. It's not complete yet, some record types (and maybe
some features) are missing.

Please create a Pull Request if you've implemented a new type/feature or create Issues for bugs/feature requests.

There is (or least should be…) a *Type* class for every Collmex record type ("Satzart"). Currently only the
base types (`MESSAGE`, `LOGIN`, `NEW_OBJECT_ID`) and a few normal record types (`CMXKND`, `CMXINV`, `CMXABO`, `CMXUMS`)
are implemented.

### Installation

Using Composer, just add it to your `composer.json` by running (preferred method):

```
composer require mjaschen/collmex
```

Or add it manually to your `composer.json` (legacy method):

```javascript
{
    "require" : {
        "mjaschen/collmex" : "~0.2.0"
    }
}
```

### Usage/Examples

#### Request information from Collmex API

Load a Collmex *Customer* record:

```php
<?php

use \MarcusJaschen\Collmex\Client\Curl as CurlClient;
use \MarcusJaschen\Collmex\Request;
use \MarcusJaschen\Collmex\Type\CustomerGet;

// initialize HTTP client
$collmexClient = new CurlClient("USER", "PASSWORD", "CUSTOMER_ID");

// create request object
$collmexRequest = new Request($collmexClient);

// create a record type; we're querying the API for customer with ID=12345
{'fraction_non_alphanumeric': 0.13040585495675316, 'fraction_numerical': 0.0053226879574184965, 'mean_word_length': 4.8501945525291825, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 8, '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': '157886', 'n_tokens_mistral': 1042, 'n_tokens_neox': 999, 'n_words': 302}