contentflow 0.4.0__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,259 @@
1
+ Metadata-Version: 2.4
2
+ Name: contentflow
3
+ Version: 1.2.0
4
+ Summary: Multi-platform AI marketing content generator with calendar, SEO optimizer, brand voices, and multi-language support
5
+ Author-email: Teyfik OZ <teyfikoz@yahoo.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/teyfikoz/contentflow
8
+ Project-URL: Repository, https://github.com/teyfikoz/contentflow
9
+ Project-URL: Issues, https://github.com/teyfikoz/contentflow/issues
10
+ Keywords: marketing,content,ai,copywriting,travel
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: requests>=2.31.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0; extra == "dev"
24
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
25
+ Provides-Extra: mcp
26
+ Requires-Dist: mcp>=1.0; extra == "mcp"
27
+ Requires-Dist: pydantic>=2.0; extra == "mcp"
28
+
29
+ # ContentFlow
30
+
31
+ **Multi-platform AI marketing content generator** — Instagram, LinkedIn, Twitter, TikTok, Email, Blog, SEO. Works offline with curated templates or online with HuggingFace AI.
32
+
33
+ [![PyPI version](https://badge.fury.io/py/contentflow.svg)](https://pypi.org/project/contentflow/)
34
+ [![Build](https://github.com/teyfikoz/contentflow/actions/workflows/publish.yml/badge.svg)](https://github.com/teyfikoz/contentflow/actions/workflows/publish.yml)
35
+ [![CI](https://github.com/teyfikoz/contentflow/actions/workflows/ci.yml/badge.svg)](https://github.com/teyfikoz/contentflow/actions/workflows/ci.yml)
36
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
37
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
38
+
39
+ ## Installation
40
+
41
+ ```bash
42
+ pip install contentflow
43
+ ```
44
+
45
+ ## Quick Start
46
+
47
+ ```python
48
+ from contentflow import ContentGenerator
49
+
50
+ gen = ContentGenerator()
51
+
52
+ # Generate platform-specific content
53
+ post = gen.generate("AI productivity tools", platform="linkedin", tone="professional")
54
+ print(post)
55
+
56
+ # Instagram ad copy for travel
57
+ copy = gen.generate_ad_copy("Istanbul", vibe="romantic", platform="Instagram")
58
+ print(copy)
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Features at a Glance
64
+
65
+ | Feature | Description |
66
+ |---------|-------------|
67
+ | `ContentGenerator` | Multi-platform content — 8 platforms, 5 brand voices, 5 languages |
68
+ | `ContentCalendar` | Weekly + monthly content calendars with auto-scheduling |
69
+ | `SEOOptimizer` | Meta tags, titles, blog outlines, keyword extraction |
70
+ | `score_content()` | Readability, engagement, hashtag quality, length fit scoring |
71
+ | `batch_generate()` | Generate content for multiple topics at once |
72
+ | **AI mode** | Optional HuggingFace Inference API (flan-t5-large) |
73
+ | **Offline mode** | 100% offline with 50+ curated templates |
74
+
75
+ ---
76
+
77
+ ## ContentGenerator — 8 Platforms
78
+
79
+ ```python
80
+ from contentflow import ContentGenerator
81
+
82
+ gen = ContentGenerator(brand_voice="startup")
83
+
84
+ platforms = ["instagram", "linkedin", "twitter", "tiktok", "email", "blog", "sms", "push"]
85
+ for platform in platforms:
86
+ content = gen.generate("product launch", platform=platform, tone="exciting")
87
+ print(f"[{platform.upper()}]", content[:80], "\n")
88
+ ```
89
+
90
+ ### Brand Voices
91
+
92
+ ```python
93
+ # Available: startup | enterprise | creative | minimal | friendly
94
+ gen_corp = ContentGenerator(brand_voice="enterprise")
95
+ gen_fun = ContentGenerator(brand_voice="creative")
96
+ gen_clean = ContentGenerator(brand_voice="minimal")
97
+
98
+ post = gen_corp.generate("quarterly results", platform="linkedin", tone="professional")
99
+ ```
100
+
101
+ ### Multi-language Support
102
+
103
+ ```python
104
+ gen_tr = ContentGenerator(language="tr")
105
+ gen_de = ContentGenerator(language="de")
106
+ gen_fr = ContentGenerator(language="fr")
107
+ gen_es = ContentGenerator(language="es")
108
+
109
+ tr_post = gen_tr.generate("dijital pazarlama", platform="instagram")
110
+ de_post = gen_de.generate("Digitales Marketing", platform="linkedin")
111
+ ```
112
+
113
+ ### Batch Generation
114
+
115
+ ```python
116
+ results = gen.batch_generate(
117
+ topics=["Paris", "Tokyo", "Istanbul", "New York"],
118
+ platform="instagram",
119
+ tone="adventurous",
120
+ )
121
+ for r in results:
122
+ print(f"{r['topic']}: {r['content'][:60]}...")
123
+ ```
124
+
125
+ ### Content Scoring
126
+
127
+ ```python
128
+ content = gen.generate("AI startup funding", platform="linkedin")
129
+ score = gen.score_content(content, platform="linkedin")
130
+
131
+ print(f"Readability: {score.readability:.0%}")
132
+ print(f"Engagement: {score.engagement:.0%}")
133
+ print(f"Hashtags: {score.hashtag_quality:.0%}")
134
+ print(f"Length fit: {score.length_fit:.0%}")
135
+ print(f"Overall: {score.overall:.0%}")
136
+ ```
137
+
138
+ ### AI Mode (HuggingFace)
139
+
140
+ ```python
141
+ import os
142
+ os.environ["HF_API_TOKEN"] = "hf_your_token_here"
143
+
144
+ gen = ContentGenerator() # auto-reads HF_API_TOKEN
145
+ ai_copy = gen.generate("sustainable fashion brand", platform="instagram", tone="authentic")
146
+ ```
147
+
148
+ ---
149
+
150
+ ## ContentCalendar — Weekly & Monthly Scheduling
151
+
152
+ ```python
153
+ from contentflow import ContentCalendar
154
+
155
+ cal = ContentCalendar()
156
+
157
+ # One week of content across platforms
158
+ week = cal.generate_week(
159
+ topic="machine learning for marketers",
160
+ platforms=["linkedin", "twitter", "instagram"],
161
+ )
162
+
163
+ print(f"Generated {len(week.posts)} posts")
164
+ for post in week.posts:
165
+ print(f" {post.day:10s} | {post.platform:10s} | {post.content[:60]}...")
166
+
167
+ # Export to dict (e.g. for a CMS or Notion API)
168
+ data = week.to_dict()
169
+ ```
170
+
171
+ ### Monthly Calendar
172
+
173
+ ```python
174
+ weeks = cal.generate_month(
175
+ topics=["AI tools", "productivity hacks", "startup lessons", "remote work"],
176
+ platforms=["linkedin", "twitter"],
177
+ )
178
+
179
+ for i, week in enumerate(weeks, 1):
180
+ print(f"Week {i}: {len(week.posts)} posts scheduled")
181
+ ```
182
+
183
+ ---
184
+
185
+ ## SEOOptimizer — Meta Tags & Blog Outlines
186
+
187
+ ```python
188
+ from contentflow import SEOOptimizer
189
+
190
+ seo = SEOOptimizer()
191
+
192
+ # Full meta bundle
193
+ bundle = seo.generate_meta(
194
+ "Istanbul travel guide 2026",
195
+ keywords=["Istanbul", "Turkey travel", "things to do in Istanbul"],
196
+ )
197
+ print(bundle)
198
+ # <title>Istanbul travel guide 2026 — Complete Guide for 2026</title>
199
+ # <meta name="description" content="...">
200
+ # <meta name="keywords" content="...">
201
+
202
+ # SEO title variants
203
+ print(seo.generate_title("Istanbul travel guide", style="how-to"))
204
+ print(seo.generate_title("Istanbul travel guide", style="list"))
205
+ print(seo.generate_title("Istanbul travel guide", style="question"))
206
+
207
+ # Blog post outline
208
+ outline = seo.generate_blog_outline("Top 10 AI tools for small businesses", sections=6)
209
+ for i, section in enumerate(outline, 1):
210
+ print(f"{i}. {section}")
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Full Pipeline Example
216
+
217
+ ```python
218
+ from contentflow import ContentGenerator, ContentCalendar, SEOOptimizer
219
+
220
+ brand = "TechStartup AI"
221
+ topic = "AI-powered customer service"
222
+
223
+ gen = ContentGenerator(brand_voice="startup", language="en")
224
+ cal = ContentCalendar(generator=gen)
225
+ seo = SEOOptimizer()
226
+
227
+ # Generate & score a LinkedIn post
228
+ post = gen.generate(topic, platform="linkedin", tone="professional")
229
+ score = gen.score_content(post, platform="linkedin")
230
+ print(f"Post score: {score.overall:.0%}\n{post}\n")
231
+
232
+ # Generate one week of content
233
+ week = cal.generate_week(topic, platforms=["linkedin", "twitter", "instagram"])
234
+ print(f"Scheduled {len(week.posts)} posts\n")
235
+
236
+ # SEO bundle for blog
237
+ bundle = seo.generate_meta(topic, keywords=["AI", "customer service", "automation"])
238
+ outline = seo.generate_blog_outline(f"How {topic} is changing business in 2026")
239
+ print(bundle.title)
240
+ for section in outline:
241
+ print(" →", section)
242
+ ```
243
+
244
+ ---
245
+
246
+ ## Travel Quotes (Backward Compat)
247
+
248
+ ```python
249
+ gen = ContentGenerator()
250
+ print(gen.get_travel_quote("Adventure")) # Amelia Earhart, Tolkien, Oprah...
251
+ print(gen.get_travel_quote("Culture")) # Mark Twain, Saint Augustine...
252
+ print(gen.get_travel_quote("Mindset")) # Hans Christian Andersen...
253
+ ```
254
+
255
+ ---
256
+
257
+ ## License
258
+
259
+ MIT — [Teyfik Öz](https://github.com/teyfikoz)
@@ -0,0 +1,231 @@
1
+ # ContentFlow
2
+
3
+ **Multi-platform AI marketing content generator** — Instagram, LinkedIn, Twitter, TikTok, Email, Blog, SEO. Works offline with curated templates or online with HuggingFace AI.
4
+
5
+ [![PyPI version](https://badge.fury.io/py/contentflow.svg)](https://pypi.org/project/contentflow/)
6
+ [![Build](https://github.com/teyfikoz/contentflow/actions/workflows/publish.yml/badge.svg)](https://github.com/teyfikoz/contentflow/actions/workflows/publish.yml)
7
+ [![CI](https://github.com/teyfikoz/contentflow/actions/workflows/ci.yml/badge.svg)](https://github.com/teyfikoz/contentflow/actions/workflows/ci.yml)
8
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pip install contentflow
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```python
20
+ from contentflow import ContentGenerator
21
+
22
+ gen = ContentGenerator()
23
+
24
+ # Generate platform-specific content
25
+ post = gen.generate("AI productivity tools", platform="linkedin", tone="professional")
26
+ print(post)
27
+
28
+ # Instagram ad copy for travel
29
+ copy = gen.generate_ad_copy("Istanbul", vibe="romantic", platform="Instagram")
30
+ print(copy)
31
+ ```
32
+
33
+ ---
34
+
35
+ ## Features at a Glance
36
+
37
+ | Feature | Description |
38
+ |---------|-------------|
39
+ | `ContentGenerator` | Multi-platform content — 8 platforms, 5 brand voices, 5 languages |
40
+ | `ContentCalendar` | Weekly + monthly content calendars with auto-scheduling |
41
+ | `SEOOptimizer` | Meta tags, titles, blog outlines, keyword extraction |
42
+ | `score_content()` | Readability, engagement, hashtag quality, length fit scoring |
43
+ | `batch_generate()` | Generate content for multiple topics at once |
44
+ | **AI mode** | Optional HuggingFace Inference API (flan-t5-large) |
45
+ | **Offline mode** | 100% offline with 50+ curated templates |
46
+
47
+ ---
48
+
49
+ ## ContentGenerator — 8 Platforms
50
+
51
+ ```python
52
+ from contentflow import ContentGenerator
53
+
54
+ gen = ContentGenerator(brand_voice="startup")
55
+
56
+ platforms = ["instagram", "linkedin", "twitter", "tiktok", "email", "blog", "sms", "push"]
57
+ for platform in platforms:
58
+ content = gen.generate("product launch", platform=platform, tone="exciting")
59
+ print(f"[{platform.upper()}]", content[:80], "\n")
60
+ ```
61
+
62
+ ### Brand Voices
63
+
64
+ ```python
65
+ # Available: startup | enterprise | creative | minimal | friendly
66
+ gen_corp = ContentGenerator(brand_voice="enterprise")
67
+ gen_fun = ContentGenerator(brand_voice="creative")
68
+ gen_clean = ContentGenerator(brand_voice="minimal")
69
+
70
+ post = gen_corp.generate("quarterly results", platform="linkedin", tone="professional")
71
+ ```
72
+
73
+ ### Multi-language Support
74
+
75
+ ```python
76
+ gen_tr = ContentGenerator(language="tr")
77
+ gen_de = ContentGenerator(language="de")
78
+ gen_fr = ContentGenerator(language="fr")
79
+ gen_es = ContentGenerator(language="es")
80
+
81
+ tr_post = gen_tr.generate("dijital pazarlama", platform="instagram")
82
+ de_post = gen_de.generate("Digitales Marketing", platform="linkedin")
83
+ ```
84
+
85
+ ### Batch Generation
86
+
87
+ ```python
88
+ results = gen.batch_generate(
89
+ topics=["Paris", "Tokyo", "Istanbul", "New York"],
90
+ platform="instagram",
91
+ tone="adventurous",
92
+ )
93
+ for r in results:
94
+ print(f"{r['topic']}: {r['content'][:60]}...")
95
+ ```
96
+
97
+ ### Content Scoring
98
+
99
+ ```python
100
+ content = gen.generate("AI startup funding", platform="linkedin")
101
+ score = gen.score_content(content, platform="linkedin")
102
+
103
+ print(f"Readability: {score.readability:.0%}")
104
+ print(f"Engagement: {score.engagement:.0%}")
105
+ print(f"Hashtags: {score.hashtag_quality:.0%}")
106
+ print(f"Length fit: {score.length_fit:.0%}")
107
+ print(f"Overall: {score.overall:.0%}")
108
+ ```
109
+
110
+ ### AI Mode (HuggingFace)
111
+
112
+ ```python
113
+ import os
114
+ os.environ["HF_API_TOKEN"] = "hf_your_token_here"
115
+
116
+ gen = ContentGenerator() # auto-reads HF_API_TOKEN
117
+ ai_copy = gen.generate("sustainable fashion brand", platform="instagram", tone="authentic")
118
+ ```
119
+
120
+ ---
121
+
122
+ ## ContentCalendar — Weekly & Monthly Scheduling
123
+
124
+ ```python
125
+ from contentflow import ContentCalendar
126
+
127
+ cal = ContentCalendar()
128
+
129
+ # One week of content across platforms
130
+ week = cal.generate_week(
131
+ topic="machine learning for marketers",
132
+ platforms=["linkedin", "twitter", "instagram"],
133
+ )
134
+
135
+ print(f"Generated {len(week.posts)} posts")
136
+ for post in week.posts:
137
+ print(f" {post.day:10s} | {post.platform:10s} | {post.content[:60]}...")
138
+
139
+ # Export to dict (e.g. for a CMS or Notion API)
140
+ data = week.to_dict()
141
+ ```
142
+
143
+ ### Monthly Calendar
144
+
145
+ ```python
146
+ weeks = cal.generate_month(
147
+ topics=["AI tools", "productivity hacks", "startup lessons", "remote work"],
148
+ platforms=["linkedin", "twitter"],
149
+ )
150
+
151
+ for i, week in enumerate(weeks, 1):
152
+ print(f"Week {i}: {len(week.posts)} posts scheduled")
153
+ ```
154
+
155
+ ---
156
+
157
+ ## SEOOptimizer — Meta Tags & Blog Outlines
158
+
159
+ ```python
160
+ from contentflow import SEOOptimizer
161
+
162
+ seo = SEOOptimizer()
163
+
164
+ # Full meta bundle
165
+ bundle = seo.generate_meta(
166
+ "Istanbul travel guide 2026",
167
+ keywords=["Istanbul", "Turkey travel", "things to do in Istanbul"],
168
+ )
169
+ print(bundle)
170
+ # <title>Istanbul travel guide 2026 — Complete Guide for 2026</title>
171
+ # <meta name="description" content="...">
172
+ # <meta name="keywords" content="...">
173
+
174
+ # SEO title variants
175
+ print(seo.generate_title("Istanbul travel guide", style="how-to"))
176
+ print(seo.generate_title("Istanbul travel guide", style="list"))
177
+ print(seo.generate_title("Istanbul travel guide", style="question"))
178
+
179
+ # Blog post outline
180
+ outline = seo.generate_blog_outline("Top 10 AI tools for small businesses", sections=6)
181
+ for i, section in enumerate(outline, 1):
182
+ print(f"{i}. {section}")
183
+ ```
184
+
185
+ ---
186
+
187
+ ## Full Pipeline Example
188
+
189
+ ```python
190
+ from contentflow import ContentGenerator, ContentCalendar, SEOOptimizer
191
+
192
+ brand = "TechStartup AI"
193
+ topic = "AI-powered customer service"
194
+
195
+ gen = ContentGenerator(brand_voice="startup", language="en")
196
+ cal = ContentCalendar(generator=gen)
197
+ seo = SEOOptimizer()
198
+
199
+ # Generate & score a LinkedIn post
200
+ post = gen.generate(topic, platform="linkedin", tone="professional")
201
+ score = gen.score_content(post, platform="linkedin")
202
+ print(f"Post score: {score.overall:.0%}\n{post}\n")
203
+
204
+ # Generate one week of content
205
+ week = cal.generate_week(topic, platforms=["linkedin", "twitter", "instagram"])
206
+ print(f"Scheduled {len(week.posts)} posts\n")
207
+
208
+ # SEO bundle for blog
209
+ bundle = seo.generate_meta(topic, keywords=["AI", "customer service", "automation"])
210
+ outline = seo.generate_blog_outline(f"How {topic} is changing business in 2026")
211
+ print(bundle.title)
212
+ for section in outline:
213
+ print(" →", section)
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Travel Quotes (Backward Compat)
219
+
220
+ ```python
221
+ gen = ContentGenerator()
222
+ print(gen.get_travel_quote("Adventure")) # Amelia Earhart, Tolkien, Oprah...
223
+ print(gen.get_travel_quote("Culture")) # Mark Twain, Saint Augustine...
224
+ print(gen.get_travel_quote("Mindset")) # Hans Christian Andersen...
225
+ ```
226
+
227
+ ---
228
+
229
+ ## License
230
+
231
+ MIT — [Teyfik Öz](https://github.com/teyfikoz)
@@ -0,0 +1,19 @@
1
+ """
2
+ ContentFlow v1.2.0 — Multi-platform AI marketing content generator with A/B testing.
3
+ """
4
+
5
+ __version__ = "1.2.0"
6
+
7
+ from .calendar import ContentCalendar, ContentWeek, ScheduledPost
8
+ from .generator import ContentGenerator, ContentScore
9
+ from .seo import MetaBundle, SEOOptimizer
10
+
11
+ __all__ = [
12
+ "ContentGenerator",
13
+ "ContentScore",
14
+ "ContentCalendar",
15
+ "ContentWeek",
16
+ "ScheduledPost",
17
+ "SEOOptimizer",
18
+ "MetaBundle",
19
+ ]
@@ -0,0 +1,157 @@
1
+ """ContentFlow — Content calendar generator."""
2
+ from __future__ import annotations
3
+
4
+ from dataclasses import dataclass, field
5
+ from datetime import date, timedelta
6
+ from typing import Optional
7
+
8
+ from .generator import ContentGenerator
9
+
10
+
11
+ @dataclass
12
+ class ScheduledPost:
13
+ """A single scheduled content post."""
14
+
15
+ day: str
16
+ platform: str
17
+ topic: str
18
+ content: str
19
+ scheduled_date: Optional[date] = None
20
+
21
+ def __str__(self) -> str:
22
+ return f"[{self.day} | {self.platform.upper()}] {self.content[:80]}..."
23
+
24
+
25
+ @dataclass
26
+ class ContentWeek:
27
+ """A week of scheduled content."""
28
+
29
+ topic: str
30
+ posts: list[ScheduledPost] = field(default_factory=list)
31
+
32
+ def to_dict(self) -> list[dict]:
33
+ return [
34
+ {
35
+ "day": p.day,
36
+ "platform": p.platform,
37
+ "topic": p.topic,
38
+ "content": p.content,
39
+ "scheduled_date": str(p.scheduled_date) if p.scheduled_date else None,
40
+ }
41
+ for p in self.posts
42
+ ]
43
+
44
+ def __repr__(self) -> str:
45
+ return f"ContentWeek(topic={self.topic!r}, posts={len(self.posts)})"
46
+
47
+
48
+ class ContentCalendar:
49
+ """
50
+ Generate structured weekly/monthly content calendars.
51
+
52
+ Args:
53
+ generator: ContentGenerator instance (creates one if not provided)
54
+ brand_voice: Brand voice profile name
55
+
56
+ Example::
57
+
58
+ from contentflow import ContentCalendar
59
+
60
+ cal = ContentCalendar()
61
+ week = cal.generate_week("AI productivity", platforms=["linkedin", "twitter", "instagram"])
62
+ for post in week.posts:
63
+ print(post)
64
+ """
65
+
66
+ WEEKDAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
67
+ DEFAULT_SCHEDULE = {
68
+ "linkedin": ["Monday", "Wednesday", "Friday"],
69
+ "instagram": ["Tuesday", "Thursday", "Saturday"],
70
+ "twitter": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
71
+ "tiktok": ["Wednesday", "Friday", "Sunday"],
72
+ "email": ["Tuesday"],
73
+ }
74
+
75
+ def __init__(self, generator: Optional[ContentGenerator] = None, brand_voice: str = "friendly"):
76
+ self.generator = generator or ContentGenerator(brand_voice=brand_voice)
77
+
78
+ def generate_week(
79
+ self,
80
+ topic: str,
81
+ platforms: Optional[list[str]] = None,
82
+ start_date: Optional[date] = None,
83
+ hashtag_category: str = "lifestyle",
84
+ ) -> ContentWeek:
85
+ """
86
+ Generate one week of content for a topic across platforms.
87
+
88
+ Args:
89
+ topic: Main content topic
90
+ platforms: List of platforms (default: linkedin, twitter, instagram)
91
+ start_date: Week start date (default: next Monday)
92
+ hashtag_category: Hashtag category for templates
93
+
94
+ Returns:
95
+ ContentWeek with scheduled posts
96
+ """
97
+ platforms = platforms or ["linkedin", "twitter", "instagram"]
98
+ week = ContentWeek(topic=topic)
99
+
100
+ if start_date is None:
101
+ today = date.today()
102
+ days_until_monday = (7 - today.weekday()) % 7 or 7
103
+ start_date = today + timedelta(days=days_until_monday)
104
+
105
+ day_map = {day: start_date + timedelta(days=i) for i, day in enumerate(self.WEEKDAYS)}
106
+
107
+ for platform in platforms:
108
+ posting_days = self.DEFAULT_SCHEDULE.get(platform, ["Monday", "Thursday"])
109
+ tone_map = {
110
+ "linkedin": "professional",
111
+ "twitter": "casual",
112
+ "instagram": "engaging",
113
+ "tiktok": "playful",
114
+ "email": "formal",
115
+ }
116
+ tone = tone_map.get(platform, "engaging")
117
+
118
+ for day in posting_days:
119
+ content = self.generator.generate(
120
+ topic=topic, platform=platform, tone=tone, hashtag_category=hashtag_category
121
+ )
122
+ post = ScheduledPost(
123
+ day=day,
124
+ platform=platform,
125
+ topic=topic,
126
+ content=content,
127
+ scheduled_date=day_map.get(day),
128
+ )
129
+ week.posts.append(post)
130
+
131
+ week.posts.sort(key=lambda p: self.WEEKDAYS.index(p.day))
132
+ return week
133
+
134
+ def generate_month(
135
+ self,
136
+ topics: list[str],
137
+ platforms: Optional[list[str]] = None,
138
+ start_date: Optional[date] = None,
139
+ ) -> list[ContentWeek]:
140
+ """
141
+ Generate four weeks of content from a list of topics.
142
+
143
+ Args:
144
+ topics: Topics to rotate through (min 1, max 4)
145
+ platforms: Target platforms
146
+ start_date: Month start date
147
+
148
+ Returns:
149
+ List of 4 ContentWeek objects
150
+ """
151
+ start = start_date or date.today()
152
+ weeks = []
153
+ for i in range(4):
154
+ topic = topics[i % len(topics)]
155
+ week_start = start + timedelta(weeks=i)
156
+ weeks.append(self.generate_week(topic, platforms=platforms, start_date=week_start))
157
+ return weeks