flatway


Nameflatway JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://github.com/Paiman-Rasoli/flatway
SummaryPython package for flatting of list, tuple or dictionary.
upload_time2023-10-27 19:40:55
maintainer
docs_urlNone
authorPaiman Rasoli
requires_python>=3.5
licenseMIT
keywords flat flatten flat list flat tuple flatway flatdict
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Flatway

Easily flat list, tuple or dictionary in your python project.

## How to use?

- install package using `pip install flatway`
- import package in your project.

```python
from flatway.flatten import flatten, flattenDict

myList = [1,2,3,[4,5,6,[7,8,9,[10,11]]]]
depth = 3 
# default to 1

flatList = flatten(myList , depth)
# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

myTuple = (1,2,3,(4,5,6,(7,8,9,(10,11))))
flatTuple = flatten(myTuple, depth)
# (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)

person = {"name" : "Paiman", "age" : 12, "info" : {"loveFootball" : True}}
flatPerson = flattenDict(person)
# {"name": "Paiman", "age": 12 , "loveFootball": true}
```
### Run the tests
`pytest src/tests/test_flatten.py`

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Paiman-Rasoli/flatway",
    "name": "flatway",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "flat,flatten,flat list,flat tuple,flatway,flatdict",
    "author": "Paiman Rasoli",
    "author_email": "paimanrasoli789@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f2/73/f7f7a9a5cd5c73f649f7c5472176a99db21cb99b1ef32bb318cf673e1e81/flatway-2.0.0.tar.gz",
    "platform": null,
    "description": "# Flatway\r\n\r\nEasily flat list, tuple or dictionary in your python project.\r\n\r\n## How to use?\r\n\r\n- install package using `pip install flatway`\r\n- import package in your project.\r\n\r\n```python\r\nfrom flatway.flatten import flatten, flattenDict\r\n\r\nmyList = [1,2,3,[4,5,6,[7,8,9,[10,11]]]]\r\ndepth = 3 \r\n# default to 1\r\n\r\nflatList = flatten(myList , depth)\r\n# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]\r\n\r\nmyTuple = (1,2,3,(4,5,6,(7,8,9,(10,11))))\r\nflatTuple = flatten(myTuple, depth)\r\n# (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)\r\n\r\nperson = {\"name\" : \"Paiman\", \"age\" : 12, \"info\" : {\"loveFootball\" : True}}\r\nflatPerson = flattenDict(person)\r\n# {\"name\": \"Paiman\", \"age\": 12 , \"loveFootball\": true}\r\n```\r\n### Run the tests\r\n`pytest src/tests/test_flatten.py`\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python package for flatting of list, tuple or dictionary.",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Paiman-Rasoli/flatway",
        "Source": "https://github.com/Paiman-Rasoli/flatway"
    },
    "split_keywords": [
        "flat",
        "flatten",
        "flat list",
        "flat tuple",
        "flatway",
        "flatdict"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f273f7f7a9a5cd5c73f649f7c5472176a99db21cb99b1ef32bb318cf673e1e81",
                "md5": "769602b3e575a6ee7a695d49ac1ad3ea",
                "sha256": "34e1c086a24859f9106801327442cabcdb26378edb39e45d8ab308c309ffb1bc"
            },
            "downloads": -1,
            "filename": "flatway-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "769602b3e575a6ee7a695d49ac1ad3ea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 3293,
            "upload_time": "2023-10-27T19:40:55",
            "upload_time_iso_8601": "2023-10-27T19:40:55.786339Z",
            "url": "https://files.pythonhosted.org/packages/f2/73/f7f7a9a5cd5c73f649f7c5472176a99db21cb99b1ef32bb318cf673e1e81/flatway-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-27 19:40:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Paiman-Rasoli",
    "github_project": "flatway",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flatway"
}
        
Elapsed time: 0.14209s