Skip to main content

No project description provided

Project description

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.

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

pnq-0.0.21.tar.gz (63.5 kB view details)

Uploaded Source

Built Distribution

pnq-0.0.21-py3-none-any.whl (80.5 kB view details)

Uploaded Python 3

File details

Details for the file pnq-0.0.21.tar.gz.

File metadata

  • Download URL: pnq-0.0.21.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.6 Linux/5.15.79.1-microsoft-standard-WSL2

File hashes

Hashes for pnq-0.0.21.tar.gz
Algorithm Hash digest
SHA256 44cc8f74c4ccd41262b532bb67bc8b03b2c1c4144ef2618ea7dabeb6d2841d68
MD5 a8a7cd9ffbcf1ce053a704afdab88074
BLAKE2b-256 35a7e9a386298769ef8c77e647d194a821b4e3612e19f35a8498d1531d4852d0

See more details on using hashes here.

File details

Details for the file pnq-0.0.21-py3-none-any.whl.

File metadata

  • Download URL: pnq-0.0.21-py3-none-any.whl
  • Upload date:
  • Size: 80.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.6 Linux/5.15.79.1-microsoft-standard-WSL2

File hashes

Hashes for pnq-0.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 2ddc9cb8bd462ebbe18398bda637880828d2b907472783afa78a35d1c3ecdf0a
MD5 92bb4d4466d7496d0538b4ccab44163e
BLAKE2b-256 fa70096a09e873a5473dffa7f58f40abb8e16275b144e8ee8e5a4f7d628a3cd7

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