<commit_before># PackStream implementation in Swift

PackStream is a binary message format very similar to [MessagePack](http://msgpack.org). It can be used stand-alone, but it has been built as a message format for use in the Bolt protocol to communicate between the Neo4j server and its clients.

This implementation is written in Swift, primarily as a dependency for the Swift Bolt implementation. That implementation will in turn provide [Theo](https://github.com/graphstory/neo4j-ios), the [Neo4j](https://neo4j.com) Swift driver, with Bolt support.

## Usage
Through PackStream you can encode Bool, Int, Float (Double in Swift lingo), String, List, Map and Structure. They all implement the `PackProtocol`, so if you want to have a collection of packable items, you can specify them as implementing PackProtocol. 

### Example

```swift
let map = Map(dictionary: [
    "alpha": 42,<commit_msg>Remember import<commit_after># PackStream implementation in Swift

PackStream is a binary message format very similar to [MessagePack](http://msgpack.org). It can be used stand-alone, but it has been built as a message format for use in the Bolt protocol to communicate between the Neo4j server and its clients.

This implementation is written in Swift, primarily as a dependency for the Swift Bolt implementation. That implementation will in turn provide [Theo](https://github.com/graphstory/neo4j-ios), the [Neo4j](https://neo4j.com) Swift driver, with Bolt support.

## Usage
Through PackStream you can encode Bool, Int, Float (Double in Swift lingo), String, List, Map and Structure. They all implement the `PackProtocol`, so if you want to have a collection of packable items, you can specify them as implementing PackProtocol. 

### Example
First, remember to
```swift
import PackStream
```

Then you can use it, like for instance so:

```swift
let map = Map(dictionary: [
    "alpha": 42,
{'fraction_non_alphanumeric': 0.07761351636747624, 'fraction_numerical': 0.006335797254487857, 'mean_word_length': 4.8307692307692305, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '7332049', 'n_tokens_mistral': 517, 'n_tokens_neox': 480, 'n_words': 257}