# adiumentum


With Nix installed, you can enter a development environment with all dependencies installed:

```sh
nix develop
```

## Roadmap

- [ ] add the following dummies:

```py
from collections.abc import Callable
from random import choice, choices, randint, random
from string import ascii_letters, ascii_lowercase, ascii_uppercase
from typing import Literal

import deal


class DummiesBase:
    @classmethod
    @deal.has("random")
    def pascalcase(
        cls,
        subwords: int | None = None,
        max_length: int | None = None,
        sub_length_min: int = 3,
        sub_length_max: int = 6,
    ) -> str:
        if not max_length:
            max_length = randint(5, 12)
        if not subwords:
            subwords = int(max_length / sub_length_min) + 1
        return "".join(
            cls.titlecase(randint(sub_length_min, sub_length_max)) for _ in range(subwords)
        )[:max_length]

    @classmethod
    @deal.has("random")
    def camelcase(
        cls,
        subwords: int | None = None,
        max_length: int | None = None,
        sub_length_min: int = 3,
        sub_length_max: int = 6,
    ) -> str:
        if not max_length:
            max_length = randint(5, 12)
        if not subwords:
            subwords = int(max_length / sub_length_min) + 1
        return "".join(
            (
                cls.lowercase(randint(sub_length_min, sub_length_max)),
                *(cls.titlecase(randint(sub_length_min, sub_length_max)) for _ in range(subwords)),
            )
        )[:max_length]

    @classmethod
    @deal.has("random")
    def snakecase(
        cls,
        subwords: int | None = None,
        max_length: int | None = None,
        sub_length_min: int = 3,
        sub_length_max: int = 6,
    ) -> str:
        if not max_length:
            max_length = randint(5, 12)
        if not subwords:
            subwords = int(max_length / sub_length_min) + 1
        return "_".join(
            cls.lowercase(randint(sub_length_min, sub_length_max)) for _ in range(subwords)
        )[:max_length]

    @classmethod
    @deal.has("random")
    def kebabcase(
        cls,
        subwords: int | None = None,
        max_length: int | None = None,
        sub_length_min: int = 3,
        sub_length_max: int = 6,
    ) -> str:
        if not max_length:
            max_length = randint(5, 12)
        if not subwords:
            subwords = int(max_length / sub_length_min) + 1
        return "-".join(
            cls.lowercase(randint(sub_length_min, sub_length_max)) for _ in range(subwords)
        )[:max_length]

    @classmethod
    @deal.has("random")
    def string_tuple(
        cls,
        string_type: Literal["any", "lower", "upper", "camel", "pascal"] = "any",
        length: int | None = None,
        string_length: int | None = None,
    ) -> tuple[str, ...]:
        stringmaker: Callable[[int | None], str]
        stringmakers: dict[str, Callable[[int | None], str]] = {
            "any": cls.string,
            "lower": cls.lowercase,
            "upper": cls.uppercase,
            "camel": cls.camelcase,
            "pascal": cls.pascalcase,
            "snake": cls.snakecase,
            "kebab": cls.kebabcase,
        }
        stringmaker = stringmakers[string_type]

        if not length:
            length = randint(2, 9)
        return tuple(stringmaker(string_length) for i in range(length))

    @classmethod
    @deal.has("random")
    def text(cls, num_words: int = 10, min_word_length: int = 3, max_word_length: int = 10) -> str:
        return " ".join(
            cls.string(length=randint(min_word_length, max_word_length)) for _ in range(num_words)
        )

    @staticmethod
    @deal.has("random")
    def string(length: int | None = None) -> str:
        if not length:
            length = randint(2, 9)
        return "".join(choices(ascii_letters, k=length))

    @staticmethod
    @deal.has("random")
    def lowercase(length: int | None = None) -> str:
        if not length:
            length = randint(2, 9)
        return "".join(choices(ascii_lowercase, k=length))

    @staticmethod
    @deal.has("random")
    def titlecase(length: int | None = None) -> str:
        if not length:
            length = randint(2, 9)
        return choice(ascii_uppercase) + "".join(choices(ascii_lowercase, k=length - 1))

    @staticmethod
    @deal.has("random")
    def uppercase(length: int | None = None) -> str:
        if not length:
            length = randint(2, 9)
        return "".join(choices(ascii_uppercase, k=length))

    @staticmethod
    @deal.has("random")
    def int_tuple(
        size: int | None = None,
        min_val: int = 0,
        max_val: int = 20,
    ) -> tuple[int, ...]:
        if size is None:
            size = randint(2, 10)
        return tuple(randint(min_val, max_val) for _ in range(size))

    @staticmethod
    @deal.has("random")
    def randfloat(lower: float = 0.0, upper: float = 1.0) -> float:
        return lower + random() * (upper - lower)


if __name__ == "__main__":
    print(".string():       ", DummiesBase.string())
    print(".lowercase():    ", DummiesBase.lowercase())
    print(".titlecase():    ", DummiesBase.titlecase())
    print(".uppercase():    ", DummiesBase.uppercase())
    print(".pascalcase():   ", DummiesBase.pascalcase())
    print(".camelcase():    ", DummiesBase.camelcase())
    print(".snakecase():    ", DummiesBase.snakecase())
    print(".kebabcase():    ", DummiesBase.kebabcase())
    print(".string_tuple():  ", DummiesBase.string_tuple())
    print(".int_tuple():    ", DummiesBase.int_tuple())
    print(".randfloat():    ", DummiesBase.randfloat())
    print()
    print(".string():       ", DummiesBase.string())
    print(".lowercase():    ", DummiesBase.lowercase())
    print(".titlecase():    ", DummiesBase.titlecase())
    print(".uppercase():    ", DummiesBase.uppercase())
    print(".pascalcase():   ", DummiesBase.pascalcase())
    print(".camelcase():    ", DummiesBase.camelcase())
    print(".snakecase():    ", DummiesBase.snakecase())
    print(".kebabcase():    ", DummiesBase.kebabcase())
    print(".string_tuple():  ", DummiesBase.string_tuple("pascal"))
    print(".int_tuple():    ", DummiesBase.int_tuple(size=20, min_val=50, max_val=60))
    print(".randfloat():    ", DummiesBase.randfloat(6.0, 7.0))
```


add transfer_case

```py
def transfer_case(reference: str, candidate: str) -> str:
    if reference.istitle():
        return candidate.title()
    if reference.islower():
        return candidate.lower()
    if reference.isupper():
        return candidate.upper()
    return candidate
```


## Tests still failing

- [ ] display
- [ ] io
- [ ] modtime
- [ ] path
- [ ] perf
- [ ] pydantic
- [ ] semver
- [ ] shell
- [ ] string
