python wheel for aria2 static build
CI/CD | |
Code | |
Package | |
Meta |
Documentation: https://wsh032.github.io/aria2-wheel/
Source Code: https://github.com/WSH032/aria2-wheel/
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:
- manylinux_2_17_x86_64
- musllinux_1_1_x86_64
- manylinux_2_17_aarch64
- musllinux_1_1_aarch64
- win_amd64
- win32
aria2-wheel
internally bundles the aria2c binary and utilizes the entry_point 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
.
- aria2
- This project is not
aria2
official project.
- This project is not
- aria2-static-build
- The bound aria2 executable file directly comes from
aria2-static-build
project, andaria2-wheel
assumes no responsibility for your use. - The license of
aria2-wheel
project is consistent witharia2-static-build
project.
- The bound aria2 executable file directly comes from
check hatch_build.py
and .github/workflows/publish.yml
to know how we build the wheel.
pip install aria2
or install in global environment with pipx
# https://pypa.github.io/pipx/
pipx install aria2
All api is the same as aria2
aria2c --help
or
python -m aria2c --help
ctrl + c
, ctrl + break
, kill <pid>
will work well, even exit code.
Do not shutdown the subprocess by Popen.terminate()
or Popen.kill()
, which can not shutdown aria2 subprocess properly.
Use following code instead:
import os
import signal
import subprocess
import sys
from subprocess import Popen
from typing import TypedDict
class 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)
- If you find any issues, please don't hesitate to open an issue.
- If you need assistance, feel free to start a discussion.
- Follow our
CONTRIBUTING.md
, PR Welcome! - Security 😰❗: We value any security vulnerabilities, please report to us privately, 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. 😄