jboc


Namejboc JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/maxme1/jboc
SummaryNo dependencies, no paradigm - Just a Bunch Of Code
upload_time2023-02-20 14:33:59
maintainer
docs_urlNone
authormaxme1
requires_python>=3.6
licenseMIT
keywords utils misc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## No dependencies, no paradigm - Just a Bunch Of Code

A small collection of some useful code that didn't fit into any package that I know of.

# Examples

Turn a generator function into a function that returns a list:

```python
from jboc import collect


@collect
def odd_numbers(n):
    for i in range(n):
        yield 2 * i + 1


# not a generator anymore
odd_numbers(3) == [1, 3, 5] 
```

Same as before, but gather the values into a different container, e.g. a dict:

```python
from jboc import composed


@composed(dict)
def vals_to_squares(values):
    for v in values:
        yield v, v ** 2


# the pairs are gathered in a dict
vals_to_squares([3, 2, 8]) == {3: 9, 2: 4, 8: 64}
```

# Install

```shell
pip install jboc
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/maxme1/jboc",
    "name": "jboc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "utils,misc",
    "author": "maxme1",
    "author_email": "maxs987@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/92/df/fd9017ee8c3bad85ea4d84b8a828acaae97486373430586e7dedb1c56c91/jboc-0.1.0.tar.gz",
    "platform": null,
    "description": "## No dependencies, no paradigm - Just a Bunch Of Code\n\nA small collection of some useful code that didn't fit into any package that I know of.\n\n# Examples\n\nTurn a generator function into a function that returns a list:\n\n```python\nfrom jboc import collect\n\n\n@collect\ndef odd_numbers(n):\n    for i in range(n):\n        yield 2 * i + 1\n\n\n# not a generator anymore\nodd_numbers(3) == [1, 3, 5] \n```\n\nSame as before, but gather the values into a different container, e.g. a dict:\n\n```python\nfrom jboc import composed\n\n\n@composed(dict)\ndef vals_to_squares(values):\n    for v in values:\n        yield v, v ** 2\n\n\n# the pairs are gathered in a dict\nvals_to_squares([3, 2, 8]) == {3: 9, 2: 4, 8: 64}\n```\n\n# Install\n\n```shell\npip install jboc\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "No dependencies, no paradigm - Just a Bunch Of Code",
    "version": "0.1.0",
    "project_urls": {
        "Download": "https://github.com/maxme1/jboc/archive/v0.1.0.tar.gz",
        "Homepage": "https://github.com/maxme1/jboc"
    },
    "split_keywords": [
        "utils",
        "misc"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92dffd9017ee8c3bad85ea4d84b8a828acaae97486373430586e7dedb1c56c91",
                "md5": "b7928d91b891e9705ed2f4a0d817dca5",
                "sha256": "1aa4826885950b0846f2bc8e99f504cc7d134ac24f82b99ae8005c7055b5d5d8"
            },
            "downloads": -1,
            "filename": "jboc-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b7928d91b891e9705ed2f4a0d817dca5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3865,
            "upload_time": "2023-02-20T14:33:59",
            "upload_time_iso_8601": "2023-02-20T14:33:59.928643Z",
            "url": "https://files.pythonhosted.org/packages/92/df/fd9017ee8c3bad85ea4d84b8a828acaae97486373430586e7dedb1c56c91/jboc-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-20 14:33:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "maxme1",
    "github_project": "jboc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jboc"
}
        
Elapsed time: 0.08968s