Python API for interacting with a xyz-hole instance. You know the thing that is blocking Ads by manipulating your DNS requests and run on your single board computer or on other hardware with different operating systems.
This module supports both v5 and v6 versions of the API through a unified interface. Simply specify the version when creating your client:
from hole import Hole
# For v6 (default)
client = Hole("YOUR_API_TOKEN")
# For v5
client_v5 = Hole("YOUR_API_TOKEN", version=5)
This module is consuming the details provided by the endpoint api.php and other API endpoints available in v5 and v6.
If you wonder why the weird name and that the usage of xzy-hole instead of the real name, please contact the trademark holder. They were unhappy with original name of the module and came up with very funny ideas which were not feasible or match the existing naming standards. Also, it should remind us that a community is a vital part of every Open Source project.
This module is not supported or endorsed by that particular trademark holder. The development happens independently, they are not providing resources and the module may no longer work if they breaking their API endpoint.
Installation
The module is available from the Python Package Index.
$ pip3 install hole
On a Fedora-based system.
$ sudo dnf -y install python-hole
For Nix or NixOS is a pre-packed module available. The latest release is usually present in the unstable channel.
$ nix-env -iA nixos.python3Packages.hole
Usage
The files examplev5.py and examplev6.py contains examples about how to use this module.
Roadmap
There are more features on the roadmap but there is no ETA because I prefer to support Open Source projects where third party contributions are appreciated.
License
python-hole is licensed under MIT, for more details check LICENSE.
Release files for hole 0.9.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hole-0.9.2.tar.gz | 11.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hole-0.9.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.9 kB
Release files / hole-0.9.2.tar.gz
| Download URL | hole-0.9.2.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d433ac3f4078bb9904b4112aa2233c2848935f7eeed23d3d590d0cdae0a5eb2
|
|
BLAKE2b-256 checksum How to use checksums |
822c085ea627c679c3293982c81b0236c12f7d4ef77d673bf791a1d178c69d30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.
Transparency logRelease files / hole-0.9.2-py3-none-any.whl
| Download URL | hole-0.9.2-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a6e3728affe6183228c41ef2b9dc5b13b10456f57a9b1b484ba6be806a66cb8
|
|
BLAKE2b-256 checksum How to use checksums |
cd9b5a04a1641de0b8afdd81d6272c5e55b55bd406dcaee7dc50cf791ad6f4c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.
Transparency log