anyfield


Nameanyfield JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/katyukha/anyfield
SummarySimplifies structured data processing
upload_time2024-09-13 12:18:42
maintainerNone
docs_urlhttps://pythonhosted.org/anyfield/
authorDmytro Katyukha
requires_python>=3.7
licenseMPL 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            AnyField
********

This module provides *SField* class which is ised to avaoid lambdas
there where function of one argument is required to be applied to
multiple items Examples of such cases could be functions like: -
sorted - filter - map - etc

Also this module provides shortcuts (already built SField instances),
that could be starting point of SField expressions. They are: SF, F
Both are same.

For example

.. code:: python

   import requests
   from anyfield import F, SView
   data = requests.get('https://api.github.com/repos/vmg/redcarpet/issues?state=closed')
   data = data.json()
   view = SView(
    F['id'],
    F['state'],
    F['user']['login'],
    F['title'][:40],
    F['comments'].__q_if__("Has comments", "No comments"),
   )
   for row in view(data):
       print(row)

Will result in::

   [121393880, u'closed', u'fusion809', u'Rendering of markdown in HTML tags']
   [120824892, u'closed', u'nitoyon', u'Fix bufprintf for Windows MinGW-w64']
   [118147051, u'closed', u'clemensg', u'Fix header anchor normalization']
   [115033701, u'closed', u'mitchelltd', u'Unicode headers produce invalid anchors']
   [113887752, u'closed', u'Stemby', u'Definition lists']
   [113740700, u'closed', u'Stemby', u'Multiline tables']
   [112952970, u'closed', u'im-kulikov', u"recipe for target 'redcarpet.so' failed"]
   [112494169, u'closed', u'mstahl', u'Unable to compile native extensions in O']
   [111961692, u'closed', u'reiz', u'Adding dependency badge to README']
   [111582314, u'closed', u'jamesaduke', u'Pre tags on code are not added when you ']
   [108204636, u'closed', u'shaneog', u'Push 3.3.3 to Rubygems']

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/katyukha/anyfield",
    "name": "anyfield",
    "maintainer": null,
    "docs_url": "https://pythonhosted.org/anyfield/",
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Dmytro Katyukha",
    "author_email": "dmytro.katyukha@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/10/13/e3e1c6bd3da97f8045dc806900c22a9fa3e4dd2fb2f10ca4e7b7906e23b2/anyfield-0.2.0.tar.gz",
    "platform": null,
    "description": "AnyField\n********\n\nThis module provides *SField* class which is ised to avaoid lambdas\nthere where function of one argument is required to be applied to\nmultiple items Examples of such cases could be functions like: -\nsorted - filter - map - etc\n\nAlso this module provides shortcuts (already built SField instances),\nthat could be starting point of SField expressions. They are: SF, F\nBoth are same.\n\nFor example\n\n.. code:: python\n\n   import requests\n   from anyfield import F, SView\n   data = requests.get('https://api.github.com/repos/vmg/redcarpet/issues?state=closed')\n   data = data.json()\n   view = SView(\n    F['id'],\n    F['state'],\n    F['user']['login'],\n    F['title'][:40],\n    F['comments'].__q_if__(\"Has comments\", \"No comments\"),\n   )\n   for row in view(data):\n       print(row)\n\nWill result in::\n\n   [121393880, u'closed', u'fusion809', u'Rendering of markdown in HTML tags']\n   [120824892, u'closed', u'nitoyon', u'Fix bufprintf for Windows MinGW-w64']\n   [118147051, u'closed', u'clemensg', u'Fix header anchor normalization']\n   [115033701, u'closed', u'mitchelltd', u'Unicode headers produce invalid anchors']\n   [113887752, u'closed', u'Stemby', u'Definition lists']\n   [113740700, u'closed', u'Stemby', u'Multiline tables']\n   [112952970, u'closed', u'im-kulikov', u\"recipe for target 'redcarpet.so' failed\"]\n   [112494169, u'closed', u'mstahl', u'Unable to compile native extensions in O']\n   [111961692, u'closed', u'reiz', u'Adding dependency badge to README']\n   [111582314, u'closed', u'jamesaduke', u'Pre tags on code are not added when you ']\n   [108204636, u'closed', u'shaneog', u'Push 3.3.3 to Rubygems']\n",
    "bugtrack_url": null,
    "license": "MPL 2.0",
    "summary": "Simplifies structured data processing",
    "version": "0.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/katyukha/anyfield/issues",
        "Homepage": "https://github.com/katyukha/anyfield"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3270c3a275609004438fe0f1090391ed0969e66041f167bb81bb9ffb4ec47af1",
                "md5": "11c508e0c15a67eff55d33bdf5da7279",
                "sha256": "351ab900b5b15d10ab7401878f7eeb6b124b97ca6c26bd3f4b51f6004b0d4334"
            },
            "downloads": -1,
            "filename": "anyfield-0.2.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "11c508e0c15a67eff55d33bdf5da7279",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.7",
            "size": 8712,
            "upload_time": "2024-09-13T12:18:40",
            "upload_time_iso_8601": "2024-09-13T12:18:40.862947Z",
            "url": "https://files.pythonhosted.org/packages/32/70/c3a275609004438fe0f1090391ed0969e66041f167bb81bb9ffb4ec47af1/anyfield-0.2.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1013e3e1c6bd3da97f8045dc806900c22a9fa3e4dd2fb2f10ca4e7b7906e23b2",
                "md5": "a6609b7a2ec0aafcfac509b12f50dfbd",
                "sha256": "c0ea293f9e36a7220edf245b92b6c88fd8cdd03abfd70252da5599d503fd5f00"
            },
            "downloads": -1,
            "filename": "anyfield-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a6609b7a2ec0aafcfac509b12f50dfbd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8046,
            "upload_time": "2024-09-13T12:18:42",
            "upload_time_iso_8601": "2024-09-13T12:18:42.235988Z",
            "url": "https://files.pythonhosted.org/packages/10/13/e3e1c6bd3da97f8045dc806900c22a9fa3e4dd2fb2f10ca4e7b7906e23b2/anyfield-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-13 12:18:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "katyukha",
    "github_project": "anyfield",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "anyfield"
}
        
Elapsed time: 0.62368s