Official client for openblacklist API
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openblacklist-1.0.6.tar.gz.
File metadata
- Download URL: openblacklist-1.0.6.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
479234501f90ab38eb9d7c512ba37499d5898a21976ae3dd94eabddb044bf21d
|
|
| MD5 |
6d1a268a5f39d25f6f6e703898dcef63
|
|
| BLAKE2b-256 |
80447177ae54f89bd747ea49a6235b9cf4969df1890692b0f2aefdf3a3aa7cc0
|
Provenance
The following attestation bundles were made for openblacklist-1.0.6.tar.gz:
Publisher:
publish.yml on Awakno/OpenBlacklist-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openblacklist-1.0.6.tar.gz -
Subject digest:
479234501f90ab38eb9d7c512ba37499d5898a21976ae3dd94eabddb044bf21d - Sigstore transparency entry: 151173659
- Sigstore integration time:
-
Permalink:
Awakno/OpenBlacklist-py@7c34d156750ff3ba3c99f0d99e0ec22323769289 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Awakno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c34d156750ff3ba3c99f0d99e0ec22323769289 -
Trigger Event:
push
-
Statement type:
File details
Details for the file openblacklist-1.0.6-py3-none-any.whl.
File metadata
- Download URL: openblacklist-1.0.6-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f6986521440fb50941c0bdfbbb30c6c953737a2a29671bd54700a9db0609872
|
|
| MD5 |
3bde0bc1703afa4451f7192fee082456
|
|
| BLAKE2b-256 |
fbcc6de4c008d4a0ae5476dc37822c1cb8ff5c94ed4230483fee6a9e9ba48fba
|
Provenance
The following attestation bundles were made for openblacklist-1.0.6-py3-none-any.whl:
Publisher:
publish.yml on Awakno/OpenBlacklist-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openblacklist-1.0.6-py3-none-any.whl -
Subject digest:
7f6986521440fb50941c0bdfbbb30c6c953737a2a29671bd54700a9db0609872 - Sigstore transparency entry: 151173660
- Sigstore integration time:
-
Permalink:
Awakno/OpenBlacklist-py@7c34d156750ff3ba3c99f0d99e0ec22323769289 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Awakno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c34d156750ff3ba3c99f0d99e0ec22323769289 -
Trigger Event:
push
-
Statement type: