string-decorator


Namestring-decorator JSON
Version 0.3.0 PyPI version JSON
download
home_page
SummaryPython package for playing with strings
upload_time2023-11-25 20:17:18
maintainer
docs_urlNone
authorimEternity
requires_python
licenseMIT License Copyright (c) 2023 Eternity 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.
keywords string decorator case changer
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # string-decorator

Python Module to have fun with strings

## Usage
### Example 1 -> Calculating expression from given string
```py
from string_decorator import calculate
print(calculate("(123+23) * 23 / 32"))
```
#### Output
```
104.9375
```
### Example 2 -> Validating text based on given conditions
```py
from string_decorator import validate_text
print(validate_text("imEternity1234@strings", length = 13, uppercase = 1, lowercase = 5, numbers = 4, special_characters=1))
```
#### Output
```
True
```
### Example 3 -> Converting the string to random cases
```py
from string_decorator import randcase
print(randcase("hello"))
```
#### Output
```
hELlO
```
### Example 4 -> Extracting numbers from the given string
```py
from string_decorator import num_extract
print(num_extract("hello123 23,211 42.23 -134 g00d"))
```
#### Output
```
['123', '23,211', '42.23', '-134', '00']
```
### Example 5 -> Changing string to CONSTANT_CASE
```py
from string_decorator import constantcase
print(constantcase("hello there"))
```
#### Output
```
HELLO_THERE
```

## Documentation
`text` is a common parameter for all the functions
| Name | Description |
|:--|:--|
| `randcase` | Changes the given text to random cases (upper or lower) |
| `snakecase` | Changes the given text to `snake_case` |
| `constantcase` |  Changes the given text to `CONSTANT_CASE` |
| `kebabcase` | Changes the given text to `kebab-case` |
| `headercase` | Changes the given text to `PascalCase` |
| `camelcase` | Changes the given text to `camelCase` |
| `dotcase` | Changes the given text to `dot.case` |
| `pathcase` | Changes the given text to `path/case` |
| `swapcase` | Changes each upper characters to lower and vice versa |
| `scramble_sentence` | Returns the sentence in random order  Eg: `'Hello my friend'` might change to `'my friend Hello'` |
| `sentence_reverse` | Reverses given sentence  Eg: `'Hello world'` changes to `'world Hello'` |
| `random_string` | Generates a random string comprising of lower cased or upper cased characters, numbers, symbols |
| `str_encode` | Encodes the given text into bytes format |
| `bytes_decode` | Decodes bytes back to string |
| `num_extract` | Extracts numbers from the given strings<br>*parameters:*<br>- `string:` Set it to True to return numbers in a list of strings
| `validate_email` | Validates the text to check if the email format is correct
| `validate_text` | Validates the text to check if it is right according to the conditions specified<br>*parameters:*<br>- `length:` The minimum length of the text<br>- `uppercase:` The minimum number of uppercase letters in the text. Set to 'all' if all letters have to be in uppercase.<br>- `lowercase:` The minimum number of lowercase letters in the text. Set to 'all' if all letters have to be in lowercase.<br>- `numbers:` The minimum number of numbers (positive integers) in the text. Set to 'all' if all are numbers.<br>- `special_characters:` The minimum number of special characters in the text. Set to 'all' if all are special characters.
| `calculate` | Evaluates the given string<br>Eg: "5+2" gives 7


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "string-decorator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "string,decorator,case,changer",
    "author": "imEternity",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/7e/81/b9d7a27a2f7cffa0fe6e8d73eafb3fcdcd859b35502be8b91b58b7db106c/string-decorator-0.3.0.tar.gz",
    "platform": null,
    "description": "# string-decorator\n\nPython Module to have fun with strings\n\n## Usage\n### Example 1 -> Calculating expression from given string\n```py\nfrom string_decorator import calculate\nprint(calculate(\"(123+23) * 23 / 32\"))\n```\n#### Output\n```\n104.9375\n```\n### Example 2 -> Validating text based on given conditions\n```py\nfrom string_decorator import validate_text\nprint(validate_text(\"imEternity1234@strings\", length = 13, uppercase = 1, lowercase = 5, numbers = 4, special_characters=1))\n```\n#### Output\n```\nTrue\n```\n### Example 3 -> Converting the string to random cases\n```py\nfrom string_decorator import randcase\nprint(randcase(\"hello\"))\n```\n#### Output\n```\nhELlO\n```\n### Example 4 -> Extracting numbers from the given string\n```py\nfrom string_decorator import num_extract\nprint(num_extract(\"hello123 23,211 42.23 -134 g00d\"))\n```\n#### Output\n```\n['123', '23,211', '42.23', '-134', '00']\n```\n### Example 5 -> Changing string to CONSTANT_CASE\n```py\nfrom string_decorator import constantcase\nprint(constantcase(\"hello there\"))\n```\n#### Output\n```\nHELLO_THERE\n```\n\n## Documentation\n`text` is a common parameter for all the functions\n| Name | Description |\n|:--|:--|\n| `randcase` | Changes the given text to random cases (upper or lower) |\n| `snakecase` | Changes the given text to `snake_case` |\n| `constantcase` |  Changes the given text to `CONSTANT_CASE` |\n| `kebabcase` | Changes the given text to `kebab-case` |\n| `headercase` | Changes the given text to `PascalCase` |\n| `camelcase` | Changes the given text to `camelCase` |\n| `dotcase` | Changes the given text to `dot.case` |\n| `pathcase` | Changes the given text to `path/case` |\n| `swapcase` | Changes each upper characters to lower and vice versa |\n| `scramble_sentence` | Returns the sentence in random order  Eg: `'Hello my friend'` might change to `'my friend Hello'` |\n| `sentence_reverse` | Reverses given sentence  Eg: `'Hello world'` changes to `'world Hello'` |\n| `random_string` | Generates a random string comprising of lower cased or upper cased characters, numbers, symbols |\n| `str_encode` | Encodes the given text into bytes format |\n| `bytes_decode` | Decodes bytes back to string |\n| `num_extract` | Extracts numbers from the given strings<br>*parameters:*<br>- `string:` Set it to True to return numbers in a list of strings\n| `validate_email` | Validates the text to check if the email format is correct\n| `validate_text` | Validates the text to check if it is right according to the conditions specified<br>*parameters:*<br>- `length:` The minimum length of the text<br>- `uppercase:` The minimum number of uppercase letters in the text. Set to 'all' if all letters have to be in uppercase.<br>- `lowercase:` The minimum number of lowercase letters in the text. Set to 'all' if all letters have to be in lowercase.<br>- `numbers:` The minimum number of numbers (positive integers) in the text. Set to 'all' if all are numbers.<br>- `special_characters:` The minimum number of special characters in the text. Set to 'all' if all are special characters.\n| `calculate` | Evaluates the given string<br>Eg: \"5+2\" gives 7\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Eternity  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. ",
    "summary": "Python package for playing with strings",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/eternity2745/string-decorator#readme",
        "Repository": "https://github.com/eternity2745/string-decorator"
    },
    "split_keywords": [
        "string",
        "decorator",
        "case",
        "changer"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e9ea9105f48e98d6dfb616a7a324c4fd59140f7ea82410da8940c176daead88f",
                "md5": "00770b83e331ad1289a6f2f95cf35282",
                "sha256": "3c4ce4713daef40f9febd6abef52d27612fa8ad4e5812ac5663839f97cd8bdcb"
            },
            "downloads": -1,
            "filename": "string_decorator-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "00770b83e331ad1289a6f2f95cf35282",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7473,
            "upload_time": "2023-11-25T20:17:16",
            "upload_time_iso_8601": "2023-11-25T20:17:16.732483Z",
            "url": "https://files.pythonhosted.org/packages/e9/ea/9105f48e98d6dfb616a7a324c4fd59140f7ea82410da8940c176daead88f/string_decorator-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7e81b9d7a27a2f7cffa0fe6e8d73eafb3fcdcd859b35502be8b91b58b7db106c",
                "md5": "e4d01798dfc423bf7cf7102083971172",
                "sha256": "6a91f62fb9520d6aa235c24d6112e04a6956f783205ba7029363306b51a3643d"
            },
            "downloads": -1,
            "filename": "string-decorator-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e4d01798dfc423bf7cf7102083971172",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7582,
            "upload_time": "2023-11-25T20:17:18",
            "upload_time_iso_8601": "2023-11-25T20:17:18.306638Z",
            "url": "https://files.pythonhosted.org/packages/7e/81/b9d7a27a2f7cffa0fe6e8d73eafb3fcdcd859b35502be8b91b58b7db106c/string-decorator-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-25 20:17:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eternity2745",
    "github_project": "string-decorator#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "string-decorator"
}
        
Elapsed time: 0.14271s