Skip to main content

python-alpm

Python bindings for the Arch Linux Package Management (ALPM) project.

We are currently awaiting decision from PyPI maintainers to allow us to publish this package under the name alpm. Until then, we are using the name python-alpm. You can view the support ticket here.

Documentation

Latest documentation is available at https://alpm.archlinux.page/pdoc.

Installation

pip install python-alpm

Examples

Validating and comparing versions

>>> from alpm.alpm_types import PackageVersion, PackageRelease, FullVersion, SchemaVersion

>>> full_version = FullVersion(
...     pkgver=PackageVersion("0.1.0alpha"), pkgrel=PackageRelease(minor=1)
... )
>>> full_version
FullVersion(pkgver=PackageVersion('0.1.0alpha'), pkgrel=PackageRelease(major=0, minor=1))

>>> PackageVersion("1.0.1") > full_version.pkgver
True

>>> version_one = SchemaVersion.from_str("1.0.0")
>>> version_one
SchemaVersion(major=1, minor=0, patch=0, pre='', build='')

>>> version_one == SchemaVersion(major=1)
True

Parsing .SRCINFO

>>> from alpm.alpm_srcinfo import SourceInfoV1
>>> from alpm.alpm_types import Architecture

>>> srcinfo = SourceInfoV1.from_file("../alpm-srcinfo/tests/correct/all_overrides.srcinfo")

>>> srcinfo.base
PackageBase(name='example', version=FullVersion(pkgver=PackageVersion('0.1.0'), pkgrel=PackageRelease(major=1), epoch=1))

>>> srcinfo.base.architectures
Architectures([Architecture('x86_64'), Architecture('aarch64')])

>>> srcinfo.packages
[Package(name='example')]

>>> srcinfo.packages_for_architecture(Architecture("aarch64"))
[MergedPackage(architecture=Architecture('aarch64'), name='example', version=FullVersion(pkgver=PackageVersion('0.1.0'), pkgrel=PackageRelease(major=1), epoch=1))]

Working with package metadata

>>> from alpm.alpm_srcinfo.source_info.v1.package import Package, Override
>>> from alpm.alpm_types import License

>>> pkg = Package("testpkg")

>>> pkg.description = Override("A test package")
>>> pkg.description
Override(value='A test package')

>>> pkg.licenses = Override([License("MIT"), License("custom-license")])
>>> pkg.licenses
Override(value=[License('MIT'), License('custom-license')])

>>> {str(lic): lic.is_spdx for lic in pkg.licenses.value}
{'MIT': True, 'custom-license': False}

Contributing

Please refer to the contribution guidelines to learn how to contribute to this project.

License

This project can be used under the terms of the Apache-2.0 or MIT. Contributions to this project, unless noted otherwise, are automatically licensed under the terms of both of those licenses.

Metadata

Release files for python-alpm 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-alpm 0.5.0
File Size Uploaded
python_alpm-0.5.0.tar.gz 361.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for python-alpm 0.5.0
File Interpreter ABI Platform
python_alpm-0.5.0-cp310-abi3-manylinux_2_31_riscv64.whl CPython 3.10 abi3 Linux glibc 2.31+ RISC-V 64 Details
python_alpm-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
python_alpm-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details

Total release size: 3.1 MB

Release files / python_alpm-0.5.0.tar.gz

Download URL python_alpm-0.5.0.tar.gz
Size 361.9 kB
Tags Source
SHA-256 checksum
How to use checksums
273c2fbc092afdb143386c4cb7d04cb1cb223d9b2167a12a4674f360eff32f2a
BLAKE2b-256 checksum
How to use checksums
5a91a4988d0cabfcd5fbc176d62643096e9f1a6ac956b535e3aaefdbe8ab2913
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":"20261002.0.605229","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / python_alpm-0.5.0-cp310-abi3-manylinux_2_31_riscv64.whl

Download URL python_alpm-0.5.0-cp310-abi3-manylinux_2_31_riscv64.whl
Size 922.4 kB
Tags CPython 3.10 Linux glibc 2.31+ RISC-V 64 abi3
SHA-256 checksum
How to use checksums
756f980df04742630ec9c6720ba8f1f00cecc5f31fde3bd90d0d166dcd50a4c8
BLAKE2b-256 checksum
How to use checksums
7a2cb1b7d20be2360c03f1d650cfeaa6cbff2df6fbf305968348260229d5ce06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":"20261002.0.605229","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / python_alpm-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL python_alpm-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 925.8 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
3661d376b60c73e946b33434194b21a121270e4f140ec30b396ea3a530edb609
BLAKE2b-256 checksum
How to use checksums
039bc002f67997e0b1396f0e33510e73b68ac413628063e62517de8a9c50731b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":"20261002.0.605229","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / python_alpm-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL python_alpm-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 935.8 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
9aadd8cf4ef0ee3bac3f665b3d35ab9de55cdfa488ce689f019cfa6f61e3a4f5
BLAKE2b-256 checksum
How to use checksums
ed2275f431e83d90a75e4ee06e03585477cb8ff1cbd147bed3666a9dfd5bdb9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":"20261002.0.605229","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.5.0 This release

4 release files

0.4.3

10 release files

0.4.2

10 release files

0.4.1

4 release files

0.4.0

4 release files

0.3.0

4 release files

0.2.1

4 release files

0.2.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page