No project description provided
Project description
PNQ
PNQ is a Python implementation like Language Integrated Query (LINQ).
!!! danger PNQはベータ版です。
- 現在、ドキュメントとAPIが一致していません。
- ライブラリが十分な品質に到達するまで、頻繁に内部実装やAPIが更新される恐れがあります。
- 本番環境では利用しないでください。
Features
- コレクション操作に関する多彩な操作
- アクセシブルなインタフェース
- 型ヒントの活用
- 非同期ストリームに対応
Similar tools
Documentation
- See documentation for more details.
Dependencies
- Python 3.7+
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).save()
# => [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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pnq-0.0.14.tar.gz
(52.3 kB
view hashes)
Built Distribution
pnq-0.0.14-py3-none-any.whl
(66.3 kB
view hashes)