Skip to main content

lightweight library for building farcaster frames using python and flask

Project description

framelib

lightweight library for building farcaster frames using python and flask

  • easily render frames that conform to the farcaster specification
  • configurable frame design
  • parse frame action messages
  • verify the frame action signatures using neynar
  • query user profile info from warpcast
  • on-chain frame transactions

quickstart

install framelib from pip

pip install framelib

simple example

from flask import Flask, url_for
from framelib import frame

app = Flask(__name__)

@app.route('/')
def home():
    return frame(
        image='https://opengraph.githubassets.com/0x/devinaconley/python-frames',
        button1='next',
        post_url=url_for('second_page', _external=True),
    )

examples

see a complete example using python + flask + vercel here

for an example that uses on-chain frame transactions, see the weth frame

and for a more advanced example involving multiplayer games, supabase integration, dynamic image rendering, and more, see rock paper scissors

roadmap

upcoming features and improvements

  • mint actions
  • eip 712 signatures
  • generated library documentation
  • dynamic image rendering tools
  • compatibility with other web frameworks
  • state signing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

framelib-0.0.5.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

framelib-0.0.5-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file framelib-0.0.5.tar.gz.

File metadata

  • Download URL: framelib-0.0.5.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for framelib-0.0.5.tar.gz
Algorithm Hash digest
SHA256 018ceec901c62fd42244e753d35dde8af7ff0e88de5f8d05ccc051458c024d34
MD5 e56cdd5a36b0a1fe39eaf83363a9e1bf
BLAKE2b-256 da10ef124e3f8473138e4bbe9aab6bee7754a8a3564639b21bb4e7efae79b405

See more details on using hashes here.

File details

Details for the file framelib-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: framelib-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for framelib-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 deee740efbe10f11f8c76802d5d27a6baf8fb05c3f473bf7d598c9cb39e29b07
MD5 2adfd3a9af021948c00ecc8feee3f6a4
BLAKE2b-256 86e6b5e2c6a682763e3c6a695546b2eb3256a2e8d27744c3e195b11e6a3409a2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page