Metadata-Version: 2.4
Name: stapel-feed
Version: 0.1.0
Summary: Posts, comments, reactions and feeds for the Stapel framework
License: MIT
Project-URL: Homepage, https://github.com/usestapel/stapel-feed
Project-URL: Repository, https://github.com/usestapel/stapel-feed
Project-URL: Documentation, https://github.com/usestapel/stapel-feed#readme
Project-URL: Changelog, https://github.com/usestapel/stapel-feed/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/usestapel/stapel-feed/issues
Keywords: django,stapel,feed,posts,comments,reactions,social
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: stapel-core<1.0,>=0.99.3
Provides-Extra: all
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-django; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: stapel-tools<1,>=0.84.0; extra == "test"
Requires-Dist: jsonschema>=4; extra == "test"
Dynamic: license-file

<!-- Generated by stapel-readme from docs/readme.md + docs/*.json. Do not edit this file; edit docs/readme.md and re-run `make readme`. -->

# stapel-feed

[![CI](https://img.shields.io/github/actions/workflow/status/usestapel/stapel-feed/ci.yml?branch=main&logo=github&label=CI)](https://github.com/usestapel/stapel-feed/actions/workflows/ci.yml?query=branch%3Amain)
[![coverage](https://img.shields.io/codecov/c/github/usestapel/stapel-feed?branch=main&logo=codecov&label=coverage)](https://app.codecov.io/gh/usestapel/stapel-feed)
[![pypi](https://img.shields.io/pypi/v/stapel-feed?logo=pypi&logoColor=white&label=pypi)](https://pypi.org/project/stapel-feed/)
[![downloads](https://static.pepy.tech/badge/stapel-feed/month)](https://pepy.tech/project/stapel-feed)
[![python](https://img.shields.io/pypi/pyversions/stapel-feed?logo=python&logoColor=white)](https://pypi.org/project/stapel-feed/)
[![license](https://img.shields.io/github/license/usestapel/stapel-feed)](https://github.com/usestapel/stapel-feed/blob/main/LICENSE)
[![llms.txt](https://img.shields.io/badge/llms.txt-blue)](https://github.com/usestapel/stapel-feed/blob/main/docs/llms.txt)

> Posts, comments, reactions and feeds for a community. Members post plain-text updates with up to ten uploaded pictures, public or for followers; others comment (flat, no threads) and react (one reaction per user per target, toggled, counted on the target in the same transaction). Four anchor-paginated reads: home (followed authors and own posts), public, one author's posts, one post with its comments. Following and blocks are read from profiles through one comm Function (profiles.social_graph); when it cannot be asked, home and public answer 503 rather than show a blocked author. Moderation takes a post or comment down through the moderation.completed verdict; GDPR erasure is a hard delete with counters recomputed.

Part of the [Stapel framework](https://github.com/usestapel) — composable Django apps that deploy as a monolith or as microservices without changing module code.

## Install

```bash
pip install stapel-feed
```

## At a glance

| Fact | Value |
|---|---|
| Version | `0.1.0` |
| Python | `>=3.11` (3.11, 3.12, 3.13, 3.14) |
| HTTP operations | 11 |
| Config axes | 2 |
| Usage surface | 2 |
| Extension points | 6 |
| Error codes | 54 |
| Documented flows | 3 |
| Fleet dependencies | [`stapel-cdn`](https://github.com/usestapel/stapel-cdn) (optional) · [`stapel-core`](https://github.com/usestapel/stapel-core) · [`stapel-moderation`](https://github.com/usestapel/stapel-moderation) (optional) · [`stapel-notifications`](https://github.com/usestapel/stapel-notifications) (optional) · [`stapel-profiles`](https://github.com/usestapel/stapel-profiles) |

## Documentation

**Errors:** [English](https://github.com/usestapel/stapel-feed/blob/main/docs/errors.en.md) · [Español](https://github.com/usestapel/stapel-feed/blob/main/docs/errors.es.md) · [Русский](https://github.com/usestapel/stapel-feed/blob/main/docs/errors.ru.md) · [OpenAPI](https://github.com/usestapel/stapel-feed/blob/main/docs/schema.json) · [capabilities.json](https://github.com/usestapel/stapel-feed/blob/main/docs/capabilities.json) · [llms.txt (for agents)](https://github.com/usestapel/stapel-feed/blob/main/docs/llms.txt)

## What this is

Posts, comments, reactions and feeds for a Stapel community. Members post
plain-text updates with a few pictures; others comment and react; everyone
reads a home feed of the people they follow, a public feed, one author's
posts and one post with its comments. Following and blocks stay in
stapel-profiles and are read through one comm Function — the feed never
imports a sibling module.

## Quick start

```python
INSTALLED_APPS = [
    # ...
    "stapel_profiles",   # profiles.social_graph (>=0.23), profiles.public_cards
    "stapel_feed",
]

# urls.py
path("feed/api/", include("stapel_feed.urls"))   # -> /feed/api/v1/...

# Optional
STAPEL_FEED = {
    "PUBLIC_READ": True,            # anonymous visitors read public surfaces
    "WRITE_REQUIRES_ACCOUNT": True, # guests may not post, comment or react
    "REACTION_KINDS": ("like", "heart"),
}
```

## Concepts

- **Post** — `body` ≤ 2000 plain characters, ≤ 10 opaque CDN refs
  (`<kind>/<hash>`), `public` or `followers`. The author edits it within
  `EDIT_WINDOW_MINUTES` (15) and deletes it any time (soft).
- **Comment** — flat, ≤ 1000 characters; deleted by its author or the post's
  author. The post author is notified (`feed.comment_received`).
- **Reaction** — one per user per target, toggled with `PUT reactions/`
  (or set with `active`); counts move in the same transaction, recomputed
  from the rows under a row lock, so two writers cannot lose an update.
- **Reads** — `home/` (followed authors + own), `public/`,
  `authors/<id>/posts/`, `posts/<id>/` and its `comments/`; all
  anchor-paginated. Followers-only posts reach followers only; blocked
  authors are hidden in both directions; hidden answers like absent (404).
- **The 503 rule** — when `profiles.social_graph` cannot be asked, `home/`
  and members' `public/` answer `error.503.social_graph_unavailable` rather
  than show a blocked author. One author's page and one post degrade to
  public-only content.
- **Moderation** — `post` and `comment` target types read
  `feed.moderation_content`; a rejecting verdict hides the target (the
  author sees `blocked`).
- **GDPR** — erasure hard-deletes the person's posts, comments and
  reactions and recomputes the counters they touched.

## License

MIT — see [LICENSE](https://github.com/usestapel/stapel-feed/blob/main/LICENSE).

---

<sub>This page is assembled by `stapel-readme` from `docs/readme.md` plus the contract artifacts in `docs/`. Edit the prose in `docs/readme.md`; the badges, facts and links above and below it are generated — do not hand-edit `README.md`.</sub>
