Skip to main content

pylyntr

A Python library for the lyntr.gizmowizard.tech API.

pylyntr is now on PyPI! This means you can do a simple uv add pylyntr or pip install pylyntr.

Installation

uv init . # if pyproject.toml doesn't already exist
uv add pylyntr

With pip

python3 -m venv .venv # if venv doesn't already exist
source .venv/bin/activate
pip install pylyntr

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 - algorithm
  • FeedType.New - latest posts
  • FeedType.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.

Contributing

The easiest way you can contribute to pylyntr is by finding bugs and reporting them in Codeberg issues. HTTPErrors from requests are considered bugs, as we're trying to minimise them as much as possible and raise more descriptive exception types.

Feature suggestions and pull requests are also welcome. PRs must target the next branch to be accepted.

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.

Metadata

Release files for pylyntr 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylyntr 0.3.0
File Size Uploaded
pylyntr-0.3.0.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pylyntr 0.3.0
File Interpreter ABI Platform
pylyntr-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.7 kB

Release files / pylyntr-0.3.0.tar.gz

Download URL pylyntr-0.3.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2b0406b796dd16e0f09443cd478981c6f11abbe1b154e4c790573472abdb45be
BLAKE2b-256 checksum
How to use checksums
4cfd9e2dc5f07adb86ac744ecafe6c43ea4792c8da2b99c9a9a67c4a07bee525
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / pylyntr-0.3.0-py3-none-any.whl

Download URL pylyntr-0.3.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
054b7d4846b6bfc311b5acf059ad17ad323bcf82c4796e443ba700354396a678
BLAKE2b-256 checksum
How to use checksums
8c2c2c3cfecdeee5268ae3726e01ad335278d9d85bd197efced3b9682c3f27c2
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page