Metadata-Version: 2.1
Name: ddeutil
Version: 0.3.6
Summary: Data Developer & Engineer Core Utility Objects
Author-email: korawica <korawich.anu@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/ddeutils/ddeutil/
Project-URL: Source Code, https://github.com/ddeutils/ddeutil/
Keywords: data,utility
Classifier: Topic :: Utilities
Classifier: Natural Language :: English
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ujson ==5.10.0
Requires-Dist: tzdata ==2024.1
Requires-Dist: python-dateutil ==2.9.0.post0
Requires-Dist: types-python-dateutil ==2.9.0.20240821

# Data Utility Packages: _Core_

[![test](https://github.com/korawica/ddeutil/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/korawica/ddeutil/actions/workflows/tests.yml)
[![python support version](https://img.shields.io/pypi/pyversions/ddeutil)](https://pypi.org/project/ddeutil/)
[![size](https://img.shields.io/github/languages/code-size/korawica/ddeutil)](https://github.com/korawica/ddeutil)

**Table of Contents**:

- [Installation](#installation)
- [Features](#features)
  - [Base Utility Functions](#base-utility-functions)
  - [Utility Functions](#utility-functions)

The **Core Utility** package implements the utility functions and objects
that was created on sub-package namespace, `ddeutil`, design for independent
installation. I make this package able to extend with any sub-extension with
this namespace. This namespace able to scale out the coding with folder
structure design. You can add any extension features and import by
`import ddeutil.{extension}`.

> [!NOTE]
> This package provide the Base Utility functions and objects for any sub-namespace
> package that use for data function or application.

## Installation

```shell
pip install -U ddeutil
```

## Features

This Core package will implement all of reusable functions and objects that does
not re-create again because it is basic code but has a lot of coding.

```text
core
  - base
    - cache
    - checker
    - convert
    - hash
    - merge
    - sorting
    - splitter
  - decorator
  - dtutils
  - randomly
```

### OnlyOne

```python
from ddeutil.core import onlyone

assert 'a' == onlyone(['a', 'b'], ['a', 'b', 'c'])
assert 'c' == onlyone(('a', 'b'), ['c', 'e', 'f'])
assert onlyone(['a', 'b'], ['c', 'e', 'f'], default=False) is None
```

### Instance Check

```python
from ddeutil.core import isinstance_check
from typing import Union, Optional

assert isinstance_check("s", str)
assert isinstance_check(["s"], list[str])
assert isinstance_check(("s", "t"), tuple[str, ...])
assert not isinstance_check(("s", "t"), tuple[str])
assert isinstance_check({"s": 1, "d": "r"}, dict[str, Union[int, str]])
assert isinstance_check("s", Optional[str])
assert isinstance_check(1, Optional[Union[str, int]])
assert not isinstance_check("s", list[str])
```

## License

This project was licensed under the terms of the [MIT license](LICENSE).
