Farcaster plugin for elizaOS - Python implementation for casting and receiving messages
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elizaos_plugin_farcaster-2.0.0a5.tar.gz.
File metadata
- Download URL: elizaos_plugin_farcaster-2.0.0a5.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88f734cdc4318f0290194ae254c0a7417876adeb1ba345591fc14438a6b4ee3d
|
|
| MD5 |
c65e43253d9b613f121ed53316e67d10
|
|
| BLAKE2b-256 |
b3adea1b4770beaf2577bb3d5fc12232f344586a921091690dd25346870d4c7b
|
File details
Details for the file elizaos_plugin_farcaster-2.0.0a5-py3-none-any.whl.
File metadata
- Download URL: elizaos_plugin_farcaster-2.0.0a5-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b08bd9f29e3ecc61e4ce62ffb2408cb5030c76a06af7ed63efbec2fa5998d621
|
|
| MD5 |
5e82ff9898bb5f1933e9369c4cbd743e
|
|
| BLAKE2b-256 |
6a91ec176401581d4e1b1c4f5dd6dab43a7e6878c72cee5deaa67af3170f9738
|