Skip to main content

PNQ

CI pypi Downloads

PNQ is a Python implementation like Language Integrated Query (LINQ).

!!! danger PNQはベータ版です。

- 現在、ドキュメントとAPIが一致していません。
- ライブラリが十分な品質に到達するまで、頻繁に内部実装やAPIが更新される恐れがあります。
- 本番環境では利用しないでください。

Features

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

Similar tools

Documentation

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)

Source distribution for pnq 0.0.21
File Size Uploaded
pnq-0.0.21.tar.gz 63.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pnq 0.0.21
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.21 This release

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page