{"id":13764459,"url":"https://github.com/andriyko/aiociscospark","last_synced_at":"2025-05-13T02:34:23.628Z","repository":{"id":55409065,"uuid":"107713657","full_name":"andriyko/aiociscospark","owner":"andriyko","description":"Python 3 asynchronous Cisco Spark API client","archived":false,"fork":false,"pushed_at":"2020-03-16T05:19:47.000Z","size":76,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T06:02:17.681Z","etag":null,"topics":["aiohttp","api-client","asyncio","cisco-spark","python3"],"latest_commit_sha":null,"homepage":"https://github.com/andriyko/aiociscospark","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andriyko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-20T18:38:06.000Z","updated_at":"2022-04-25T14:49:11.000Z","dependencies_parsed_at":"2022-08-14T23:40:50.977Z","dependency_job_id":null,"html_url":"https://github.com/andriyko/aiociscospark","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andriyko%2Faiociscospark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andriyko%2Faiociscospark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andriyko%2Faiociscospark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andriyko%2Faiociscospark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andriyko","download_url":"https://codeload.github.com/andriyko/aiociscospark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253860204,"owners_count":21975232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiohttp","api-client","asyncio","cisco-spark","python3"],"created_at":"2024-08-03T16:00:20.932Z","updated_at":"2025-05-13T02:34:23.606Z","avatar_url":"https://github.com/andriyko.png","language":"Python","funding_links":[],"categories":["Client SDKs"],"sub_categories":["REST API clients"],"readme":"[![Build Status](https://travis-ci.org/andriyko/aiociscospark.svg?branch=master)](https://travis-ci.org/andriyko/aiociscospark) [![Coverage Status](https://coveralls.io/repos/github/andriyko/aiociscospark/badge.svg?branch=master)](https://coveralls.io/github/andriyko/aiociscospark?branch=master)\n\n# Python Cisco Spark API client\n\nPython 3.6+ [Cisco Spark](https://developer.ciscospark.com) HTTP API wrapper written with [asyncio](https://docs.python.org/3/library/asyncio.html) and [aiohttp](http://aiohttp.readthedocs.io/en/stable/).\n\n## Installation ##\n```\npip install git+git://github.com/andriyko/aiociscospark.git@0.0.1\n```\n\n## Features ##\n- Built-in pagination support\n- Automatic rate-limit handling\n- Automatic refresh of an access token\n- Optionally can read Spark credentials from your local environment\n- Allows to register custom response handlers\n\n## Usage and examples ##\n\n`aiociscospark.APIClient` delegates:\n\n- HTTP communication to `aiociscospark.HTTPClient`\n- REST API stuff (building URLs, parameters, handling of responses, pagination etc) to `aiociscospark.ApiService`.\n\n`aiociscospark.APIClient` owns a set of REST API services that are used to communicate with corresponding API resources:\n\n```python\nimport aiociscospark\nclient = aiociscospark.get_client({'access_token': '\u003ctoken\u003e'})\nIn [5]: for attr, svc in client.__dict__.items():\n   ...:     if isinstance(svc, aiociscospark.services.BaseApiService):\n   ...:         print(f'{svc.__class__.__name__:30} {svc.get_resource_url()}')\n   ...:\n   ...:\n   ...:\nApiServiceContents             https://api.ciscospark.com/v1/contents\nApiServiceLicenses             https://api.ciscospark.com/v1/licenses\nApiServiceMessages             https://api.ciscospark.com/v1/messages\nApiServiceOrganizations        https://api.ciscospark.com/v1/organizations\nApiServicePeople               https://api.ciscospark.com/v1/people\nApiServiceRoles                https://api.ciscospark.com/v1/roles\nApiServiceRoomMemberships      https://api.ciscospark.com/v1/memberships\nApiServiceRooms                https://api.ciscospark.com/v1/rooms\nApiServiceTeamMemberships      https://api.ciscospark.com/v1/team/memberships\nApiServiceTeams                https://api.ciscospark.com/v1/teams\nApiServiceWebhooks             https://api.ciscospark.com/v1/webhooks\n```\n\nFor example, to get current user:\n\n```python\nimport asyncio\nevent_loop = asyncio.get_event_loop()\nme = event_loop.run_until_complete(client.people.me())\nprint(me['displayName'])\n```\n\nTo perform request without wrappers and get `aiohttp.ClientResponse` object:\n\n```python\nurl = client.people.get_resource_url('me') # no outbound HTTP request, just build URL\nresp = event_loop.run_until_complete(client.http_client.get(url))\nresp.__class__ #  aiohttp.client_reqrep.ClientResponse\n```\n\n`aiociscospark.APIClient` expects credentials to be passed as a dictionary with at least `access_token` key. Other keys are optional: `client_id`, `client_secret`, `refresh_token`. Use `aiociscospark.Credentials` to read Spark credentials from your local environment.\nIt expects the following environment variables to be set: `CISCO_SPARK_ACCESS_TOKEN` (required), `CISCO_SPARK_REFRESH_TOKEN`, `CISCO_SPARK_CLIENT_ID`, `CISCO_SPARK_CLIENT_SECRET` (required only if you want to automatically refresh access token).\n\nTo register response handler:\n```python\nasync def handle_unauthorized_response(resp):\n    # do what you need\n    pass\n\nclient.http_client.register_response_handler(401, handle_unauthorized_response)\n```\n\n\n## Running the tests ##\n\n```bash\ngit clone git@github.com:andriyko/aiociscospark.git\ncd aiociscospark\nvirtualenv -p python3 .venv\nsource .venv/bin/activate\npip install -r dev-requirements.txt\nmake test\n```\n\n## Contributing\nFirst off, thanks for taking the time to contribute! :+1:\nWhen contributing to this repository, please first discuss the change you wish to make via issue,\nemail, Spark (contact `andriyko`, you can find me in [#spark4dev](https://web.ciscospark.com/rooms/d2fde090-9d0c-11e5-aeed-2176fdcd8a58/chat) space), or any other method with the owners of this repository before making a change.\n\nPlease read [CONTRIBUTING.md](https://github.com/andriyko/aiociscospark/blob/master/.github/CONTRIBUTING.md) for the process for submitting pull requests.\n\n## Authors\n\n* [andriyko](https://github.com/andriyko)\n\nSee also the list of [contributors](CONTRIBUTORS.md) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandriyko%2Faiociscospark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandriyko%2Faiociscospark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandriyko%2Faiociscospark/lists"}