pycutroh


Namepycutroh JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryA python module for cutting strings.
upload_time2024-03-11 17:35:02
maintainerIT-Administrators
docs_urlNone
authorIT-Administrators
requires_python>=3.7
licenseMIT License Copyright (c) 2023 IT-Administrators Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software" (main branch and all sub branches)), 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 cut
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pycutroh

_The pycutroh module is a simple string cutting module._

## Table of contents

1. [Introduction](#introduction)
2. [Getting started](#getting-started)
    1. [Prerequisites](#prerequisites)
    2. [Installation](#installation)
3. [How to use](#how-to-use)
    1. [How to import](#how-to-import)
    2. [Using the module](#using-the-module)
    3. [Using the cli](#using-the-cli)
4. [License](/LICENSE)

## Introduction

I've written this module to learn python and some python basics like using unittests, imports and how python modules/packets work. 

This module is inspired by the linux bash command.

At the moment this module provides four functions, which can be used to manipulate strings. For further information see here: [How to use](#how-to-use)

The cli interface for this module is now available. 

## Getting started

### Prerequisites

- Python installed
- Operatingsystem: Linux or Windows, not tested on mac
- IDE like VS Code, if you want to contribute or change the code

### Installation

There are two ways to install this module depending on the way you work and the preinstalled modules:

1. ```pip install pycutroh```
2. ```python -m pip install pycutroh```

## How to use

### How to Import

You can import the module in two ways:

```python
import pycutroh
```

- This will import all functions. Even the ones that are not supposed to be used (helper functions).

```python
from pycutroh import *
```

- This will import only the significant functions, meant for using. 

### Using the module

Depending on the way you imported the module, the following examples look a bit different.

Example 1:

```python
from pycutroh import *

print(get_letter_on_pos("This is a demonstration string.",0))
```
Result:
```
T
```

Example 2:

```python
from pycutroh import *

print(get_letters_from_pos_to_pos("This is a demonstration string.",(0,4)))

```
Result:
```
This
```

Example 3:

```python
from pycutroh import *

print(get_fields("This is a demonstration string.",(0,3)," "))

```
Result:
```
This demonstration
```

Example 4:

```python
import pycutroh

print(pycutroh.get_fields_new_separator("This is a demonstration string.",(0,3)," ","|"))
```
Result:
```
This|demonstration
```

### Using the cli

You can now use the cli of the pycutroh module. This cli is my first using the argparse module, so there might be adjustments in the future.

To show the help run the following command:

```python
python -m pycutroh -h
```
Result:
```
usage: __main__.py [-h] [-s STRING] [-glop GETLETTERONPOS | -glbp GETLETTERSFROMPOSTOPOS GETLETTERSFROMPOSTOPOS] {f} ...

positional arguments:
  {f}                   Get fields separated by specified delimiter.
    f                   Get fields by delimiter and join using same delimiter.

options:
  -h, --help            show this help message and exit
  -s STRING, --string STRING
  -glop GETLETTERONPOS, --getLetterOnPos GETLETTERONPOS
                        Letter on position to return.
  -glbp GETLETTERSFROMPOSTOPOS GETLETTERSFROMPOSTOPOS, --getLettersFromPosToPos GETLETTERSFROMPOSTOPOS GETLETTERSFROMPOSTOPOS
                        Get letter between positions.
```

Using a function:

```python
python -m pycutroh f --getFields (0,1,2,3) --delimiter " " --newDelimiter ","
```

Result:
```
This,is,a,demonstration
```

## License

[MIT](/LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pycutroh",
    "maintainer": "IT-Administrators",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "string,cut",
    "author": "IT-Administrators",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/39/ba/cf0ed6dd48362c34602ed132045f1ec1436b0a9a6053e0f9a06284750c74/pycutroh-0.1.1.tar.gz",
    "platform": null,
    "description": "# pycutroh\n\n_The pycutroh module is a simple string cutting module._\n\n## Table of contents\n\n1. [Introduction](#introduction)\n2. [Getting started](#getting-started)\n    1. [Prerequisites](#prerequisites)\n    2. [Installation](#installation)\n3. [How to use](#how-to-use)\n    1. [How to import](#how-to-import)\n    2. [Using the module](#using-the-module)\n    3. [Using the cli](#using-the-cli)\n4. [License](/LICENSE)\n\n## Introduction\n\nI've written this module to learn python and some python basics like using unittests, imports and how python modules/packets work. \n\nThis module is inspired by the linux bash command.\n\nAt the moment this module provides four functions, which can be used to manipulate strings. For further information see here: [How to use](#how-to-use)\n\nThe cli interface for this module is now available. \n\n## Getting started\n\n### Prerequisites\n\n- Python installed\n- Operatingsystem: Linux or Windows, not tested on mac\n- IDE like VS Code, if you want to contribute or change the code\n\n### Installation\n\nThere are two ways to install this module depending on the way you work and the preinstalled modules:\n\n1. ```pip install pycutroh```\n2. ```python -m pip install pycutroh```\n\n## How to use\n\n### How to Import\n\nYou can import the module in two ways:\n\n```python\nimport pycutroh\n```\n\n- This will import all functions. Even the ones that are not supposed to be used (helper functions).\n\n```python\nfrom pycutroh import *\n```\n\n- This will import only the significant functions, meant for using. \n\n### Using the module\n\nDepending on the way you imported the module, the following examples look a bit different.\n\nExample 1:\n\n```python\nfrom pycutroh import *\n\nprint(get_letter_on_pos(\"This is a demonstration string.\",0))\n```\nResult:\n```\nT\n```\n\nExample 2:\n\n```python\nfrom pycutroh import *\n\nprint(get_letters_from_pos_to_pos(\"This is a demonstration string.\",(0,4)))\n\n```\nResult:\n```\nThis\n```\n\nExample 3:\n\n```python\nfrom pycutroh import *\n\nprint(get_fields(\"This is a demonstration string.\",(0,3),\" \"))\n\n```\nResult:\n```\nThis demonstration\n```\n\nExample 4:\n\n```python\nimport pycutroh\n\nprint(pycutroh.get_fields_new_separator(\"This is a demonstration string.\",(0,3),\" \",\"|\"))\n```\nResult:\n```\nThis|demonstration\n```\n\n### Using the cli\n\nYou can now use the cli of the pycutroh module. This cli is my first using the argparse module, so there might be adjustments in the future.\n\nTo show the help run the following command:\n\n```python\npython -m pycutroh -h\n```\nResult:\n```\nusage: __main__.py [-h] [-s STRING] [-glop GETLETTERONPOS | -glbp GETLETTERSFROMPOSTOPOS GETLETTERSFROMPOSTOPOS] {f} ...\n\npositional arguments:\n  {f}                   Get fields separated by specified delimiter.\n    f                   Get fields by delimiter and join using same delimiter.\n\noptions:\n  -h, --help            show this help message and exit\n  -s STRING, --string STRING\n  -glop GETLETTERONPOS, --getLetterOnPos GETLETTERONPOS\n                        Letter on position to return.\n  -glbp GETLETTERSFROMPOSTOPOS GETLETTERSFROMPOSTOPOS, --getLettersFromPosToPos GETLETTERSFROMPOSTOPOS GETLETTERSFROMPOSTOPOS\n                        Get letter between positions.\n```\n\nUsing a function:\n\n```python\npython -m pycutroh f --getFields (0,1,2,3) --delimiter \" \" --newDelimiter \",\"\n```\n\nResult:\n```\nThis,is,a,demonstration\n```\n\n## License\n\n[MIT](/LICENSE)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 IT-Administrators  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\" (main branch and all sub branches)), 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": "A python module for cutting strings.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/IT-Administrators/pycutroh"
    },
    "split_keywords": [
        "string",
        "cut"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ffc7ed9e9b1fad71a95a807cc6715dc85b47c6d62fa3ba3fd7abac5a12afa415",
                "md5": "b076587a599de484f0c3066e0480eae2",
                "sha256": "676169b0566267b27c0395606bc828e8095038ea601626a377acdd7f5586c14b"
            },
            "downloads": -1,
            "filename": "pycutroh-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b076587a599de484f0c3066e0480eae2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6885,
            "upload_time": "2024-03-11T17:35:00",
            "upload_time_iso_8601": "2024-03-11T17:35:00.858354Z",
            "url": "https://files.pythonhosted.org/packages/ff/c7/ed9e9b1fad71a95a807cc6715dc85b47c6d62fa3ba3fd7abac5a12afa415/pycutroh-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39bacf0ed6dd48362c34602ed132045f1ec1436b0a9a6053e0f9a06284750c74",
                "md5": "5a36360c7ed8254f82bf753d92fd72b7",
                "sha256": "7fad47f187dd8aca3ab1f41be81c257986dea4a5addb6986d2f803adb3c02249"
            },
            "downloads": -1,
            "filename": "pycutroh-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5a36360c7ed8254f82bf753d92fd72b7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6448,
            "upload_time": "2024-03-11T17:35:02",
            "upload_time_iso_8601": "2024-03-11T17:35:02.664074Z",
            "url": "https://files.pythonhosted.org/packages/39/ba/cf0ed6dd48362c34602ed132045f1ec1436b0a9a6053e0f9a06284750c74/pycutroh-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-11 17:35:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "IT-Administrators",
    "github_project": "pycutroh",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pycutroh"
}
        
Elapsed time: 0.37460s