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 | Provenance | Actions |
|---|---|---|---|---|
| lobstr-0.5.0.tar.gz | 7.3 kB | Without provenance | Details for lobstr-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lobstr-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for lobstr-0.5.0-py3-none-any.whl |
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
|
Security for lobstr 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.