get_ad & get_user functions, extended user info (badges, feedback, pro), and new usage examples

This commit is contained in:
etienne-hd
2025-06-26 23:36:54 +02:00
parent 241645baae
commit 5841f55b20
20 changed files with 584 additions and 180 deletions

20
examples/get_user.py Normal file
View File

@@ -0,0 +1,20 @@
"""Get detailed information about a Leboncoin user using their user ID."""
import lbc
def main() -> None:
# Initialize the Leboncoin API client
client = lbc.Client()
# Fetch a user by their Leboncoin user ID
# Replace the ID with a real one for testing
user = client.get_user("01234567-89ab-cdef-0123-456789abcdef")
# Print raw user attributes
print("User ID:", user.id)
print("Name:", user.name)
print("Pro status:", user.is_pro)
print("Ads count:", user.total_ads)
if __name__ == "__main__":
main()