Observed since 20 Oct, 19:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Official Python client SDK for Adam Network API
A clean, strongly-typed Python client for interacting with the Adam Network API.
urllib — zero mandatory third-party runtime dependencies.message_reply_{id}).with AdamClient(...) as client:.AuthenticationError, ValidationError, NotFoundError, ServerError, ConnectionError).To impose a computational cost on message publishing and combat spam, Adam Network requires a 6-character reverse SHA-1 preimage challenge for every posted message.
The AdamClient handles this completely automatically in create_message() and reply_to_message(). You can also manually fetch and solve challenges if needed:
# Automatic (fetches challenge, solves reverse SHA-1 in multi-threaded C/hashlib, and submits):
msg = client.post_message(text="Hello world!", tags=["news"])
# Manual inspection or solving:
challenge = client.get_challenge()
print(f"Target SHA-1 Hash: {challenge.hash}")
# Solve reverse SHA-1 (searches 000000..ffffff across CPU threads in <1 second)
solution = AdamClient.solve_challenge(challenge.hash)
print(f"Computed 6-char solution: {solution}")
# Post with pre-solved challenge:
msg = client.post_message(
text="Hello with pre-computed PoW!",
challenge=challenge,
solution=solution,
)
Install the package directly from PyPI:
pip install adam-network-client
Import AdamClient into your project:
from adam_network import (
AdamClient,
AdamAPIError,
AuthenticationError,
ValidationError,
NotFoundError,
Message,
User,
Token,
)
# You can also import via the `client` namespace:
# from client import AdamClient
from client import AdamClient
# Initialize client (defaults to https://adam-network.up.railway.app)
client = AdamClient()
# Or specify a custom/local base URL:
# client = AdamClient(base_url="http://127.0.0.1:8000")
# Register
user = client.register(
username="alice",
email="alice@example.com",
password="my-secure-password",
)
# Login (automatically stores JWT in client)
token = client.login(username="alice", password="my-secure-password")
print(f"Logged in: {token.access_token}")
# Get current user
me = client.get_me()
print(f"Current user: {me.username}")
# Post a message
msg = client.post_message(
text="Hello World from Python Client!",
tags=["welcome", "python"],
)
print(f"Created message #{msg.id}")
# Post a reply
reply = client.reply_to_message(
message_id=msg.id,
text="This is a reply to the first post.",
)
# Fetch all messages
all_messages = client.get_messages(limit=50)
# Search messages
results = client.search_messages(search_text="Hello", tags="python")
# Fetch thread replies
thread = client.get_replies(message_id=msg.id)
# Logout
client.logout()
You can attach images using a file path, raw bytes, or base64 Data URLs:
# From a local image file:
client.post_message(
text="Check out this diagram",
tags=["diagram"],
image_file="/path/to/image.png",
)
# From raw bytes:
with open("photo.jpg", "rb") as f:
img_bytes = f.read()
client.post_message(
text="Byte attachment",
tags=["photo"],
image_bytes=img_bytes,
image_mime_type="image/jpeg",
)
AdamClient(base_url="http://127.0.0.1:8000", token=None, timeout=30.0)register(username, email, password, confirm_password=None) -> Userlogin(username, password) -> Tokenlogout() -> LogoutResponseget_me() -> Userget_challenge() -> Challengesolve_challenge(target_hash: str, num_threads: Optional[int] = None) -> str (static method)create_message(text, tags=None, image_data=None, image_file=None, image_bytes=None, image_mime_type="image/png", created_at=None, challenge=None, solution=None) -> Messagepost_message(...) -> Message (alias of create_message)get_messages(skip=0, limit=1000) -> List[Message]get_message(message_id) -> Messagesearch_messages(search_text=None, tags=None, skip=0, limit=1000) -> List[Message]reply_to_message(message_id, text, tags=None, image_data=None, image_file=None, image_bytes=None, image_mime_type="image/png") -> Messageget_replies(message_id, skip=0, limit=1000) -> List[Message]encode_image_file(file_path) -> str (Data URL)encode_image_bytes(data, mime_type="image/png") -> str (Data URL)python -m client.example http://127.0.0.1:8000
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 2 Sept 2026 | 7 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7075d98f8149b220a058d70d46aea626a0d8d190d61927d26daac8cf974ca0bb