Pre-release
This release is a pre-release and may not be stable for production use.
elizaOS Farcaster Plugin - Python
A Python implementation of the Farcaster plugin for elizaOS, providing full integration with the Farcaster decentralized social network via the Neynar API.
Features
- Cast Management: Send casts, reply to casts, and manage your timeline
- Profile Management: Fetch and cache user profiles
- Mentions & Notifications: Monitor and respond to mentions
- Timeline Provider: Access your Farcaster feed
- Thread Support: Navigate and respond within cast threads
- Embed Processing: Handle images, videos, and embedded casts
Installation
pip install elizaos-plugin-farcaster
Or with development dependencies:
pip install elizaos-plugin-farcaster[dev]
Configuration
The plugin requires the following environment variables:
| Variable | Required | Description |
|---|---|---|
FARCASTER_FID |
Yes | Your Farcaster ID (FID) |
FARCASTER_SIGNER_UUID |
Yes | Neynar signer UUID for signing casts |
FARCASTER_NEYNAR_API_KEY |
Yes | Neynar API key for API access |
FARCASTER_DRY_RUN |
No | Enable dry run mode (default: false) |
FARCASTER_MODE |
No | Operation mode: 'polling' or 'webhook' (default: polling) |
MAX_CAST_LENGTH |
No | Maximum cast length (default: 320) |
FARCASTER_POLL_INTERVAL |
No | Polling interval in seconds (default: 120) |
Usage
Basic Usage
from elizaos_plugin_farcaster import FarcasterClient, FarcasterConfig
# Load configuration from environment
config = FarcasterConfig.from_env()
# Create client
client = FarcasterClient(config)
# Send a cast
async def main():
cast = await client.send_cast("Hello from elizaOS! 🤖")
print(f"Cast sent: {cast.hash}")
# Get your profile
profile = await client.get_profile(config.fid)
print(f"Username: {profile.username}")
# Run
import asyncio
asyncio.run(main())
With elizaOS Runtime
from elizaos_plugin_farcaster import farcaster_plugin
# Register with agent runtime
runtime.register_plugin(farcaster_plugin)
Development
Running Tests
cd python
pytest
Type Checking
mypy elizaos_plugin_farcaster
Linting
ruff check .
ruff format .
API Reference
FarcasterClient
The main client for interacting with Farcaster via Neynar.
send_cast(text, reply_to=None)- Send a new castget_cast(hash)- Get a cast by hashget_profile(fid)- Get a user profile by FIDget_mentions(limit=20)- Get mentions for the configured FIDget_timeline(limit=50)- Get the user's timeline
Types
Cast- Represents a Farcaster castProfile- Represents a Farcaster user profileCastEmbed- Represents embedded content in a castFarcasterConfig- Configuration for the Farcaster client
License
MIT License - see LICENSE file for details.
Metadata
Release files for elizaos-plugin-farcaster 2.0.0a5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| elizaos_plugin_farcaster-2.0.0a5.tar.gz | 14.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| elizaos_plugin_farcaster-2.0.0a5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.9 kB
Release files / elizaos_plugin_farcaster-2.0.0a5.tar.gz
| Download URL | elizaos_plugin_farcaster-2.0.0a5.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88f734cdc4318f0290194ae254c0a7417876adeb1ba345591fc14438a6b4ee3d
|
|
BLAKE2b-256 checksum How to use checksums |
b3adea1b4770beaf2577bb3d5fc12232f344586a921091690dd25346870d4c7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / elizaos_plugin_farcaster-2.0.0a5-py3-none-any.whl
| Download URL | elizaos_plugin_farcaster-2.0.0a5-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b08bd9f29e3ecc61e4ce62ffb2408cb5030c76a06af7ed63efbec2fa5998d621
|
|
BLAKE2b-256 checksum How to use checksums |
6a91ec176401581d4e1b1c4f5dd6dab43a7e6878c72cee5deaa67af3170f9738
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|