richtypes


Namerichtypes JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/sarvesh4396/richtypes
SummaryEnhanced python datatypes
upload_time2023-05-17 20:36:19
maintainer
docs_urlNone
authorSarvesh Kumar Dwivedi
requires_python>=3.7.0
licenseMIT
keywords richtypes datatypes enhancement lists dictionary utility
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # RICHTYPES

Enhanced python Datatype with rich extended methods.

## Types Supported

- [x] list
- [x] dict
- [ ] set
- [ ] tuple
- [ ] str

## Install

```bash
pip install richtypes
```

## Examples

### RichList

```python

from richtypes import RichList

rl = RichList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) # create a RichList

rl.append(12) # append a number
# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]

rl.length # length of the list
# 12


# function to check even
def is_even(num):
    return num % 2 == 0


rl.where(is_even) # filter list which follows is_even func
# [2, 4, 6, 8, 10]

# use inplace=False to return a new list
new = rl.where(is_even, inplace=False)
# [2, 4, 6, 8, 10]


rl.first_where(is_even) # first element which follows is_even func
# 2

```

### RichDict

```python

from richtypes import RichDict

rd = RichDict(a=1, b=2, c=3, d=4, e=5) # create a RichDict

rd.length # length of the dict
# 5


rd.first_item # first item of the dict
# {'a': 1}

rd.replace_key(old_key='a', new_key='r') # replace key
# {'b': 2, 'c': 3, 'd': 4, 'e': 5, 'r': 1}

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sarvesh4396/richtypes",
    "name": "richtypes",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7.0",
    "maintainer_email": "",
    "keywords": "richtypes,DATATYPES,ENHANCEMENT,LISTS,DICTIONARY,UTILITY",
    "author": "Sarvesh Kumar Dwivedi",
    "author_email": "heysarvesh@pm.me",
    "download_url": "https://files.pythonhosted.org/packages/2c/31/eadb849c64d66636209e1f9d66bcad9bfa3ca7d37cadcd6a911fc784c0a6/richtypes-0.0.1.tar.gz",
    "platform": null,
    "description": "# RICHTYPES\r\n\r\nEnhanced python Datatype with rich extended methods.\r\n\r\n## Types Supported\r\n\r\n- [x] list\r\n- [x] dict\r\n- [ ] set\r\n- [ ] tuple\r\n- [ ] str\r\n\r\n## Install\r\n\r\n```bash\r\npip install richtypes\r\n```\r\n\r\n## Examples\r\n\r\n### RichList\r\n\r\n```python\r\n\r\nfrom richtypes import RichList\r\n\r\nrl = RichList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) # create a RichList\r\n\r\nrl.append(12) # append a number\r\n# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\r\n\r\nrl.length # length of the list\r\n# 12\r\n\r\n\r\n# function to check even\r\ndef is_even(num):\r\n    return num % 2 == 0\r\n\r\n\r\nrl.where(is_even) # filter list which follows is_even func\r\n# [2, 4, 6, 8, 10]\r\n\r\n# use inplace=False to return a new list\r\nnew = rl.where(is_even, inplace=False)\r\n# [2, 4, 6, 8, 10]\r\n\r\n\r\nrl.first_where(is_even) # first element which follows is_even func\r\n# 2\r\n\r\n```\r\n\r\n### RichDict\r\n\r\n```python\r\n\r\nfrom richtypes import RichDict\r\n\r\nrd = RichDict(a=1, b=2, c=3, d=4, e=5) # create a RichDict\r\n\r\nrd.length # length of the dict\r\n# 5\r\n\r\n\r\nrd.first_item # first item of the dict\r\n# {'a': 1}\r\n\r\nrd.replace_key(old_key='a', new_key='r') # replace key\r\n# {'b': 2, 'c': 3, 'd': 4, 'e': 5, 'r': 1}\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Enhanced python datatypes",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/sarvesh4396/richtypes"
    },
    "split_keywords": [
        "richtypes",
        "datatypes",
        "enhancement",
        "lists",
        "dictionary",
        "utility"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4a5fe1e8ce470edac2d8ba98f7cf3fcc0e13cb12176aa9c1dacda876c7775081",
                "md5": "308fd72772d40bf6a7e0f5e8b5aa519d",
                "sha256": "88909a20cd478ee238bb5fb93734c5ee991f9ecc89695340d218ad477104b90e"
            },
            "downloads": -1,
            "filename": "richtypes-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "308fd72772d40bf6a7e0f5e8b5aa519d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7.0",
            "size": 4338,
            "upload_time": "2023-05-17T20:36:16",
            "upload_time_iso_8601": "2023-05-17T20:36:16.341252Z",
            "url": "https://files.pythonhosted.org/packages/4a/5f/e1e8ce470edac2d8ba98f7cf3fcc0e13cb12176aa9c1dacda876c7775081/richtypes-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c31eadb849c64d66636209e1f9d66bcad9bfa3ca7d37cadcd6a911fc784c0a6",
                "md5": "fdc986c9148ea4c5e266870a0b2f7f57",
                "sha256": "ae71732832b485bf9fb37acfcf07b72e2c4cb89aa63a36210d89e7fddc7ae9f2"
            },
            "downloads": -1,
            "filename": "richtypes-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fdc986c9148ea4c5e266870a0b2f7f57",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7.0",
            "size": 4518,
            "upload_time": "2023-05-17T20:36:19",
            "upload_time_iso_8601": "2023-05-17T20:36:19.236791Z",
            "url": "https://files.pythonhosted.org/packages/2c/31/eadb849c64d66636209e1f9d66bcad9bfa3ca7d37cadcd6a911fc784c0a6/richtypes-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-17 20:36:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sarvesh4396",
    "github_project": "richtypes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "richtypes"
}
        
Elapsed time: 0.08294s