Oficjalna biblioteka bazy dowcipów SucharyAPI
Project description
SucharyPL - oficjalna biblioteka bazy SucharyAPI
Pythonowa biblioteka do pobierania kawałów z ogólnopolskiej bazy SucharyAPI
🚀 Instalacja
Za pomocą pip
pip install sucharypython
Za pomocą uv (w projekcie)
uv add sucharypython
⚡ Szybki start
Pobranie losowego suchara
from sucharypython import dajKawal
# Pobierz losowy suchar z dowolnej kategorii
suchar = dajKawal()
print(suchar)
Pobranie suchara z konkretnej kategorii
from sucharypython import dajKawal
# Pobierz suchar z kategorii "programowanie"
suchar = dajKawal(kategoria="programowanie")
print(suchar)
Kategorie
"programowanie"- Suchary o programowaniu"dwuznaczne"- Suchary dwuznaczne"szkolne"- Suchary szkolne"suchary"- Ogólne suchary"wulgarne"- Suchary wulgarne"czarnyhumor"- Czarny humor"inne"- Inne kategorie
🛡️ Obsługa błędów
Biblioteka rzuca sformalizowane wyjątki, które możesz łatwo obsługiwać:
Dostępne wyjątki
SucharyError- Bazowy wyjątek, rodzic wszystkich błędów z bibliotekiSucharyConnectionError- Problemy z połączeniem (brak internetu, timeout)SucharyHTTPError- Błędy serwera (np. 404 dla nieistniejącej kategorii)
Przykład obsługi błędów
from sucharypython import dajKawal, SucharyError, SucharyConnectionError, SucharyHTTPError
try:
suchar = dajKawal(kategoria="programowanie")
print(suchar)
except SucharyConnectionError:
print("❌ Błąd połączenia - sprawdź połączenie internetowe!")
except SucharyHTTPError as e:
print(f"❌ Błąd serwera: {e}")
except SucharyError as e:
print(f"❌ Nieoczekiwany błąd: {e}")
📡 API
Biblioteka jest produktem oraz korzysta z oficjalnej bazy SucharyAPI:
🔗 https://sucharyapi.onrender.com
📝 Licencja
MIT
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
sucharypython-0.1.1.tar.gz
(2.1 kB
view details)
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 sucharypython-0.1.1.tar.gz.
File metadata
- Download URL: sucharypython-0.1.1.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28dee0e226c0627519868d3afd4747a445b72e8e1bca0c0a52b6c89813d65db6
|
|
| MD5 |
fb897199d4868485c75476d67fd9ff25
|
|
| BLAKE2b-256 |
91b52ad776d9514e4413ff76bb92536752bce9f8602ab2163f20e2493a0146fd
|
File details
Details for the file sucharypython-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sucharypython-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
147a88d2a41297d461c6548bb84799158df9fde533255c1f9437b7a3c152ee55
|
|
| MD5 |
d16afe5cf26f47e5f3d081a57f8a44c5
|
|
| BLAKE2b-256 |
a10f506b7f65e1df2108fa9c10419fdb3a714884522cc8877cf3f174ace90d0a
|