%global _empty_manifest_terminate_build 0 Name: python-aiogqlc Version: 3.1.0 Release: 1 Summary: aiohttp based GraphQL client with file upload support License: MIT License URL: https://github.com/DoctorJohn/aiogqlc Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3f/33/4e688216fdfc542a125f4ba8d600c6c1041e66486bf121a509d30b913525/aiogqlc-3.1.0.tar.gz BuildArch: noarch Requires: python3-aiohttp Requires: python3-flake8 Requires: python3-isort Requires: python3-black Requires: python3-pre-commit Requires: python3-pytest Requires: python3-pytest-cov Requires: python3-pytest-asyncio Requires: python3-pytest-aiohttp Requires: python3-tox Requires: python3-twine Requires: python3-strawberry-graphql Requires: python3-mypy Requires: python3-codecov Requires: python3-mkdocs Requires: python3-mkdocs-material %description # Asynchronous/IO GraphQL client [![Versions][versions-image]][versions-url] [![PyPI][pypi-image]][pypi-url] [![Downloads][downloads-image]][downloads-url] [![Codecov][codecov-image]][codecov-url] [![License][license-image]][license-url] [versions-image]: https://img.shields.io/pypi/pyversions/aiogqlc [versions-url]: https://github.com/DoctorJohn/aiogqlc/blob/master/setup.py [pypi-image]: https://img.shields.io/pypi/v/aiogqlc [pypi-url]: https://pypi.org/project/aiogqlc/ [downloads-image]: https://img.shields.io/pypi/dm/aiogqlc [downloads-url]: https://pypi.org/project/aiogqlc/ [codecov-image]: https://codecov.io/gh/DoctorJohn/aiogqlc/branch/main/graph/badge.svg?token=63WRUHG8SW [codecov-url]: https://codecov.io/gh/DoctorJohn/aiogqlc [license-image]: https://img.shields.io/pypi/l/aiogqlc [license-url]: https://github.com/DoctorJohn/aiogqlc/blob/master/LICENSE A Python asynchronous/IO GraphQL client based on [aiohttp][aiohttp-url]. In addition to standard HTTP POST `queries` and `mutations` this client fully supports the [GraphQL multipart form requests spec][multipart-specs-url] for file uploads and the [graphql-ws subprotocol][graphql-ws-url] for WebSocket based `subscriptions`. **[Read the documentation][docs-url]** ## Installation ```sh pip install aiogqlc ``` ## Basic usage Check the [documentation][docs-url] for detailed and more advanced usage examples. ### Queries ```python import asyncio import aiohttp from aiogqlc import GraphQLClient ENDPOINT = "https://swapi-graphql.netlify.app/.netlify/functions/index" document = """ query { allFilms { films { title } } } """ async def main(): async with aiohttp.ClientSession() as session: client = GraphQLClient(document, session=session) response = await client.execute(document) print(await response.json()) if __name__ == "__main__": asyncio.run(main()) ``` ### Mutations ```python import aiohttp from aiogqlc import GraphQLClient document = """ mutation ($userId: ID!) { deleteUser (id: $userId) { id } } """ variables = { "userId": "42", } async def main(): async with aiohttp.ClientSession() as session: client = GraphQLClient("https://example.com/graphql/", session=session) response = await client.execute(document, variables=variables) print(await response.json()) ``` ### File uploads ```python import aiohttp from aiogqlc import GraphQLClient document = """ mutation($file: Upload!) { uploadFile(file: $file) { size } } """ variables = { "file": open("test.txt", "rb") } async def foo(): async with aiohttp.ClientSession() as session: client = GraphQLClient("https://example.com/graphql/", session=session) response = await client.execute(document, variables=variables) print(await response.json()) ``` ### Subscriptions ```python import aiohttp from aiogqlc import GraphQLClient document = """ subscription($postId: ID!) { likeAdded(postId: $postId) } """ variables = { "postId": "42" } async def main(): async with aiohttp.ClientSession() as session: client = GraphQLClient("https://example.com/graphql/", session=session) async with client.connect() as connection: async for payload in connection.subscribe(document, variables=variables): print(payload) ``` ## [Documentation][docs-url] [Read the documentation][docs-url] to learn more about queries, mutations, subscriptions, file uploads and even authentication. [aiohttp-url]: https://github.com/aio-libs/aiohttp [multipart-specs-url]: https://github.com/jaydenseric/graphql-multipart-request-spec [graphql-ws-url]: https://github.com/apollographql/subscriptions-transport-ws [docs-url]: https://doctorjohn.github.io/aiogqlc/ %package -n python3-aiogqlc Summary: aiohttp based GraphQL client with file upload support Provides: python-aiogqlc BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-aiogqlc # Asynchronous/IO GraphQL client [![Versions][versions-image]][versions-url] [![PyPI][pypi-image]][pypi-url] [![Downloads][downloads-image]][downloads-url] [![Codecov][codecov-image]][codecov-url] [![License][license-image]][license-url] [versions-image]: https://img.shields.io/pypi/pyversions/aiogqlc [versions-url]: https://github.com/DoctorJohn/aiogqlc/blob/master/setup.py [pypi-image]: https://img.shields.io/pypi/v/aiogqlc [pypi-url]: https://pypi.org/project/aiogqlc/ [downloads-image]: https://img.shields.io/pypi/dm/aiogqlc [downloads-url]: https://pypi.org/project/aiogqlc/ [codecov-image]: https://codecov.io/gh/DoctorJohn/aiogqlc/branch/main/graph/badge.svg?token=63WRUHG8SW [codecov-url]: https://codecov.io/gh/DoctorJohn/aiogqlc [license-image]: https://img.shields.io/pypi/l/aiogqlc [license-url]: https://github.com/DoctorJohn/aiogqlc/blob/master/LICENSE A Python asynchronous/IO GraphQL client based on [aiohttp][aiohttp-url]. In addition to standard HTTP POST `queries` and `mutations` this client fully supports the [GraphQL multipart form requests spec][multipart-specs-url] for file uploads and the [graphql-ws subprotocol][graphql-ws-url] for WebSocket based `subscriptions`. **[Read the documentation][docs-url]** ## Installation ```sh pip install aiogqlc ``` ## Basic usage Check the [documentation][docs-url] for detailed and more advanced usage examples. ### Queries ```python import asyncio import aiohttp from aiogqlc import GraphQLClient ENDPOINT = "https://swapi-graphql.netlify.app/.netlify/functions/index" document = """ query { allFilms { films { title } } } """ async def main(): async with aiohttp.ClientSession() as session: client = GraphQLClient(document, session=session) response = await client.execute(document) print(await response.json()) if __name__ == "__main__": asyncio.run(main()) ``` ### Mutations ```python import aiohttp from aiogqlc import GraphQLClient document = """ mutation ($userId: ID!) { deleteUser (id: $userId) { id } } """ variables = { "userId": "42", } async def main(): async with aiohttp.ClientSession() as session: client = GraphQLClient("https://example.com/graphql/", session=session) response = await client.execute(document, variables=variables) print(await response.json()) ``` ### File uploads ```python import aiohttp from aiogqlc import GraphQLClient document = """ mutation($file: Upload!) { uploadFile(file: $file) { size } } """ variables = { "file": open("test.txt", "rb") } async def foo(): async with aiohttp.ClientSession() as session: client = GraphQLClient("https://example.com/graphql/", session=session) response = await client.execute(document, variables=variables) print(await response.json()) ``` ### Subscriptions ```python import aiohttp from aiogqlc import GraphQLClient document = """ subscription($postId: ID!) { likeAdded(postId: $postId) } """ variables = { "postId": "42" } async def main(): async with aiohttp.ClientSession() as session: client = GraphQLClient("https://example.com/graphql/", session=session) async with client.connect() as connection: async for payload in connection.subscribe(document, variables=variables): print(payload) ``` ## [Documentation][docs-url] [Read the documentation][docs-url] to learn more about queries, mutations, subscriptions, file uploads and even authentication. [aiohttp-url]: https://github.com/aio-libs/aiohttp [multipart-specs-url]: https://github.com/jaydenseric/graphql-multipart-request-spec [graphql-ws-url]: https://github.com/apollographql/subscriptions-transport-ws [docs-url]: https://doctorjohn.github.io/aiogqlc/ %package help Summary: Development documents and examples for aiogqlc Provides: python3-aiogqlc-doc %description help # Asynchronous/IO GraphQL client [![Versions][versions-image]][versions-url] [![PyPI][pypi-image]][pypi-url] [![Downloads][downloads-image]][downloads-url] [![Codecov][codecov-image]][codecov-url] [![License][license-image]][license-url] [versions-image]: https://img.shields.io/pypi/pyversions/aiogqlc [versions-url]: https://github.com/DoctorJohn/aiogqlc/blob/master/setup.py [pypi-image]: https://img.shields.io/pypi/v/aiogqlc [pypi-url]: https://pypi.org/project/aiogqlc/ [downloads-image]: https://img.shields.io/pypi/dm/aiogqlc [downloads-url]: https://pypi.org/project/aiogqlc/ [codecov-image]: https://codecov.io/gh/DoctorJohn/aiogqlc/branch/main/graph/badge.svg?token=63WRUHG8SW [codecov-url]: https://codecov.io/gh/DoctorJohn/aiogqlc [license-image]: https://img.shields.io/pypi/l/aiogqlc [license-url]: https://github.com/DoctorJohn/aiogqlc/blob/master/LICENSE A Python asynchronous/IO GraphQL client based on [aiohttp][aiohttp-url]. In addition to standard HTTP POST `queries` and `mutations` this client fully supports the [GraphQL multipart form requests spec][multipart-specs-url] for file uploads and the [graphql-ws subprotocol][graphql-ws-url] for WebSocket based `subscriptions`. **[Read the documentation][docs-url]** ## Installation ```sh pip install aiogqlc ``` ## Basic usage Check the [documentation][docs-url] for detailed and more advanced usage examples. ### Queries ```python import asyncio import aiohttp from aiogqlc import GraphQLClient ENDPOINT = "https://swapi-graphql.netlify.app/.netlify/functions/index" document = """ query { allFilms { films { title } } } """ async def main(): async with aiohttp.ClientSession() as session: client = GraphQLClient(document, session=session) response = await client.execute(document) print(await response.json()) if __name__ == "__main__": asyncio.run(main()) ``` ### Mutations ```python import aiohttp from aiogqlc import GraphQLClient document = """ mutation ($userId: ID!) { deleteUser (id: $userId) { id } } """ variables = { "userId": "42", } async def main(): async with aiohttp.ClientSession() as session: client = GraphQLClient("https://example.com/graphql/", session=session) response = await client.execute(document, variables=variables) print(await response.json()) ``` ### File uploads ```python import aiohttp from aiogqlc import GraphQLClient document = """ mutation($file: Upload!) { uploadFile(file: $file) { size } } """ variables = { "file": open("test.txt", "rb") } async def foo(): async with aiohttp.ClientSession() as session: client = GraphQLClient("https://example.com/graphql/", session=session) response = await client.execute(document, variables=variables) print(await response.json()) ``` ### Subscriptions ```python import aiohttp from aiogqlc import GraphQLClient document = """ subscription($postId: ID!) { likeAdded(postId: $postId) } """ variables = { "postId": "42" } async def main(): async with aiohttp.ClientSession() as session: client = GraphQLClient("https://example.com/graphql/", session=session) async with client.connect() as connection: async for payload in connection.subscribe(document, variables=variables): print(payload) ``` ## [Documentation][docs-url] [Read the documentation][docs-url] to learn more about queries, mutations, subscriptions, file uploads and even authentication. [aiohttp-url]: https://github.com/aio-libs/aiohttp [multipart-specs-url]: https://github.com/jaydenseric/graphql-multipart-request-spec [graphql-ws-url]: https://github.com/apollographql/subscriptions-transport-ws [docs-url]: https://doctorjohn.github.io/aiogqlc/ %prep %autosetup -n aiogqlc-3.1.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-aiogqlc -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri Apr 07 2023 Python_Bot - 3.1.0-1 - Package Spec generated