pylyntr
A Python library for the lyntr.gizmowizard.tech API.
Installation
With uv (recommended)
uv init . # if pyproject.toml doesn't already exist
uv add "pylyntr @ git+https://codeberg.org/NotHMRC/pylyntr.git"
With pip
python3 -m venv .venv # if venv doesn't already exist
source .venv/bin/activate
pip install "pylyntr @ git+https://codeberg.org/NotHMRC/pylyntr.git"
Requires Python 3.11+.
Quick Start
from pylyntr import LyntrClient
client = LyntrClient(
client_id="CLIENT_ID",
client_secret="CLIENT_SECRET",
)
# Create a post
post = client.create_post("Hello from pylyntr!")
print(post.content)
# Get your profile
me = client.get_user()
print(f"@{me.handle} - {me.username}")
# Fetch the feed
for post in client.posts():
print(f"@{post.user.username}: {post.content}")
Get a client ID and secret from the Developer API page.
API Reference
LyntrClient
LyntrClient(
client_id: str,
client_secret: str,
api_url: str = "https://lyntr.gizmowizard.tech/api/v1",
max_retries: int = 3,
retry_delay: float = 1.0,
)
Constructs the client and validates credentials via test().
| Method | Returns | Description |
|---|---|---|
create_post(content) |
Post |
Create a post |
get_post(id) |
Post |
Fetch a post by ID |
delete_post(post) |
None |
Delete a post you own |
edit_post(post, content) |
None |
Edit a post you own |
get_comments(post) |
list[Post] |
Get comments on a post |
reply(post, reply) |
Post |
Reply to a post |
like_post(post) |
None |
Like a post |
unlike_post(post) |
None |
Unlike a post |
posts(feed_type) |
list[Post] |
Get posts from a feed (default FeedType.ForYou) |
latest_post() |
Post | None |
Get the most recent post from the New feed |
search(query) |
list[Post] |
Search posts by query |
get_user(handle) |
User |
Fetch a user by handle (defaults to self) |
follow_user(user) |
None |
Follow a user |
unfollow_user(user) |
None |
Unfollow a user |
update_profile(bio, username, name_colour) |
None |
Update your profile bio, username, or name colour |
test() |
None |
Validate credentials (called automatically on init) |
FeedType
An enum used with client.posts():
FeedType.ForYou- algorithmFeedType.New- latest postsFeedType.Following- posts from followed users
Post
A dataclass with fields: id, content, created_at, reposted, has_image, views, likes, reposts, comments, liked_by_user, reposted_by_user, liked_by_followed, user, referenced_lynts, edited_at, gif_url, gif_preview_url, poll.
User
A dataclass with fields: id, handle, bio, created_at, username, iq, verified, lynt_coins, admin, contributor, login_streak, followers, follows_user, name_colour, following.
AI
An LLM (DeepSeek V4 Pro) was used to help write this README and a portion of LyntrClient.api_request(), and to review the code.
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 pylyntr-0.2.0.tar.gz.
File metadata
- Download URL: pylyntr-0.2.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ultramarine Linux","version":"44","id":"flyingfish","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 |
800408d8a49c869b344f23a53d6f31d0991b278bd3a6c4fa10a10bf8baec13cb
|
|
| MD5 |
88b1daa09e3b5ec8700dea813215e7c3
|
|
| BLAKE2b-256 |
cb08e02edec28a246d1be8a4c0a05a3e7e3501856c842481783bc9da963c9fd4
|
File details
Details for the file pylyntr-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pylyntr-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ultramarine Linux","version":"44","id":"flyingfish","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 |
5c0be4ca6f21c7cd9be10a13a8d68c5d4541851d8001a3548808831a9f13f5a0
|
|
| MD5 |
e5c02d5e61058a68fedb8184cef7d7d1
|
|
| BLAKE2b-256 |
e44289b68240bc3f3f5f54900c9ebd2ea3662a124f69e65e9bfb8077d762202f
|