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.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.
Metadata
Release files for pnq 0.0.21
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pnq-0.0.21.tar.gz | 63.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pnq-0.0.21-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 144.0 kB
Release files / pnq-0.0.21.tar.gz
| Download URL | pnq-0.0.21.tar.gz |
|---|---|
| Size | 63.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44cc8f74c4ccd41262b532bb67bc8b03b2c1c4144ef2618ea7dabeb6d2841d68
|
|
BLAKE2b-256 checksum How to use checksums |
35a7e9a386298769ef8c77e647d194a821b4e3612e19f35a8498d1531d4852d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.8.6 Linux/5.15.79.1-microsoft-standard-WSL2
|
Release files / pnq-0.0.21-py3-none-any.whl
| Download URL | pnq-0.0.21-py3-none-any.whl |
|---|---|
| Size | 80.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ddc9cb8bd462ebbe18398bda637880828d2b907472783afa78a35d1c3ecdf0a
|
|
BLAKE2b-256 checksum How to use checksums |
fa70096a09e873a5473dffa7f58f40abb8e16275b144e8ee8e5a4f7d628a3cd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.8.6 Linux/5.15.79.1-microsoft-standard-WSL2
|