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/f6/6b/f7b7d06bceb4402ca91903246ef25dd2b07c6f00c727977d800a623eeb0d/anyfield-0.3.1.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.3.1",
"project_urls": {
"Bug Tracker": "https://github.com/katyukha/anyfield/issues",
"Homepage": "https://github.com/katyukha/anyfield"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "48b19b50895834308fb3b667951b4857d46bc69e4f9b743e972b34a18d3f63e5",
"md5": "78bf00586a12855f13d567f9ce434ae1",
"sha256": "31e704f58d5d88a4df7a11dce498ebe2d8ca3c48bb4d83ad4e7feed1813ae28a"
},
"downloads": -1,
"filename": "anyfield-0.3.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "78bf00586a12855f13d567f9ce434ae1",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 8799,
"upload_time": "2025-01-26T09:37:06",
"upload_time_iso_8601": "2025-01-26T09:37:06.537983Z",
"url": "https://files.pythonhosted.org/packages/48/b1/9b50895834308fb3b667951b4857d46bc69e4f9b743e972b34a18d3f63e5/anyfield-0.3.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f66bf7b7d06bceb4402ca91903246ef25dd2b07c6f00c727977d800a623eeb0d",
"md5": "ae900fa52162666611e8ec8a9335d6a5",
"sha256": "d9d8637d9f71073b9b70a52f89a98970097af54758e025359b3ab950df51fee3"
},
"downloads": -1,
"filename": "anyfield-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "ae900fa52162666611e8ec8a9335d6a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 8137,
"upload_time": "2025-01-26T09:37:08",
"upload_time_iso_8601": "2025-01-26T09:37:08.236580Z",
"url": "https://files.pythonhosted.org/packages/f6/6b/f7b7d06bceb4402ca91903246ef25dd2b07c6f00c727977d800a623eeb0d/anyfield-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-26 09:37:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "katyukha",
"github_project": "anyfield",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "anyfield"
}