{"id":7254,"library":"gcloud-rest-taskqueue","title":"Google Cloud Task Queue Client (gcloud-aio)","description":"The `gcloud-rest-taskqueue` library provides an asynchronous Python client for interacting with Google Cloud Task Queue. It is part of the `gcloud-aio` monorepo, offering async functionality (via `aiohttp`) for various Google Cloud services. Currently at version 7.0.0, it follows a demand-driven release cadence as part of the larger `gcloud-aio` project.","status":"active","version":"7.0.0","language":"python","source_language":"en","source_url":"https://github.com/talkiq/gcloud-aio","tags":["Google Cloud","Task Queue","asynchronous","aiohttp","cloud tasks"],"install":[{"cmd":"pip install gcloud-rest-taskqueue","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core asynchronous HTTP client dependency.","package":"aiohttp","optional":false},{"reason":"Used for managing connection timeouts.","package":"async-timeout","optional":false},{"reason":"Provides asynchronous Google Cloud authentication utilities, used by the TaskQueue client.","package":"gcloud-aio-auth","optional":false}],"imports":[{"wrong":"from gcloud.aio.taskqueue import TaskQueueClient","symbol":"TaskQueueClient","correct":"from gcloud.aio.taskqueue import TaskQueueClient"}],"quickstart":{"code":"import asyncio\nimport os\n\nfrom gcloud.aio.auth import build_from_env\nfrom gcloud.aio.taskqueue import TaskQueueClient\n\nasync def main():\n    async with build_from_env() as client_session:\n        # Replace with your actual project ID and desired location\n        project_id = os.environ.get(\"GCLOUD_PROJECT\", \"your-gcp-project-id\")\n        location = os.environ.get(\"GCLOUD_TASKQUEUE_LOCATION\", \"us-east1\") # e.g., 'us-central1'\n        queue_name = os.environ.get(\"GCLOUD_TASKQUEUE_NAME\", \"my-queue\") # e.g., 'my-queue'\n        \n        if not project_id or project_id == \"your-gcp-project-id\":\n            print(\"Please set GCLOUD_PROJECT environment variable or replace 'your-gcp-project-id'.\")\n            return\n\n        client = TaskQueueClient(\n            project=project_id,\n            location=location,\n            session=client_session\n        )\n\n        task_name = \"my-test-task-1\"\n        payload = {\"data\": \"hello world\", \"timestamp\": \"2023-01-01T12:00:00Z\"}\n\n        try:\n            await client.create_task(\n                project=project_id,\n                location=location,\n                queue_name=queue_name,\n                task_name=task_name,\n                payload=payload\n            )\n            print(f\"Task '{task_name}' created successfully in queue '{queue_name}' in project '{project_id}'.\")\n        except Exception as e:\n            print(f\"Failed to create task: {e}\")\n\nif __name__ == '__main__':\n    asyncio.run(main())\n","lang":"python","description":"This quickstart demonstrates how to initialize the `TaskQueueClient` and create a task asynchronously. Ensure your `GCLOUD_PROJECT` environment variable is set and that Google Application Credentials are available for authentication."},"warnings":[{"fix":"Upgrade Python to 3.8+ or pin `gcloud-rest-taskqueue` to `<7.0.0`.","message":"Version 7.0.0 of `gcloud-rest-taskqueue` (and `gcloud-aio-taskqueue`) drops support for Python 3.7. Users on Python 3.7 should remain on version 6.x or upgrade their Python interpreter.","severity":"breaking","affected_versions":"7.0.0+"},{"fix":"Upgrade Python to 3.7+ or pin `gcloud-rest-taskqueue` to `<6.0.0`.","message":"Version 6.0.0 of `gcloud-rest-taskqueue` (and `gcloud-aio-taskqueue`) dropped support for Python 3.6. Users on Python 3.6 should remain on version 5.x or upgrade their Python interpreter.","severity":"breaking","affected_versions":"6.0.0+"},{"fix":"Ensure all client method calls are prefixed with `await` and the entry point uses `asyncio.run()`.","message":"This library is an asynchronous client. All API calls must be `await`ed within an `async def` function, which then needs to be executed using `asyncio.run()` (or similar event loop management). Direct synchronous calls will result in `RuntimeError` or `NameError`.","severity":"gotcha","affected_versions":"All"},{"fix":"Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of your service account JSON key file, or ensure appropriate IAM roles are assigned to your GCP service.","message":"Authentication relies on Google Application Credentials. If not explicitly provided, the client will attempt to infer them from the environment (e.g., `GOOGLE_APPLICATION_CREDENTIALS` environment variable pointing to a service account key file, or default credentials when running on GCP services).","severity":"gotcha","affected_versions":"All"},{"fix":"Choose the client that best fits your application's asynchronous requirements and ensure you consult the correct documentation for the chosen library.","message":"This `gcloud-rest-taskqueue` library (part of `gcloud-aio`) is an *asynchronous* client using `aiohttp`. It is distinct from Google's official `google-cloud-tasks` client library, which uses gRPC and offers both synchronous and wrapped asynchronous APIs. The API signatures and underlying implementations are different.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"search_vec":"'7.0.0':49 'aio':8,34,65 'aiohttp':40,72 'async':37 'asynchron':17,71 'cadenc':57 'client':5,19 'cloud':2,24,44,68,73 'current':46 'demand':54 'demand-driven':53 'driven':55 'follow':51 'function':38 'gcloud':7,11,33,64 'gcloud-aio':6,32,63 'gcloud-rest-taskqueu':10 'googl':1,23,43,67 'interact':21 'larger':62 'librari':14 'monorepo':35 'offer':36 'part':29,59 'project':66 'provid':15 'python':18 'queue':4,26,70 'releas':56 'rest':12 'servic':45 'task':3,25,69,74 'taskqueu':13 'various':42 'version':48 'via':39","created_at":"2026-04-16T13:50:22.024039+00:00","updated_at":"2026-04-16T13:50:22.024039+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'gcloud.aio'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"7.0.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/talkiq/gcloud-aio","docs":null,"changelog":null,"pypi":"https://pypi.org/project/gcloud-rest-taskqueue/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["gcp","http-networking","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}