<commit_before># Philosophical Monkey
I am a reflection helper that helps you reflect on the code around you.

> An important feature of this library is it abstracts the differences between the full .NET Framework and the new .NET Core reflection API.

# Basic Usage

## Install from nuget
> `Install-Package PhilosophicalMonkey -Pre`

The Philosophical Monkey has dozens of nugets of wisdom but here are a few examples of how he can help.
### Getting all types from a namespace
    var assembly = typeof(TestModel).GetTypeInfo().Assembly;
    var types = Reflect.OnTypes.GetTypesFromNamespace(assembly, "TestModels");
    
    Assert.Contains(types, t => t == typeof(TestModel));
    
### Get a null safe property value
    var obj = new TestModel
    {
        Id = 1,
        MyString = null
    };
    var result = Reflect.OnProperties.NullSafeGetValue<TestModel, object>(obj, x => x.MyString, "Default");

    Assert.Equal("Default", result);

### Mapping a dynamic to a dictionary
    dynamic d = new { Nr = 1, Name = "Devon" };
    var dictionary = Reflect.OnMappings.TurnObjectIntoDictionary(d);

    Assert.Equal(2, dictionary.Keys.Count);
    
Or fill object properties:

    dynamic d = new { StreetNr = 1, Street = "Main Rd" };<commit_msg>readme change<commit_after># Philosophical Monkey
I am a reflection helper that helps you reflect on the code around you.

> An important feature of this library is it abstracts the differences between the full .NET Framework and the new .NET Core reflection API.

## Install from nuget
> `Install-Package PhilosophicalMonkey -Pre`

# Basic Usage

The Philosophical Monkey has dozens of nugets of wisdom but here are a few examples of how he can help.
### Getting all types from a namespace
    var assembly = typeof(TestModel).GetTypeInfo().Assembly;
    var types = Reflect.OnTypes.GetTypesFromNamespace(assembly, "TestModels");
    
    Assert.Contains(types, t => t == typeof(TestModel));
    
### Get a null safe property value
    var obj = new TestModel
    {
        Id = 1,
        MyString = null
    };
    var result = Reflect.OnProperties.NullSafeGetValue<TestModel, object>(obj, x => x.MyString, "Default");

    Assert.Equal("Default", result);

### Mapping a dynamic to a dictionary
    dynamic d = new { Nr = 1, Name = "Devon" };
    var dictionary = Reflect.OnMappings.TurnObjectIntoDictionary(d);

    Assert.Equal(2, dictionary.Keys.Count);
    
Or fill object properties:

    dynamic d = new { StreetNr = 1, Street = "Main Rd" };
{'fraction_non_alphanumeric': 0.09352517985611511, 'fraction_numerical': 0.0031974420463629096, 'mean_word_length': 3.550909090909091, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, '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': '1285173', 'n_tokens_mistral': 705, 'n_tokens_neox': 690, 'n_words': 277}