Skip to main content

Simplifies structured data processing

Project description

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

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']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anyfield-0.2.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

anyfield-0.2.0-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file anyfield-0.2.0.tar.gz.

File metadata

  • Download URL: anyfield-0.2.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for anyfield-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c0ea293f9e36a7220edf245b92b6c88fd8cdd03abfd70252da5599d503fd5f00
MD5 a6609b7a2ec0aafcfac509b12f50dfbd
BLAKE2b-256 1013e3e1c6bd3da97f8045dc806900c22a9fa3e4dd2fb2f10ca4e7b7906e23b2

See more details on using hashes here.

File details

Details for the file anyfield-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: anyfield-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for anyfield-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 351ab900b5b15d10ab7401878f7eeb6b124b97ca6c26bd3f4b51f6004b0d4334
MD5 11c508e0c15a67eff55d33bdf5da7279
BLAKE2b-256 3270c3a275609004438fe0f1090391ed0969e66041f167bb81bb9ffb4ec47af1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page