Metadata-Version: 2.3
Name: longwei
Version: 1.0.0.dev0
Summary: Python client library for ActivityPub-compatible servers
Author: marvin8
Author-email: marvin8 <marvin8@tuta.io>
License: AGPL-3.0-or-later
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: httpx[http2,zstd]~=0.28.1
Requires-Dist: pydantic~=2.12.5
Requires-Dist: pytz~=2026.1.post1
Requires-Dist: whenever~=0.9.5
Requires-Python: >=3.11, <3.15
Project-URL: Changelog, https://codeberg.org/MarvinsMastodonTools/longwei/src/branch/main/CHANGELOG.md
Project-URL: Documentation, https://marvinsmastodontools.codeberg.page/longwei/
Project-URL: Issues, https://codeberg.org/MarvinsMastodonTools/longwei/issues
Project-URL: Source, https://codeberg.org/MarvinsMastodonTools/longwei
Description-Content-Type: text/markdown

# longwei

[![Repo](https://img.shields.io/badge/repo-Codeberg.org-blue)](https://codeberg.org/MarvinsMastodonTools/longwei "Repo at Codeberg.org")
[![CI](https://ci.codeberg.org/api/badges/MarvinsMastodonTools/longwei/status.svg)](https://ci.codeberg.org/MarvinsMastodonTools/longwei "CI / Woodpecker")
[![Downloads](https://pepy.tech/badge/longwei)](https://pepy.tech/project/longwei "Download count")
[![uv_secure](https://img.shields.io/badge/uv--secure-checked-green)](https://docs.astral.sh/uv/guides/audit/ "Checked with uv-secure")
[![gitleaks](https://img.shields.io/badge/gitleaks-checked-green)](https://github.com/gitleaks/gitleaks "Checked with gitleaks")
[![pysentry](https://img.shields.io/badge/pysentry-checked-green)](https://github.com/astral-sh/pysentry "Checked with pysentry")
[![complexipy](https://img.shields.io/badge/complexipy-checked-green.svg)](https://github.com/rohaquinlop/complexipy "Checked with complexipy")
[![Codestyle](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff "Code style: ruff")
[![Version](https://img.shields.io/pypi/pyversions/longwei)](https://pypi.org/project/longwei "PyPI – Python Version")
[![Wheel](https://img.shields.io/pypi/wheel/longwei)](https://pypi.org/project/longwei "PyPI – Wheel")
[![License: AGPL-3.0-or-later](https://img.shields.io/badge/License-AGPL--3.0--or--later-blue.svg)](https://spdx.org/licenses/AGPL-3.0-or-later.html "AGPL 3 or later")

Longwei is a minimal Python implementation of the ActivityPub REST API used by [Mastodon](https://joinmastodon.org/), [Pleroma](https://pleroma.social/), [GotoSocial](https://gotosocial.org/), and [Takahe](https://jointakahe.org/). This implementation makes use of asyncio where appropriate. It is intended to be used as a library by other applications. No standalone functionality is provided.

So far Longwei only implements the activtiy pub API calls I need for my other projects [Fedinesia](https://codeberg.org/MarvinsMastodonTools/fedinesia), [Feed2Fedi](https://codeberg.org/marvinsmastodontools/feed2fedi), [FenLiu and Zhongli](https://codeberg.org/marvinsmastodontools/dujiangyan).

**DO NOT** expect a full or complete implementation of all [ActivityPub API](https://activitypub.rocks/) functionality.

## API References

- [Mastodon API](https://docs.joinmastodon.org/api/)
- [Pleroma API](https://api.pleroma.social)
- [GotoSocial API](https://docs.gotosocial.org/en/stable/api/swagger/)

## Heavy Development / Breaking Changes

I have only just forked this from minimal_activitypub and am still working on it. Expect some major changes still and some breaking changes.
It is **not** a drop in replacement and will need some adjustments, even when I am done with the rework.

I advise not to use this at until at least version 1.0.0 (non dev)


## Contributing

Issues and pull requests are welcome.

longwei is using [pre-commit](https://pre-commit.com/) for code quality checks and [uv](https://docs.astral.sh/uv/) for dependency management. Please install and use both pre-commit and uv if you'd like to contribute.

## Documentation

The documentation is built using [MkDocs](https://www.mkdocs.org/) with the [Material theme](https://squidfunk.github.io/mkdocs-material/).

### Building Documentation Locally

```bash
# Install documentation dependencies (using the docs group from pyproject.toml)
uv sync --group docs

# Build documentation
mkdocs build

# Serve documentation locally
mkdocs serve
```

### Documentation Structure

- `docs/` - Markdown source files
- `mkdocs.yml` - MkDocs configuration

## Development

This project uses [uv](https://docs.astral.sh/uv/) for dependency management and virtual environments. To set up the development environment:

```bash
# Create and activate virtual environment
uv venv
source .venv/bin/activate

# Install all dependencies including development and documentation groups
uv sync --all-groups

# Run tests
uv run nox
```

For more details on the development workflow, check the `noxfile.py` and `.woodpecker/` configuration files.

## Licensing

longwei is licenced with the [GNU Affero General Public License v3.0](http://www.gnu.org/licenses/agpl-3.0.html)

## Supporting longwei

There are a number of ways you can support longwei:

- Create an issue with problems or ideas you have with/for longwei
- You can [buy me a coffee](https://www.buymeacoffee.com/marvin8).
- You can send me small change in Monero to the address below:

### Monero donation address
`8ADQkCya3orL178dADn4bnKuF1JuVGEG97HPRgmXgmZ2cZFSkWU9M2v7BssEGeTRNN2V5p6bSyHa83nrdu1XffDX3cnjKVu`
