Metadata-Version: 2.4
Name: texton
Version: 1.0.0
Summary: A text-manipulator tool for cases and types.
Author: Johnathan31
License: MIT
Keywords: case,binary,unicode,hexadecimal code point,decimal code point,convert,text conversion,text,text manipulation,mocking case,camel case,pascal case,reverser
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development
Classifier: Topic :: Text Processing
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 🧩 texton ⇄ 🐍🔁🛠️

> <p align="center">**texton** module provides you many common & uncommon cases in python, including some text manipulation functions & conversions</p>

[![License](https://img.shields.io/github/license/Johnathan31/texton.svg)](https://github.com/Johnathan31/texton/blob/master/LICENSE)
[![Python](https://img.shields.io/pypi/pyversions/texton.svg)](https://pypi.org/project/texton)
[![pypi](https://img.shields.io/badge/pypi/v/texton.svg#10.0)](https://pypi.python.org/pypi/texton)

---

# Features

* Functions for most popular cases.
* Text manipulation functions.
* Pure python 3.10 to 3.14+.
* No dependencies.
* custom text and background colouring.
* Binary conversion.
* Hexadecimal notation & decimal code point unicode conversion.
* Conversion between: cases, binary, unicode.

---

## Supported Cases

The available cases in texton are:

| case     | view          |
| -------- | ------------- |
| mocking  | MoCkInG CaSe  |
| camel    | camel Case    |
| pascal   | PascalCase    |
| snake    | snake_case    |
| kebab    | kebab-case    |
| cobol    | COBOL-CASE    |
| constant | CONSTANT_CASE |
| train    | Train-Case    |

### Aliases

some cases have alias names:

| name     | alias       |
| -------- | ----------- |
| constant | upper_snake |
| constant | const       |

---

## Manipulative functions

**Pytext** also features various manipulative functions, which includes:

| function                       | description                |
| ------------------------------ | -------------------------- |
| convert(text, type, to)        | convert `text` to `to`     |
| binary(text)                   | Represent `text` in binary |
| unicodify(text, hexa)          | Return `text` in unicode   |
| color(text, color, bgc, style) | Colors `text`              |

## 🧰 Installation

```bash
pip install texton
```

---

## Usage

* [Basic usage](#Basic-Usage)
* [Convert cases](#Case-conversions)
* [Unicode Support](#Unicode-support)
* [Important notes](#important-notes)

## Basic Usage
```pycon
>>> from texton import reverse, pascal, convert

>>> reverse("Hello world", foreach=True)
'dlrow olleH'

>>> pascal("foo bar baz")
'Foo Bar Baz'

>>> convert("MAX_SPEED", type_="constant", to="train")
'Max-Speed'
```

### Case conversion

all the formats, cases, types in __texton__ are collected in one function: *convert*:
```pycon
>>> from texton import convert

>>> convert(
... "01001000 01100001 01100011 01101011 01100101 01110010",
... type_="binary", 
... to="mocking"
... )
'HaCkEr'

>>> convert(
... text="0x0048 0x0069 0x0021 0x0021 0x0021",
... type_="unicode",
... to="string"
... )
'Hi!!!'
```

### Unicode support (*Implemented*)

Unicode is greatly supported, as you can use any function on any non-ASCII Characters:
```pycon
>>> from texton import reverse

>>> reverse("أهلا", foreach=True) # non-ASCII Characters (Arabic)
'الهأ'

```
And the _unicodify_ function in __texton__, can assist in converting to either Unicode Hexadecimal Code Points (0xXXXX), or Decimal Code Points (NNN)

### Important notes

- The __color__ function, may fail to do it's job in some console environments.

- Although you can use any unicode character, sometimes it's seemingless to use them as some cases doesn't exist in other writing systems:
```pycon
>>> from texton import camel

>>> camel("谢谢") # Chinese (non-ASCII)
'谢谢' # No change (seemless)
```

- The __binary__ function represents only string datatypes (`str`), thus any other type given is internally converted to string.
```pycon
>>> from texton import binary

>>> binary(5) # non-string
'00110101'
>>> binary("5")
'00110101'
```
