https://github.com/wsh032/aria2-wheel
python wheel for aria2 static build
https://github.com/wsh032/aria2-wheel
aria2 aria2c pypi python static-build wheel
Last synced: about 2 months ago
JSON representation
python wheel for aria2 static build
- Host: GitHub
- URL: https://github.com/wsh032/aria2-wheel
- Owner: WSH032
- License: gpl-2.0
- Created: 2023-12-07T07:50:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-07T19:36:56.000Z (about 2 months ago)
- Last Synced: 2025-04-07T20:35:21.404Z (about 2 months ago)
- Topics: aria2, aria2c, pypi, python, static-build, wheel
- Language: Python
- Homepage: https://wsh032.github.io/aria2-wheel/
- Size: 47.9 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Aria2 Wheel
python wheel for aria2 static build| | |
| - | - |
| CI/CD | [![CI: lint-test]][CI: lint-test#link] [![pre-commit.ci status]][pre-commit.ci status#link]
[![CI: docs]][CI: docs#link] [![CI: publish]][CI: publish#link] |
| Code | [![codecov]][codecov#link] [![Code style: black]][Code style: black#link] [![Ruff]][Ruff#link] [![Checked with pyright]][Checked with pyright#link] |
| Package | [![PyPI - Version]][PyPI#link] [![PyPI - Downloads]][PyPI#link] [![PyPI - Python Version]][PyPI#link] |
| Meta | [![Hatch project]][Hatch project#link] [![GitHub License]][GitHub License#link] |---
Documentation:
Source Code:
---
## Introduction
[aria2](https://github.com/aria2/aria2) is a lightweight multi-protocol & multi-source command-line download utility.
It's easy to install aria2 on Linux (`apt install aria2`), however it's not easy to install aria2 on Windows (at least can't one-click to install).
So I build this python wheel to binding aria2 static build. You can install it by `pip` from `pypi` on Windows.
Now, we support:
- [x] manylinux_2_17_x86_64
- [x] musllinux_1_1_x86_64
- [x] manylinux_2_17_aarch64
- [x] musllinux_1_1_aarch64
- [x] win_amd64
- [x] win32## Features
`aria2-wheel` internally bundles the aria2c binary and utilizes the [entry_point](https://setuptools.pypa.io/en/latest/userguide/entry_point.html#console-scripts) technology.
Therefore, it does not modify your system's `PATH` environment variable, and there is no need for `sudo` permissions.
You can completely uninstall it by running `pip uninstall aria2`.
## Credits
- [aria2](https://github.com/aria2/aria2)
- This project is not `aria2` official project.
- [aria2-static-build](https://github.com/abcfy2/aria2-static-build)
- The bound aria2 executable file directly comes from `aria2-static-build` project, and `aria2-wheel` assumes no responsibility for your use.
- The license of `aria2-wheel` project is consistent with `aria2-static-build` project.check `hatch_build.py` and `.github/workflows/publish.yml` to know how we build the wheel.
## Install
```shell
pip install aria2
```or install in global environment with [pipx](https://pypa.github.io/pipx/)
```shell
# https://pypa.github.io/pipx/
pipx install aria2
```## Usage
### cli usage
All api is the same as [aria2](https://aria2.github.io/manual/en/html/aria2c.html)
```shell
aria2c --help
```or
```shell
python -m aria2c --help
````ctrl + c` , `ctrl + break` , `kill ` will work well, even exit code.
### [subprocess.Popen](https://docs.python.org/3/library/subprocess.html)
Do not shutdown the subprocess by `Popen.terminate()` or `Popen.kill()`, which can not shutdown aria2 subprocess properly.
Use following code instead:
```python
import os
import signal
import subprocess
import sys
from subprocess import Popen
from typing import TypedDictclass Win32PopenKwargs(TypedDict):
"""Popen kwargs for Windows."""creationflags: int
class UnixPopenKwargs(TypedDict):
"""Popen kwargs for Unix."""start_new_session: bool
popen_kwargs = (
UnixPopenKwargs(start_new_session=True)
if sys.platform != "win32"
else Win32PopenKwargs(creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
)with Popen(args=("aria2c", "--enable-rpc"), **popen_kwargs) as p:
try:
# Do whatever you want here.
...
finally:
# following code can shutdown the subprocess gracefully.
if sys.platform == "win32":
# https://stackoverflow.com/questions/44124338/trying-to-implement-signal-ctrl-c-event-in-python3-6
os.kill(p.pid, signal.CTRL_BREAK_EVENT)
else:
os.killpg(os.getpgid(p.pid), signal.SIGINT)
```## development
- If you find any issues, please don't hesitate to [open an issue](https://github.com/WSH032/aria2-wheel/issues).
- If you need assistance, feel free to [start a discussion](https://github.com/WSH032/aria2-wheel/discussions).
- Follow our `CONTRIBUTING.md`, [PR Welcome!](https://github.com/WSH032/aria2-wheel/pulls)
- Security 😰❗: We value any security vulnerabilities, [please report to us privately](https://github.com/WSH032/aria2-wheel/security), pretty appreciated for that.English is not the native language of the author (me), so if you find any areas for improvement in the documentation, your feedback is welcome.
If you think this project helpful, consider giving it a star , which makes me happy. :smile:
[CI: lint-test]: https://github.com/WSH032/aria2-wheel/actions/workflows/lint-test.yml/badge.svg
[CI: lint-test#link]: https://github.com/WSH032/aria2-wheel/actions/workflows/lint-test.yml
[CI: docs]: https://github.com/WSH032/aria2-wheel/actions/workflows/docs.yml/badge.svg
[CI: docs#link]: https://github.com/WSH032/aria2-wheel/actions/workflows/docs.yml
[CI: publish]: https://github.com/WSH032/aria2-wheel/actions/workflows/publish.yml/badge.svg
[CI: publish#link]: https://github.com/WSH032/aria2-wheel/actions/workflows/publish.yml
[pre-commit.ci status]: https://results.pre-commit.ci/badge/github/WSH032/aria2-wheel/main.svg
[pre-commit.ci status#link]: https://results.pre-commit.ci/latest/github/WSH032/aria2-wheel/main[Code style: black]: https://img.shields.io/badge/code%20style-black-000000.svg
[Code style: black#link]: https://github.com/psf/black
[GitHub License]: https://img.shields.io/github/license/WSH032/aria2-wheel?color=9400d3
[GitHub License#link]: https://github.com/WSH032/aria2-wheel/blob/main/LICENSE
[Ruff]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
[Ruff#link]: https://github.com/astral-sh/ruff
[Checked with pyright]: https://microsoft.github.io/pyright/img/pyright_badge.svg
[Checked with pyright#link]: https://microsoft.github.io/pyright[PyPI - Version]: https://img.shields.io/pypi/v/aria2?logo=pypi&label=PyPI&logoColor=gold
[PyPI - Downloads]: https://img.shields.io/pypi/dm/aria2?color=blue&label=Downloads&logo=pypi&logoColor=gold
[PyPI - Python Version]: https://img.shields.io/pypi/pyversions/aria2?logo=python&label=Python&logoColor=gold
[PyPI#link]: https://pypi.org/project/aria2[Hatch project]: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg
[Hatch project#link]: https://github.com/pypa/hatch
[codecov]: https://codecov.io/gh/WSH032/aria2-wheel/graph/badge.svg?token=62QQU06E8X
[codecov#link]: https://codecov.io/gh/WSH032/aria2-wheel