Metadata-Version: 2.2
Name: aioxdl
Version: 0.0.31
Summary: Python fast downloader
Home-page: https://github.com/Clinton-Abraham
Author: Clinton-Abraham
Author-email: clintonabrahamc@gmail.com
License: MIT
Keywords: python,downloader,aiohttp
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Requires-Python: ~=3.10
Description-Content-Type: text/markdown
Requires-Dist: aiohttp
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

<p align="center">
    📦 <a href="https://pypi.org/project/aioxdl" style="text-decoration:none;">AIOXDL</a>
</p>

<p align="center">
   <a href="https://telegram.me/Space_x_bots"><img src="https://img.shields.io/badge/Sᴘᴀᴄᴇ 𝕩 ʙᴏᴛꜱ-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
   <a href="https://telegram.me/clinton_abraham"><img src="https://img.shields.io/badge/Cʟɪɴᴛᴏɴ Aʙʀᴀʜᴀᴍ-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
   <a href="https://telegram.me/sources_codes"><img src="https://img.shields.io/badge/Sᴏᴜʀᴄᴇ ᴄᴏᴅᴇꜱ-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
</p>

## USAGE
<details>
    <summary>Installation</summary>

```bash
pip install aioxdl
```

</details>

<details>
    <summary>Quick start</summary>

```python
import asyncio
from aioxdl.modules import Aioxdl
from aioxdl.functions import AioxdlTimeout

# tsize = total size
# dsize = downloaded size

async def progress(tsize, dsize):
    percentage = round((dsize / tsize) * 100, 2)
    print(f"COMPLETED : {percentage}%")

async def main():
    try:
        core = Aioxdl(timeout=2000)
        link = "https://example.in/file.txt"
        file = await core.download(link, progress=progress)
        print(file)
    except AioxdlTimeout as errors:
        print(errors)
    except Exception as errors:
        print(errors)

asyncio.run(main())
```

</details>

<details>
    <summary>Set location</summary>

```python
import asyncio
from aioxdl.modules import Aioxdl
from aioxdl.functions import AioxdlTimeout

# tsize = total size
# dsize = downloaded size

async def progress(tsize, dsize):
    percentage = round((dsize / tsize) * 100, 2)
    print(f"COMPLETED : {percentage}%")

async def main():
    try:
        path = "/Downloads"
        core = Aioxdl(timeout=2000)
        link = "https://example.in/file.txt"
        file = await core.download(link, location=path, progress=progress)
        print(file)
    except AioxdlTimeout as errors:
        print(errors)
    except Exception as errors:
        print(errors)

asyncio.run(main())
```

</details>

<details>
    <summary>Set filename</summary>

```python
import asyncio
from aioxdl.modules import Aioxdl
from aioxdl.functions import AioxdlTimeout

# tsize = total size
# dsize = downloaded size

async def progress(tsize, dsize):
    percentage = round((dsize / tsize) * 100, 2)
    print(f"COMPLETED : {percentage}%")

async def main():
    try:
        name = "Clinton Abraham"
        core = Aioxdl(timeout=2000)
        link = "https://example.in/file.txt"
        file = await core.download(link, filename=name, progress=progress)
        print(file)
    except AioxdlTimeout as errors:
        print(errors)
    except Exception as errors:
        print(errors)

asyncio.run(main())
```

</details>

<details>
    <summary>Stop download</summary>

```python
import asyncio
from aioxdl.modules import Aioxdl
from aioxdl.functions import Cancelled
from aioxdl.functions import AioxdlTimeout

TASK_IDS = []

# tsize = total size
# dsize = downloaded size

async def progress(tsize, dsize, tuid):
    if tuid in TASK_IDS:
        percentage = round((dsize / tsize) * 100, 2)
        print(f"COMPLETED : {percentage}%")
    else:
        raise Cancelled("Cancelled ❌")

async def main():
    try:
        tuid = 1234567890
        TASK_IDS.append(tuid)
        core = Aioxdl(timeout=2000)
        link = "https://example.in/file.txt"
        file = await core.download(link, progress=progress, progress_args=(tuid))
        print(file)
    except AioxdlTimeout as errors:
        print(errors)
    except Cancelled as cancelled:
        print(cancelled)
    except Exception as errors:
        print(errors)

asyncio.run(main())
```
</details>
