lobstr
lobstr is an unofficial async-first object-oriented api wrapper for lobste.rs.
the library only supports GET requests or read operations.
It plans to support the following objects
- feeds (homepage, newest, by tags, etc)
- stories (the post + comments)
- comments (info about a singular comment)
- tags (info regarding a tag, list of all tags)
- search (search for stories, comments, users)
Table of Contents
Features
- Async-first API built on
httpx - Fully typed Pydantic models
- Well-documented sdk with docstrings
Installation
Requires Python 3.10 or higher.
pip
pip install lobstr
uv
uv add lobstr
Poetry
poetry add lobstr
Pipenv
pipenv install lobstr
Quick Start
Fetch a Story
import asyncio
from lobstr import Lobster
async def main():
async with Lobster() as lob:
story = await lob.story(short_id="ishgbs")
print(story.title) # title of the story
print(story.username) # author's username
print(story.article_url) # article attached to the story
asyncio.run(main())
Fetch Hottest Stories
import asyncio
from lobstr import Lobster
async def main():
async with Lobster() as lob:
stories = await lob.feeds.hot()
for story in stories[:5]: # print the top 5 hottest stories
print(story.title) # title of the story
print(story.username) # author's username
print(story.article_url) # article attached to the story
asyncio.run(main())
Documentation
Complete documentation, API reference, guides, and examples are available at:
https://kavin81.github.io/lobstr
For lobste.rs API documentation, API_SPEC.md.
License
Metadata
Release files for lobstr 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lobstr-0.5.0.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lobstr-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.0 kB
Release files / lobstr-0.5.0.tar.gz
| Download URL | lobstr-0.5.0.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f893550e1360114db0f736a4a8ee5c52939aa9cbb3d6b097d204c1adacd6334e
|
|
BLAKE2b-256 checksum How to use checksums |
fd44d9ed7e83bb4110967ba2f7a66fe13698ff1ac995fd5eb47c3376cecd76e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Release files / lobstr-0.5.0-py3-none-any.whl
| Download URL | lobstr-0.5.0-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfd384a8786b9292a08b5cddc7fe212486e672d05ea223c28d02011986358f8e
|
|
BLAKE2b-256 checksum How to use checksums |
5feeedebf6944de7f9ec69f2bfc6499782d0bf7ea3dcfe5b4c8a2846c53d9606
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|