sepyrate


Namesepyrate JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryA library to display digits into groups of thousands and decimal using various delimiters.
upload_time2024-07-08 08:03:11
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords digit grouping decimal separator thousands separator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Sepyrate

Sepyrate is a Python library to display digits separated into groups of thousands and decimal using delimiters such as comma (`","`), dot (`"."`), space (`" "`), or apostrophe (`"'"`).

## (1) Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install sepyrate:

```
pip install sepyrate
```

## (2) Prerequisites

None.

## (3) Usage

The function to group digits in this library is `digit_separation()`, where its required input arguments are:

- `amount` [int or float]: the digits to be separated
- `tsep` [str]: delimiter for thousands separator

and the optional argument:

- `dsep` [str]: delimiter for decimal separator, defaults to `dsep='None'`

The function returns string of digits.

Following [Wikipedia](https://en.wikipedia.org/wiki/Decimal_separator#Examples_of_use):

- For comma thousands separator `tsep=","`: available delimiters for decimal separator are `dsep="None"` and `dsep="."`.
- For dot thousands separator `tsep="."`: available delimiters for decimal separator are `dsep="None"`, `dsep=","` and `dsep="'"`.
- For space thousands separator `tsep=" "`: available delimiters for decimal separator are `dsep="None"`, `dsep=","` and `dsep="."`.
- For apostrophe thousands separator `tsep="'"`: available delimiters for decimal separator are `dsep="None"`, `dsep=","` and `dsep="."`.
- Due to the complexity of Indian numbering system, it's not yet included here. But future release may have this system.

To use, import the function:

```
from sepyrate import digit_separation
```

For floating-point value digits, such as

```
amount = 1200.56
```

to display the digits into thousands with dot delimiter `tsep='.'`, we can either include `dsep=','` or without, such as

```
print(digit_separation(amount, '.', dsep=','))
```

or

```
print(digit_separation(amount, '.'))
```

Both will display

```
'1.200,56'
```

For integer digits, such as

```
value = 10000000
```

to display the digits delimited by space without decimal

```
print(digit_separation(value, ' '))

```

will display

```
'10 000 000'
```

or with decimal with comma delimiter

```
print(digit_separation(value, tsep=' ', dsep=','))

```

will display

```
'10 000 000,00'
```

or with decimal with dot delimiter

```
print(digit_separation(value, tsep=' ', dsep='.'))

```

will display

```
'10 000 000.00'
```

## (5) Contributing

Interested in contributing? Please contact me directly.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sepyrate",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "digit grouping, decimal separator, thousands separator",
    "author": null,
    "author_email": "\"Vivi Andasari, PhD\" <vandasari@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/eb/1d/f38853b549d30c6f0ecc92b58e61c31c1e654a41d32dbc809d57eb6df48f/sepyrate-0.1.0.tar.gz",
    "platform": null,
    "description": "# Sepyrate\n\nSepyrate is a Python library to display digits separated into groups of thousands and decimal using delimiters such as comma (`\",\"`), dot (`\".\"`), space (`\" \"`), or apostrophe (`\"'\"`).\n\n## (1) Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install sepyrate:\n\n```\npip install sepyrate\n```\n\n## (2) Prerequisites\n\nNone.\n\n## (3) Usage\n\nThe function to group digits in this library is `digit_separation()`, where its required input arguments are:\n\n- `amount` [int or float]: the digits to be separated\n- `tsep` [str]: delimiter for thousands separator\n\nand the optional argument:\n\n- `dsep` [str]: delimiter for decimal separator, defaults to `dsep='None'`\n\nThe function returns string of digits.\n\nFollowing [Wikipedia](https://en.wikipedia.org/wiki/Decimal_separator#Examples_of_use):\n\n- For comma thousands separator `tsep=\",\"`: available delimiters for decimal separator are `dsep=\"None\"` and `dsep=\".\"`.\n- For dot thousands separator `tsep=\".\"`: available delimiters for decimal separator are `dsep=\"None\"`, `dsep=\",\"` and `dsep=\"'\"`.\n- For space thousands separator `tsep=\" \"`: available delimiters for decimal separator are `dsep=\"None\"`, `dsep=\",\"` and `dsep=\".\"`.\n- For apostrophe thousands separator `tsep=\"'\"`: available delimiters for decimal separator are `dsep=\"None\"`, `dsep=\",\"` and `dsep=\".\"`.\n- Due to the complexity of Indian numbering system, it's not yet included here. But future release may have this system.\n\nTo use, import the function:\n\n```\nfrom sepyrate import digit_separation\n```\n\nFor floating-point value digits, such as\n\n```\namount = 1200.56\n```\n\nto display the digits into thousands with dot delimiter `tsep='.'`, we can either include `dsep=','` or without, such as\n\n```\nprint(digit_separation(amount, '.', dsep=','))\n```\n\nor\n\n```\nprint(digit_separation(amount, '.'))\n```\n\nBoth will display\n\n```\n'1.200,56'\n```\n\nFor integer digits, such as\n\n```\nvalue = 10000000\n```\n\nto display the digits delimited by space without decimal\n\n```\nprint(digit_separation(value, ' '))\n\n```\n\nwill display\n\n```\n'10 000 000'\n```\n\nor with decimal with comma delimiter\n\n```\nprint(digit_separation(value, tsep=' ', dsep=','))\n\n```\n\nwill display\n\n```\n'10 000 000,00'\n```\n\nor with decimal with dot delimiter\n\n```\nprint(digit_separation(value, tsep=' ', dsep='.'))\n\n```\n\nwill display\n\n```\n'10 000 000.00'\n```\n\n## (5) Contributing\n\nInterested in contributing? Please contact me directly.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A library to display digits into groups of thousands and decimal using various delimiters.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/vandasari/sepyrate",
        "Issues": "https://github.com/vandasari/sepyrate/issues",
        "Repository": "https://github.com/vandasari/sepyrate"
    },
    "split_keywords": [
        "digit grouping",
        " decimal separator",
        " thousands separator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "039d001ede509799d6fb2a38ab2d25bfebbf2a76b02d4c37bfc90b2b7aba53c4",
                "md5": "97e463f715b5b2aa8c5b1cb108af844d",
                "sha256": "9c4f25767bb35cae8c87f8c0f40bf3711df0b32bd5562f65e311647a6e010165"
            },
            "downloads": -1,
            "filename": "sepyrate-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "97e463f715b5b2aa8c5b1cb108af844d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 3821,
            "upload_time": "2024-07-08T08:03:10",
            "upload_time_iso_8601": "2024-07-08T08:03:10.150684Z",
            "url": "https://files.pythonhosted.org/packages/03/9d/001ede509799d6fb2a38ab2d25bfebbf2a76b02d4c37bfc90b2b7aba53c4/sepyrate-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eb1df38853b549d30c6f0ecc92b58e61c31c1e654a41d32dbc809d57eb6df48f",
                "md5": "ddfa57d7fc46cdca44fd622b14652851",
                "sha256": "48431d44d33d259715f9e36cfb205db167ff223cd6a407c41439074c194cfbbb"
            },
            "downloads": -1,
            "filename": "sepyrate-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ddfa57d7fc46cdca44fd622b14652851",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 3534,
            "upload_time": "2024-07-08T08:03:11",
            "upload_time_iso_8601": "2024-07-08T08:03:11.977005Z",
            "url": "https://files.pythonhosted.org/packages/eb/1d/f38853b549d30c6f0ecc92b58e61c31c1e654a41d32dbc809d57eb6df48f/sepyrate-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-08 08:03:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vandasari",
    "github_project": "sepyrate",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "sepyrate"
}
        
Elapsed time: 4.17228s