contentflow 0.4.0__tar.gz → 1.1.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.
- contentflow-1.1.0/PKG-INFO +255 -0
- contentflow-1.1.0/README.md +230 -0
- contentflow-1.1.0/contentflow/__init__.py +19 -0
- contentflow-1.1.0/contentflow/calendar.py +157 -0
- contentflow-1.1.0/contentflow/generator.py +409 -0
- contentflow-1.1.0/contentflow/seo.py +153 -0
- contentflow-1.1.0/contentflow.egg-info/PKG-INFO +255 -0
- {contentflow-0.4.0 → contentflow-1.1.0}/contentflow.egg-info/SOURCES.txt +2 -0
- {contentflow-0.4.0 → contentflow-1.1.0}/pyproject.toml +3 -3
- contentflow-1.1.0/tests/test_basic.py +146 -0
- contentflow-0.4.0/PKG-INFO +0 -67
- contentflow-0.4.0/README.md +0 -42
- contentflow-0.4.0/contentflow/__init__.py +0 -7
- contentflow-0.4.0/contentflow/generator.py +0 -61
- contentflow-0.4.0/contentflow.egg-info/PKG-INFO +0 -67
- contentflow-0.4.0/tests/test_basic.py +0 -48
- {contentflow-0.4.0 → contentflow-1.1.0}/contentflow.egg-info/dependency_links.txt +0 -0
- {contentflow-0.4.0 → contentflow-1.1.0}/contentflow.egg-info/requires.txt +0 -0
- {contentflow-0.4.0 → contentflow-1.1.0}/contentflow.egg-info/top_level.txt +0 -0
- {contentflow-0.4.0 → contentflow-1.1.0}/setup.cfg +0 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: contentflow
|
|
3
|
+
Version: 1.1.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
|
+
|
|
26
|
+
# ContentFlow
|
|
27
|
+
|
|
28
|
+
**Multi-platform AI marketing content generator** — Instagram, LinkedIn, Twitter, TikTok, Email, Blog, SEO. Works offline with curated templates or online with HuggingFace AI.
|
|
29
|
+
|
|
30
|
+
[](https://pypi.org/project/contentflow/)
|
|
31
|
+
[](https://github.com/teyfikoz/contentflow/actions/workflows/ci.yml)
|
|
32
|
+
[](https://www.python.org/)
|
|
33
|
+
[](https://opensource.org/licenses/MIT)
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install contentflow
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Quick Start
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from contentflow import ContentGenerator
|
|
45
|
+
|
|
46
|
+
gen = ContentGenerator()
|
|
47
|
+
|
|
48
|
+
# Generate platform-specific content
|
|
49
|
+
post = gen.generate("AI productivity tools", platform="linkedin", tone="professional")
|
|
50
|
+
print(post)
|
|
51
|
+
|
|
52
|
+
# Instagram ad copy for travel
|
|
53
|
+
copy = gen.generate_ad_copy("Istanbul", vibe="romantic", platform="Instagram")
|
|
54
|
+
print(copy)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Features at a Glance
|
|
60
|
+
|
|
61
|
+
| Feature | Description |
|
|
62
|
+
|---------|-------------|
|
|
63
|
+
| `ContentGenerator` | Multi-platform content — 8 platforms, 5 brand voices, 5 languages |
|
|
64
|
+
| `ContentCalendar` | Weekly + monthly content calendars with auto-scheduling |
|
|
65
|
+
| `SEOOptimizer` | Meta tags, titles, blog outlines, keyword extraction |
|
|
66
|
+
| `score_content()` | Readability, engagement, hashtag quality, length fit scoring |
|
|
67
|
+
| `batch_generate()` | Generate content for multiple topics at once |
|
|
68
|
+
| **AI mode** | Optional HuggingFace Inference API (flan-t5-large) |
|
|
69
|
+
| **Offline mode** | 100% offline with 50+ curated templates |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## ContentGenerator — 8 Platforms
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from contentflow import ContentGenerator
|
|
77
|
+
|
|
78
|
+
gen = ContentGenerator(brand_voice="startup")
|
|
79
|
+
|
|
80
|
+
platforms = ["instagram", "linkedin", "twitter", "tiktok", "email", "blog", "sms", "push"]
|
|
81
|
+
for platform in platforms:
|
|
82
|
+
content = gen.generate("product launch", platform=platform, tone="exciting")
|
|
83
|
+
print(f"[{platform.upper()}]", content[:80], "\n")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Brand Voices
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
# Available: startup | enterprise | creative | minimal | friendly
|
|
90
|
+
gen_corp = ContentGenerator(brand_voice="enterprise")
|
|
91
|
+
gen_fun = ContentGenerator(brand_voice="creative")
|
|
92
|
+
gen_clean = ContentGenerator(brand_voice="minimal")
|
|
93
|
+
|
|
94
|
+
post = gen_corp.generate("quarterly results", platform="linkedin", tone="professional")
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Multi-language Support
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
gen_tr = ContentGenerator(language="tr")
|
|
101
|
+
gen_de = ContentGenerator(language="de")
|
|
102
|
+
gen_fr = ContentGenerator(language="fr")
|
|
103
|
+
gen_es = ContentGenerator(language="es")
|
|
104
|
+
|
|
105
|
+
tr_post = gen_tr.generate("dijital pazarlama", platform="instagram")
|
|
106
|
+
de_post = gen_de.generate("Digitales Marketing", platform="linkedin")
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Batch Generation
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
results = gen.batch_generate(
|
|
113
|
+
topics=["Paris", "Tokyo", "Istanbul", "New York"],
|
|
114
|
+
platform="instagram",
|
|
115
|
+
tone="adventurous",
|
|
116
|
+
)
|
|
117
|
+
for r in results:
|
|
118
|
+
print(f"{r['topic']}: {r['content'][:60]}...")
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Content Scoring
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
content = gen.generate("AI startup funding", platform="linkedin")
|
|
125
|
+
score = gen.score_content(content, platform="linkedin")
|
|
126
|
+
|
|
127
|
+
print(f"Readability: {score.readability:.0%}")
|
|
128
|
+
print(f"Engagement: {score.engagement:.0%}")
|
|
129
|
+
print(f"Hashtags: {score.hashtag_quality:.0%}")
|
|
130
|
+
print(f"Length fit: {score.length_fit:.0%}")
|
|
131
|
+
print(f"Overall: {score.overall:.0%}")
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### AI Mode (HuggingFace)
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import os
|
|
138
|
+
os.environ["HF_API_TOKEN"] = "hf_your_token_here"
|
|
139
|
+
|
|
140
|
+
gen = ContentGenerator() # auto-reads HF_API_TOKEN
|
|
141
|
+
ai_copy = gen.generate("sustainable fashion brand", platform="instagram", tone="authentic")
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## ContentCalendar — Weekly & Monthly Scheduling
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
from contentflow import ContentCalendar
|
|
150
|
+
|
|
151
|
+
cal = ContentCalendar()
|
|
152
|
+
|
|
153
|
+
# One week of content across platforms
|
|
154
|
+
week = cal.generate_week(
|
|
155
|
+
topic="machine learning for marketers",
|
|
156
|
+
platforms=["linkedin", "twitter", "instagram"],
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
print(f"Generated {len(week.posts)} posts")
|
|
160
|
+
for post in week.posts:
|
|
161
|
+
print(f" {post.day:10s} | {post.platform:10s} | {post.content[:60]}...")
|
|
162
|
+
|
|
163
|
+
# Export to dict (e.g. for a CMS or Notion API)
|
|
164
|
+
data = week.to_dict()
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Monthly Calendar
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
weeks = cal.generate_month(
|
|
171
|
+
topics=["AI tools", "productivity hacks", "startup lessons", "remote work"],
|
|
172
|
+
platforms=["linkedin", "twitter"],
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
for i, week in enumerate(weeks, 1):
|
|
176
|
+
print(f"Week {i}: {len(week.posts)} posts scheduled")
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## SEOOptimizer — Meta Tags & Blog Outlines
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
from contentflow import SEOOptimizer
|
|
185
|
+
|
|
186
|
+
seo = SEOOptimizer()
|
|
187
|
+
|
|
188
|
+
# Full meta bundle
|
|
189
|
+
bundle = seo.generate_meta(
|
|
190
|
+
"Istanbul travel guide 2026",
|
|
191
|
+
keywords=["Istanbul", "Turkey travel", "things to do in Istanbul"],
|
|
192
|
+
)
|
|
193
|
+
print(bundle)
|
|
194
|
+
# <title>Istanbul travel guide 2026 — Complete Guide for 2026</title>
|
|
195
|
+
# <meta name="description" content="...">
|
|
196
|
+
# <meta name="keywords" content="...">
|
|
197
|
+
|
|
198
|
+
# SEO title variants
|
|
199
|
+
print(seo.generate_title("Istanbul travel guide", style="how-to"))
|
|
200
|
+
print(seo.generate_title("Istanbul travel guide", style="list"))
|
|
201
|
+
print(seo.generate_title("Istanbul travel guide", style="question"))
|
|
202
|
+
|
|
203
|
+
# Blog post outline
|
|
204
|
+
outline = seo.generate_blog_outline("Top 10 AI tools for small businesses", sections=6)
|
|
205
|
+
for i, section in enumerate(outline, 1):
|
|
206
|
+
print(f"{i}. {section}")
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Full Pipeline Example
|
|
212
|
+
|
|
213
|
+
```python
|
|
214
|
+
from contentflow import ContentGenerator, ContentCalendar, SEOOptimizer
|
|
215
|
+
|
|
216
|
+
brand = "TechStartup AI"
|
|
217
|
+
topic = "AI-powered customer service"
|
|
218
|
+
|
|
219
|
+
gen = ContentGenerator(brand_voice="startup", language="en")
|
|
220
|
+
cal = ContentCalendar(generator=gen)
|
|
221
|
+
seo = SEOOptimizer()
|
|
222
|
+
|
|
223
|
+
# Generate & score a LinkedIn post
|
|
224
|
+
post = gen.generate(topic, platform="linkedin", tone="professional")
|
|
225
|
+
score = gen.score_content(post, platform="linkedin")
|
|
226
|
+
print(f"Post score: {score.overall:.0%}\n{post}\n")
|
|
227
|
+
|
|
228
|
+
# Generate one week of content
|
|
229
|
+
week = cal.generate_week(topic, platforms=["linkedin", "twitter", "instagram"])
|
|
230
|
+
print(f"Scheduled {len(week.posts)} posts\n")
|
|
231
|
+
|
|
232
|
+
# SEO bundle for blog
|
|
233
|
+
bundle = seo.generate_meta(topic, keywords=["AI", "customer service", "automation"])
|
|
234
|
+
outline = seo.generate_blog_outline(f"How {topic} is changing business in 2026")
|
|
235
|
+
print(bundle.title)
|
|
236
|
+
for section in outline:
|
|
237
|
+
print(" →", section)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Travel Quotes (Backward Compat)
|
|
243
|
+
|
|
244
|
+
```python
|
|
245
|
+
gen = ContentGenerator()
|
|
246
|
+
print(gen.get_travel_quote("Adventure")) # Amelia Earhart, Tolkien, Oprah...
|
|
247
|
+
print(gen.get_travel_quote("Culture")) # Mark Twain, Saint Augustine...
|
|
248
|
+
print(gen.get_travel_quote("Mindset")) # Hans Christian Andersen...
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## License
|
|
254
|
+
|
|
255
|
+
MIT — [Teyfik Öz](https://github.com/teyfikoz)
|
|
@@ -0,0 +1,230 @@
|
|
|
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
|
+
[](https://pypi.org/project/contentflow/)
|
|
6
|
+
[](https://github.com/teyfikoz/contentflow/actions/workflows/ci.yml)
|
|
7
|
+
[](https://www.python.org/)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install contentflow
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from contentflow import ContentGenerator
|
|
20
|
+
|
|
21
|
+
gen = ContentGenerator()
|
|
22
|
+
|
|
23
|
+
# Generate platform-specific content
|
|
24
|
+
post = gen.generate("AI productivity tools", platform="linkedin", tone="professional")
|
|
25
|
+
print(post)
|
|
26
|
+
|
|
27
|
+
# Instagram ad copy for travel
|
|
28
|
+
copy = gen.generate_ad_copy("Istanbul", vibe="romantic", platform="Instagram")
|
|
29
|
+
print(copy)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Features at a Glance
|
|
35
|
+
|
|
36
|
+
| Feature | Description |
|
|
37
|
+
|---------|-------------|
|
|
38
|
+
| `ContentGenerator` | Multi-platform content — 8 platforms, 5 brand voices, 5 languages |
|
|
39
|
+
| `ContentCalendar` | Weekly + monthly content calendars with auto-scheduling |
|
|
40
|
+
| `SEOOptimizer` | Meta tags, titles, blog outlines, keyword extraction |
|
|
41
|
+
| `score_content()` | Readability, engagement, hashtag quality, length fit scoring |
|
|
42
|
+
| `batch_generate()` | Generate content for multiple topics at once |
|
|
43
|
+
| **AI mode** | Optional HuggingFace Inference API (flan-t5-large) |
|
|
44
|
+
| **Offline mode** | 100% offline with 50+ curated templates |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## ContentGenerator — 8 Platforms
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from contentflow import ContentGenerator
|
|
52
|
+
|
|
53
|
+
gen = ContentGenerator(brand_voice="startup")
|
|
54
|
+
|
|
55
|
+
platforms = ["instagram", "linkedin", "twitter", "tiktok", "email", "blog", "sms", "push"]
|
|
56
|
+
for platform in platforms:
|
|
57
|
+
content = gen.generate("product launch", platform=platform, tone="exciting")
|
|
58
|
+
print(f"[{platform.upper()}]", content[:80], "\n")
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Brand Voices
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
# Available: startup | enterprise | creative | minimal | friendly
|
|
65
|
+
gen_corp = ContentGenerator(brand_voice="enterprise")
|
|
66
|
+
gen_fun = ContentGenerator(brand_voice="creative")
|
|
67
|
+
gen_clean = ContentGenerator(brand_voice="minimal")
|
|
68
|
+
|
|
69
|
+
post = gen_corp.generate("quarterly results", platform="linkedin", tone="professional")
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Multi-language Support
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
gen_tr = ContentGenerator(language="tr")
|
|
76
|
+
gen_de = ContentGenerator(language="de")
|
|
77
|
+
gen_fr = ContentGenerator(language="fr")
|
|
78
|
+
gen_es = ContentGenerator(language="es")
|
|
79
|
+
|
|
80
|
+
tr_post = gen_tr.generate("dijital pazarlama", platform="instagram")
|
|
81
|
+
de_post = gen_de.generate("Digitales Marketing", platform="linkedin")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Batch Generation
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
results = gen.batch_generate(
|
|
88
|
+
topics=["Paris", "Tokyo", "Istanbul", "New York"],
|
|
89
|
+
platform="instagram",
|
|
90
|
+
tone="adventurous",
|
|
91
|
+
)
|
|
92
|
+
for r in results:
|
|
93
|
+
print(f"{r['topic']}: {r['content'][:60]}...")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Content Scoring
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
content = gen.generate("AI startup funding", platform="linkedin")
|
|
100
|
+
score = gen.score_content(content, platform="linkedin")
|
|
101
|
+
|
|
102
|
+
print(f"Readability: {score.readability:.0%}")
|
|
103
|
+
print(f"Engagement: {score.engagement:.0%}")
|
|
104
|
+
print(f"Hashtags: {score.hashtag_quality:.0%}")
|
|
105
|
+
print(f"Length fit: {score.length_fit:.0%}")
|
|
106
|
+
print(f"Overall: {score.overall:.0%}")
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### AI Mode (HuggingFace)
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
import os
|
|
113
|
+
os.environ["HF_API_TOKEN"] = "hf_your_token_here"
|
|
114
|
+
|
|
115
|
+
gen = ContentGenerator() # auto-reads HF_API_TOKEN
|
|
116
|
+
ai_copy = gen.generate("sustainable fashion brand", platform="instagram", tone="authentic")
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## ContentCalendar — Weekly & Monthly Scheduling
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
from contentflow import ContentCalendar
|
|
125
|
+
|
|
126
|
+
cal = ContentCalendar()
|
|
127
|
+
|
|
128
|
+
# One week of content across platforms
|
|
129
|
+
week = cal.generate_week(
|
|
130
|
+
topic="machine learning for marketers",
|
|
131
|
+
platforms=["linkedin", "twitter", "instagram"],
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
print(f"Generated {len(week.posts)} posts")
|
|
135
|
+
for post in week.posts:
|
|
136
|
+
print(f" {post.day:10s} | {post.platform:10s} | {post.content[:60]}...")
|
|
137
|
+
|
|
138
|
+
# Export to dict (e.g. for a CMS or Notion API)
|
|
139
|
+
data = week.to_dict()
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Monthly Calendar
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
weeks = cal.generate_month(
|
|
146
|
+
topics=["AI tools", "productivity hacks", "startup lessons", "remote work"],
|
|
147
|
+
platforms=["linkedin", "twitter"],
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
for i, week in enumerate(weeks, 1):
|
|
151
|
+
print(f"Week {i}: {len(week.posts)} posts scheduled")
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## SEOOptimizer — Meta Tags & Blog Outlines
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
from contentflow import SEOOptimizer
|
|
160
|
+
|
|
161
|
+
seo = SEOOptimizer()
|
|
162
|
+
|
|
163
|
+
# Full meta bundle
|
|
164
|
+
bundle = seo.generate_meta(
|
|
165
|
+
"Istanbul travel guide 2026",
|
|
166
|
+
keywords=["Istanbul", "Turkey travel", "things to do in Istanbul"],
|
|
167
|
+
)
|
|
168
|
+
print(bundle)
|
|
169
|
+
# <title>Istanbul travel guide 2026 — Complete Guide for 2026</title>
|
|
170
|
+
# <meta name="description" content="...">
|
|
171
|
+
# <meta name="keywords" content="...">
|
|
172
|
+
|
|
173
|
+
# SEO title variants
|
|
174
|
+
print(seo.generate_title("Istanbul travel guide", style="how-to"))
|
|
175
|
+
print(seo.generate_title("Istanbul travel guide", style="list"))
|
|
176
|
+
print(seo.generate_title("Istanbul travel guide", style="question"))
|
|
177
|
+
|
|
178
|
+
# Blog post outline
|
|
179
|
+
outline = seo.generate_blog_outline("Top 10 AI tools for small businesses", sections=6)
|
|
180
|
+
for i, section in enumerate(outline, 1):
|
|
181
|
+
print(f"{i}. {section}")
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Full Pipeline Example
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
from contentflow import ContentGenerator, ContentCalendar, SEOOptimizer
|
|
190
|
+
|
|
191
|
+
brand = "TechStartup AI"
|
|
192
|
+
topic = "AI-powered customer service"
|
|
193
|
+
|
|
194
|
+
gen = ContentGenerator(brand_voice="startup", language="en")
|
|
195
|
+
cal = ContentCalendar(generator=gen)
|
|
196
|
+
seo = SEOOptimizer()
|
|
197
|
+
|
|
198
|
+
# Generate & score a LinkedIn post
|
|
199
|
+
post = gen.generate(topic, platform="linkedin", tone="professional")
|
|
200
|
+
score = gen.score_content(post, platform="linkedin")
|
|
201
|
+
print(f"Post score: {score.overall:.0%}\n{post}\n")
|
|
202
|
+
|
|
203
|
+
# Generate one week of content
|
|
204
|
+
week = cal.generate_week(topic, platforms=["linkedin", "twitter", "instagram"])
|
|
205
|
+
print(f"Scheduled {len(week.posts)} posts\n")
|
|
206
|
+
|
|
207
|
+
# SEO bundle for blog
|
|
208
|
+
bundle = seo.generate_meta(topic, keywords=["AI", "customer service", "automation"])
|
|
209
|
+
outline = seo.generate_blog_outline(f"How {topic} is changing business in 2026")
|
|
210
|
+
print(bundle.title)
|
|
211
|
+
for section in outline:
|
|
212
|
+
print(" →", section)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Travel Quotes (Backward Compat)
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
gen = ContentGenerator()
|
|
221
|
+
print(gen.get_travel_quote("Adventure")) # Amelia Earhart, Tolkien, Oprah...
|
|
222
|
+
print(gen.get_travel_quote("Culture")) # Mark Twain, Saint Augustine...
|
|
223
|
+
print(gen.get_travel_quote("Mindset")) # Hans Christian Andersen...
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## License
|
|
229
|
+
|
|
230
|
+
MIT — [Teyfik Öz](https://github.com/teyfikoz)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ContentFlow v1.0.0 — Multi-platform AI marketing content generator.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
__version__ = "1.1.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
|