pnq 0.0.21

Creator: railscoder56

Last updated:

Add to Cart

Description:

pnq 0.0.21

PNQ



PNQ is a Python implementation like Language Integrated Query (LINQ).
!!! danger
PNQはベータ版です。
- 現在、ドキュメントとAPIが一致していません。
- ライブラリが十分な品質に到達するまで、頻繁に内部実装やAPIが更新される恐れがあります。
- 本番環境では利用しないでください。


Features

コレクション操作に関する多彩な操作
アクセシブルなインタフェース
型ヒントの活用
非同期ストリームに対応

Similar tools

PyFunctional
linqit
python-linq
aioitertools
asyncstdlib
asq

Documentation

See documentation for more details.

Dependencies

Python 3.8+

Installation
Install with pip:
$ pip install pnq

Getting Started
import pnq

for x in pnq.query([1, 2, 3]).map(lambda x: x * 2):
print(x)
# => 2, 4, 6

pnq.query([1, 2, 3]).map(lambda x: x * 2).result()
# => [2, 4, 6]

pnq.query([1, 2, 3]).filter(lambda x: x == 3).one()
# => 2

import asyncio
import pnq

async def aiter():
yield 1
yield 2
yield 3

async def main():
async for x in pnq.query(aiter()).map(lambda x: x * 2):
print(x)
# => 2, 4, 6

await pnq.query(aiter()).map(lambda x: x * 2)
# => [2, 4, 6]

await pnq.query(aiter()).filter(lambda x: x == 3)._.one()
# => 3

asyncio.run(main())

release note
v0.0.1 (2021-xx-xx)

Initial release.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.