Skip to content

Social-Arena/Feed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feed - Twitter Data Structure Library

Installation

git clone https://github.com/Social-Arena/Feed
cd Feed
pip install -e .

Quick Start

import feed

# Create tweet
tweet = feed.Feed(
    id=feed.generate_feed_id(),
    text="Hello Twitter! #Python",
    author_id="user_123"
)

# Extract entities
tweet.entities = feed.extract_entities(tweet.text)

# Save/Load (one feed = one JSON)
feed.save_feed(tweet, "tweets/my_tweet.json")
loaded = feed.load_feed("tweets/my_tweet.json")

Models

Feed - Main tweet structure
FeedType - POST, REPLY, QUOTE, RETWEET, THREAD
Entities - Hashtags, mentions, URLs
PublicMetrics - Engagement counts
User - User profile

Usage

# Create
tweet = feed.Feed(id=feed.generate_feed_id(), text="Hello!", author_id="user1")

# Entities
tweet.entities = feed.extract_entities(tweet.text)

# Metrics
tweet.public_metrics.like_count = 100

# Save/Load
feed.save_feed(tweet, "tweets/tweet.json")
loaded = feed.load_feed("tweets/tweet.json")

Requirements

Python 3.8+ • Pydantic runtime validation

License

MIT

About

This is the basic data structure of the Arena - identical to a Twitter Feed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages