https://github.com/pomettini/mbti
🦀 A library to work with Myer-Briggs personality types
https://github.com/pomettini/mbti
mbti mbti-personality rust rust-lang rust-library
Last synced: about 1 month ago
JSON representation
🦀 A library to work with Myer-Briggs personality types
- Host: GitHub
- URL: https://github.com/pomettini/mbti
- Owner: pomettini
- License: mit
- Created: 2019-05-28T08:31:03.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-29T13:29:08.000Z (almost 6 years ago)
- Last Synced: 2025-04-10T01:06:15.918Z (about 1 month ago)
- Topics: mbti, mbti-personality, rust, rust-lang, rust-library
- Language: Rust
- Homepage:
- Size: 25.4 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mbti
A library to work with Myer-Briggs personality types
[](https://travis-ci.org/Pomettini/mbti)
[](https://ci.appveyor.com/project/Pomettini/mbti)
[](https://coveralls.io/github/Pomettini/mbti?branch=master)
[](https://opensource.org/licenses/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](https://www.teamtechnology.co.uk/tt/t-articl/mb-simpl.htm)
## Usage
Add this to your `Cargo.toml`
```toml
[dependencies]
mbti = ">=0.1.3"
```## Examples
Get a function from a MBTI type:
```rust
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:
```rust
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:
```rust
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:
```rust
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:
```rust
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.