this in an indirect fork of https://github.com/tomgross/pcloud/
It's async, uses aiohttp. I plan to reimplement all functions, and add extra - implement some of the NotImplemented, make useful combinations.
update: pcloud has too many methods, i won't implement all of them
because i have not found any async packages for pcloud
# install from PyPI
pip install async_pcloudthere are 2 ways to use the AsyncPyCloud.
- manual connect, disconnect (needed for session, because this is async):
import asyncio
from async_pcloud import AsyncPyCloud
pcloud = AsyncPyCloud("token", endpoint="api")
async def main():
await pcloud.connect()
data = await pcloud.listfolder(folderid=0)
print(data)
# when you're done
await pcloud.disconnect()
asyncio.run(main())- async with - auto connect, disconnect:
pcloud = AsyncPyCloud("token")
async def main():
async with pcloud:
# 'async with AsyncPyCloud("token") as pcloud:' will also work
data = await pcloud.listfolder(folderid=0)
print(data)- AsyncPyCloud
- token - the api token, you can generate one with get_auth()
- endpoint - can be 'api' or 'eapi', choose the one used by your account
- folder - base folder name, will be added before the path param
- headers - you can make custom user agent or something