nrt-string-utils


Namenrt-string-utils JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/etuzon/python-nrt-string-utils
SummaryString utilities in Python
upload_time2024-06-16 20:24:11
maintainerNone
docs_urlNone
authorEyal Tuzon
requires_python>=3.8
licenseNone
keywords python python3 python-3 utilities utils util tool tools nrt nrt-utils string string-utils string-utilities nrt-string-utils nrt-string-utilities
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # String Utilities

### String utilities in Python.

![PyPI](https://img.shields.io/pypi/v/nrt-string-utils?color=blueviolet&style=plastic)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nrt-string-utils?color=greens&style=plastic)
![PyPI - License](https://img.shields.io/pypi/l/nrt-string-utils?color=blue&style=plastic)
![PyPI - Downloads](https://img.shields.io/pypi/dd/nrt-string-utils?style=plastic)
![PyPI - Downloads](https://img.shields.io/pypi/dm/nrt-string-utils?color=yellow&style=plastic)
[![Coverage Status](https://coveralls.io/repos/github/etuzon/python-nrt-string-utils/badge.svg)](https://coveralls.io/github/etuzon/pytohn-nrt-string-utils)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/etuzon/python-nrt-string-utils?style=plastic)
![GitHub last commit](https://img.shields.io/github/last-commit/etuzon/python-nrt-string-utils?style=plastic)
[![DeepSource](https://app.deepsource.com/gh/etuzon/python-nrt-string-utils.svg/?label=active+issues&show_trend=false&token=BiVHFqo8lcnkHT7oIOXLceZ3)](https://app.deepsource.com/gh/etuzon/python-nrt-string-utils/)

## StringUtil class

### Methods

| **Method**                          | **Description**                                                         | **Parameters**                                                                                                                                                                       | **Returns**                                                                                |
|-------------------------------------|-------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| **decode_base64**                   | Decodes a base64 encoded string.                                        | **encoded_text (str):** The base64 encoded string to decode.                                                                                                                         | **str:** The decoded string.                                                               |
| **encode_base64**                   | Encodes a string to base64.                                             | **text (str):** The string to encode.                                                                                                                                                | **str:** The base64 encoded string.                                                        |
| **get_char_and_ascii_number_pairs** | Returns a list of tuples containing the character and its ASCII number. | **text (str):** The string to analyze.                                                                                                                                               | **list[tuple[str, int]]:** A list of tuples containing the character and its ASCII number. |
| **get_emails**                      | Returns a list of email addresses found in a string.                    | **text (str):** The string to search for email addresses.                                                                                                                            | **list[str]:** A list of email addresses found in the string (without duplications).       |
| **get_last_char**                   | Returns the last character of a string.                                 | **text (str):** The string to analyze.                                                                                                                                               | **str:** The last character of the string.                                                 |
| **get_urls**                        | Returns a list of URLs found in a string.                               | **text (str):** The string to search for URLs.                                                                                                                                       | **list[str]:** A list of URLs found in the string (without duplications).                  |
| **is_decimal**                      | Checks if a string is a decimal number.                                 | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is a decimal number, False otherwise.                         |
| **is_int**                          | Checks if a string is an integer.                                       | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is an integer, False otherwise.                               |
| **is_json**                         | Checks if a string is a valid JSON.                                     | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is a valid JSON, False otherwise.                             |
| **is_positive_decimal**             | Checks if a string is a positive decimal number.                        | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is a positive decimal number, False otherwise.                |
| **is_positive_int**                 | Checks if a string is a positive integer.                               | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is a positive integer, False otherwise.                       |
| **is_unsigned_decimal**             | Checks if a string is an unsigned decimal number.                       | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is an unsigned decimal number, False otherwise.               |
| **is_unsigned_int**                 | Checks if a string is an unsigned integer.                              | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is an unsigned integer, False otherwise.                      |
| **sub_string**                      | Returns a substring from a string.                                      | **text (str):** The string to extract the substring from.<br>**start_delimiter** (str): Sub string start delimiter.<br>**end_delimiter (Optional[str]):** Sub string end delimiter.  | **str:** The extracted substring.                                                          |
| **sub_string_list**                 | Returns a list of substrings from a string.                             | **text (str):** The string to extract the substrings from.<br>**start_delimiter** (str): Sub string start delimiter.<br>**end_delimiter (Optional[str]):** Sub string end delimiter. | **list[str]:** A list of extracted substrings.                                             |
| **to_ascii**                        | Converts a string to ASCII.                                             | **text (str):** The string to convert.                                                                                                                                               | **str:** The ASCII representation of the string.                                           |

### Examples:

- #### StringUtil.decode_base64

    **Code**
    ```python
    from string_utils import StringUtil

    # Decode a base64 encoded string
    decoded_text = StringUtil.decode_base64('dGVzdA==')
    print(decoded_text)
    ```
    **Output**
    ```
    test
    ```

- #### StringUtil.encode_base64
    
    **Code**
    ```python
    from string_utils import StringUtil
    
    # Encode a string to base64
    encoded_text = StringUtil.encode_base64('test')
    print(encoded_text)
    ```
    **Output**
    ```
    dGVzdA==
    ```

- #### StringUtil.get_char_and_ascii_number_pairs

    **Code**
    ```python
    from string_utils import StringUtil
    
    # Get the character and its ASCII number pairs
    pairs = StringUtil.get_char_and_ascii_number_pairs('test')
    print(pairs)
    ```
    **Output**
    ```
    [('t', 116), ('e', 101), ('s', 115), ('t', 116)]
    ```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/etuzon/python-nrt-string-utils",
    "name": "nrt-string-utils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "python, python3, python-3, utilities, utils, util, tool, tools, nrt, nrt-utils, string, string-utils, string-utilities, nrt-string-utils, nrt-string-utilities",
    "author": "Eyal Tuzon",
    "author_email": "Eyal Tuzon <eyal.tuzon.dev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0d/12/a56491e2303c685920ea262581d767f225084e83d79fdca4b617169c1216/nrt_string_utils-1.0.1.tar.gz",
    "platform": null,
    "description": "# String Utilities\r\n\r\n### String utilities in Python.\r\n\r\n![PyPI](https://img.shields.io/pypi/v/nrt-string-utils?color=blueviolet&style=plastic)\r\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nrt-string-utils?color=greens&style=plastic)\r\n![PyPI - License](https://img.shields.io/pypi/l/nrt-string-utils?color=blue&style=plastic)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dd/nrt-string-utils?style=plastic)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dm/nrt-string-utils?color=yellow&style=plastic)\r\n[![Coverage Status](https://coveralls.io/repos/github/etuzon/python-nrt-string-utils/badge.svg)](https://coveralls.io/github/etuzon/pytohn-nrt-string-utils)\r\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/etuzon/python-nrt-string-utils?style=plastic)\r\n![GitHub last commit](https://img.shields.io/github/last-commit/etuzon/python-nrt-string-utils?style=plastic)\r\n[![DeepSource](https://app.deepsource.com/gh/etuzon/python-nrt-string-utils.svg/?label=active+issues&show_trend=false&token=BiVHFqo8lcnkHT7oIOXLceZ3)](https://app.deepsource.com/gh/etuzon/python-nrt-string-utils/)\r\n\r\n## StringUtil class\r\n\r\n### Methods\r\n\r\n| **Method**                          | **Description**                                                         | **Parameters**                                                                                                                                                                       | **Returns**                                                                                |\r\n|-------------------------------------|-------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|\r\n| **decode_base64**                   | Decodes a base64 encoded string.                                        | **encoded_text (str):** The base64 encoded string to decode.                                                                                                                         | **str:** The decoded string.                                                               |\r\n| **encode_base64**                   | Encodes a string to base64.                                             | **text (str):** The string to encode.                                                                                                                                                | **str:** The base64 encoded string.                                                        |\r\n| **get_char_and_ascii_number_pairs** | Returns a list of tuples containing the character and its ASCII number. | **text (str):** The string to analyze.                                                                                                                                               | **list[tuple[str, int]]:** A list of tuples containing the character and its ASCII number. |\r\n| **get_emails**                      | Returns a list of email addresses found in a string.                    | **text (str):** The string to search for email addresses.                                                                                                                            | **list[str]:** A list of email addresses found in the string (without duplications).       |\r\n| **get_last_char**                   | Returns the last character of a string.                                 | **text (str):** The string to analyze.                                                                                                                                               | **str:** The last character of the string.                                                 |\r\n| **get_urls**                        | Returns a list of URLs found in a string.                               | **text (str):** The string to search for URLs.                                                                                                                                       | **list[str]:** A list of URLs found in the string (without duplications).                  |\r\n| **is_decimal**                      | Checks if a string is a decimal number.                                 | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is a decimal number, False otherwise.                         |\r\n| **is_int**                          | Checks if a string is an integer.                                       | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is an integer, False otherwise.                               |\r\n| **is_json**                         | Checks if a string is a valid JSON.                                     | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is a valid JSON, False otherwise.                             |\r\n| **is_positive_decimal**             | Checks if a string is a positive decimal number.                        | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is a positive decimal number, False otherwise.                |\r\n| **is_positive_int**                 | Checks if a string is a positive integer.                               | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is a positive integer, False otherwise.                       |\r\n| **is_unsigned_decimal**             | Checks if a string is an unsigned decimal number.                       | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is an unsigned decimal number, False otherwise.               |\r\n| **is_unsigned_int**                 | Checks if a string is an unsigned integer.                              | **text (Optional[str]):** The string to check.                                                                                                                                       | **bool:** True if the string is an unsigned integer, False otherwise.                      |\r\n| **sub_string**                      | Returns a substring from a string.                                      | **text (str):** The string to extract the substring from.<br>**start_delimiter** (str): Sub string start delimiter.<br>**end_delimiter (Optional[str]):** Sub string end delimiter.  | **str:** The extracted substring.                                                          |\r\n| **sub_string_list**                 | Returns a list of substrings from a string.                             | **text (str):** The string to extract the substrings from.<br>**start_delimiter** (str): Sub string start delimiter.<br>**end_delimiter (Optional[str]):** Sub string end delimiter. | **list[str]:** A list of extracted substrings.                                             |\r\n| **to_ascii**                        | Converts a string to ASCII.                                             | **text (str):** The string to convert.                                                                                                                                               | **str:** The ASCII representation of the string.                                           |\r\n\r\n### Examples:\r\n\r\n- #### StringUtil.decode_base64\r\n\r\n    **Code**\r\n    ```python\r\n    from string_utils import StringUtil\r\n\r\n    # Decode a base64 encoded string\r\n    decoded_text = StringUtil.decode_base64('dGVzdA==')\r\n    print(decoded_text)\r\n    ```\r\n    **Output**\r\n    ```\r\n    test\r\n    ```\r\n\r\n- #### StringUtil.encode_base64\r\n    \r\n    **Code**\r\n    ```python\r\n    from string_utils import StringUtil\r\n    \r\n    # Encode a string to base64\r\n    encoded_text = StringUtil.encode_base64('test')\r\n    print(encoded_text)\r\n    ```\r\n    **Output**\r\n    ```\r\n    dGVzdA==\r\n    ```\r\n\r\n- #### StringUtil.get_char_and_ascii_number_pairs\r\n\r\n    **Code**\r\n    ```python\r\n    from string_utils import StringUtil\r\n    \r\n    # Get the character and its ASCII number pairs\r\n    pairs = StringUtil.get_char_and_ascii_number_pairs('test')\r\n    print(pairs)\r\n    ```\r\n    **Output**\r\n    ```\r\n    [('t', 116), ('e', 101), ('s', 115), ('t', 116)]\r\n    ```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "String utilities in Python",
    "version": "1.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/etuzon/python-nrt-string-utils/issues",
        "Homepage": "https://github.com/etuzon/python-nrt-string-utils",
        "documentation": "https://github.com/etuzon/python-nrt-string-utils/wiki"
    },
    "split_keywords": [
        "python",
        " python3",
        " python-3",
        " utilities",
        " utils",
        " util",
        " tool",
        " tools",
        " nrt",
        " nrt-utils",
        " string",
        " string-utils",
        " string-utilities",
        " nrt-string-utils",
        " nrt-string-utilities"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fdff363685d187ea9821baf8fa11f2e6baed1b29330143143d7aa4a17c5fa4cd",
                "md5": "9ef7049c43187ce267f08e59d5c4a622",
                "sha256": "29b58a092291388f98c15d564027639b0ce2538f3f418ec3b584d699f083a2d5"
            },
            "downloads": -1,
            "filename": "nrt_string_utils-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ef7049c43187ce267f08e59d5c4a622",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5097,
            "upload_time": "2024-06-16T20:24:08",
            "upload_time_iso_8601": "2024-06-16T20:24:08.081170Z",
            "url": "https://files.pythonhosted.org/packages/fd/ff/363685d187ea9821baf8fa11f2e6baed1b29330143143d7aa4a17c5fa4cd/nrt_string_utils-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d12a56491e2303c685920ea262581d767f225084e83d79fdca4b617169c1216",
                "md5": "6147502094b18bf357a8e3dbbc047937",
                "sha256": "8c359aa57fb996542fd0c3ebb606b75ca5052e231157e89c522aedfd0223e8ac"
            },
            "downloads": -1,
            "filename": "nrt_string_utils-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6147502094b18bf357a8e3dbbc047937",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5755,
            "upload_time": "2024-06-16T20:24:11",
            "upload_time_iso_8601": "2024-06-16T20:24:11.787070Z",
            "url": "https://files.pythonhosted.org/packages/0d/12/a56491e2303c685920ea262581d767f225084e83d79fdca4b617169c1216/nrt_string_utils-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-16 20:24:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "etuzon",
    "github_project": "python-nrt-string-utils",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "nrt-string-utils"
}
        
Elapsed time: 0.52392s