mbti

Crates.iombti
lib.rsmbti
version0.1.3
sourcesrc
created_at2019-05-28 20:28:13.222835
updated_at2019-05-29 11:05:40.503425
descriptionA library to work with Myer-Briggs personality types
homepage
repositoryhttps://github.com/Pomettini/mbti
max_upload_size
id137564
size34,730
Giorgio Pomettini (pomettini)

documentation

README

mbti

A library to work with Myer-Briggs personality types

Build Status Build status Coverage Status License: MIT

Myers-Briggs theory is an adaptation of the theory of psychological types produced by Carl Gustav Jung. It is based on 16 personality types, which Jung viewed as stereotypes. They act as useful reference points to understand your unique personality. At the heart of Myers Briggs theory are four preferences. Do you prefer to deal with:

  • People and things (Extraversion or E), or ideas and information (Introversion or I).
  • Facts and reality (Sensing or S), or possibilities and potential (Intuition or N).
  • Logic and truth (Thinking or T), or values and relationships (Feeling or F).
  • A lifestyle that is well-structured (Judgment or J), or one that goes with the flow (Perception or P).

Credits: Team Technology

Usage

Add this to your Cargo.toml

[dependencies]
mbti = ">=0.1.3"

Examples

Get a function from a MBTI type:

extern crate mbti;

use mbti::{get_function, Function, Role, Type};

fn main() {
    let primary = get_function(Type::INTP, Role::Primary);
    assert_eq!(primary, Function::Ti);
}

Get all the functions from a MBTI type:

extern crate mbti;

use mbti::{get_functions_from_type, Function, Type};

fn main() {
    let functions = get_functions_from_type(Type::INTP);
    assert_eq!(
        functions,
        vec![Function::Ti, Function::Ne, Function::Si, Function::Fe]
    );
}

Get all the MBTI types from a function role:

extern crate mbti;

use mbti::{get_types_from_function_role, Function, Role, Type};
use std::collections::HashSet;
#[macro_use]
extern crate maplit;

fn main() {
    let types = get_types_from_function_role(Function::Fe, Role::Primary);
    assert_eq!(types, hashset![Type::ESFJ, Type::ENFJ]);
}

Get a MBTI types from a set of functions:

extern crate mbti;

use mbti::{get_type_from_functions, Function, Type};

fn main() {
    let functions =
        get_type_from_functions(&[Function::Ti, Function::Ne, Function::Si, Function::Fe]);
    assert_eq!(functions, Some(Type::INTP));
}

Get compatibility between two MBTI types:

extern crate mbti;

use mbti::{check_compatibility, Compatibility, Type};

fn main() {
    let compatibility = check_compatibility(Type::INTP, Type::INFP);
    assert_eq!(compatibility, Compatibility::Positive);
}

License

The MIT License (MIT)

Copyright © 2019 Giorgio Pomettini

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Commit count: 23

cargo fmt