pip install openblacklist
OpenBlacklist
Official client for the OpenBlacklist API.
Description
OpenBlacklist is a Python client library for interacting with the OpenBlacklist API. It allows you to check if a user is blacklisted, handle webhooks, and trigger specific events based on webhook data.
Installation
You can install the library using Poetry:
poetry add openblacklist
Or
pip install openblacklist
```
## Usage
```py
from openblacklist import OpenBlacklistClient
api_key = "your_api_key"
client = OpenBlacklistClient(api_key)
```
### Check if user is blacklisted
```py
import asyncio
async def check_user():
user_id = 12345
user_blacklist = await client.check_user(user_id)
print(user_blacklist)
asyncio.run(check_user())
```
### Handling Webhooks
To handle webhooks, you need to set up an endpoint and define event handlers.
```py
@client.event("add")
async def handle_add_event(event):
print(f"User added: {event.user}")
@client.event("remove")
async def handle_remove_event(event):
print(f"User removed: {event.user}")
client.listen()
```
### Running the server
```py
client.listen(host="0.0.0.0", port=5000)
```
### Configuration
```py
client = OpenBlacklistClient(api_key, url="https://openbl.clarty.org/api/v1/", webhook_url="your_webhook_url")
```
## License
This project is licensed under the MIT License.
Release files for openblacklist 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openblacklist-1.1.3.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openblacklist-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.6 kB
Release files / openblacklist-1.1.3.tar.gz
| Download URL | openblacklist-1.1.3.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
175f509c5d008ea43df99ec8871dcffae8dc27664be22a9e9501d249ae69b255
|
|
BLAKE2b-256 checksum How to use checksums |
02bb7b18dff9ce8b56473a12741827e11257b2a2cd3823f4f6b54c477b7d58fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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 Nov 24, 2024.
Transparency logRelease files / openblacklist-1.1.3-py3-none-any.whl
| Download URL | openblacklist-1.1.3-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47124f372a5fed1d6645189790b3dd2aa7380e7897fd37c9a18f618c7d6d2edb
|
|
BLAKE2b-256 checksum How to use checksums |
c29e51328713d4875d7e161130f6f394bc3c46708f183d87eac82a3aa4761335
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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 Nov 24, 2024.
Transparency log