contentflow 0.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.
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: contentflow
3
+ Version: 0.1.0
4
+ Summary: AI Marketing Content Generator
5
+ Requires-Python: >=3.8
6
+ Requires-Dist: requests
7
+ Dynamic: requires-dist
8
+ Dynamic: requires-python
9
+ Dynamic: summary
@@ -0,0 +1,19 @@
1
+ # ContentFlow: AI Marketing Content Generator
2
+
3
+ Generate high-converting marketing copy for your travel business.
4
+
5
+ ## Installation
6
+ ```bash
7
+ pip install contentflow
8
+ ```
9
+
10
+ ## Features
11
+ - **AI Copywriting**: Powered by Hugging Face models.
12
+ - **Template System**: Fast and reliable fallback logic.
13
+
14
+ ## Usage
15
+ ```python
16
+ from contentflow import ContentGenerator
17
+ gen = ContentGenerator()
18
+ ad = gen.generate_ad_copy("Istanbul", "Exciting")
19
+ ```
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,13 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="contentflow",
5
+ version="0.1.0",
6
+ description="AI Marketing Content Generator",
7
+ package_dir={"": "src"},
8
+ packages=find_packages(where="src"),
9
+ install_requires=[
10
+ "requests",
11
+ ],
12
+ python_requires=">=3.8",
13
+ )
@@ -0,0 +1,7 @@
1
+ """
2
+ ContentFlow - AI Marketing Content Generator
3
+ """
4
+
5
+ __version__ = "0.1.0"
6
+
7
+ from .generator import ContentGenerator
@@ -0,0 +1,41 @@
1
+ import os
2
+ import requests
3
+ import random
4
+ from typing import Optional
5
+
6
+ class ContentGenerator:
7
+ """
8
+ Generates marketing copy using AI or templates.
9
+ """
10
+
11
+ def __init__(self, api_key: Optional[str] = None):
12
+ self.api_key = api_key or os.environ.get("HF_API_TOKEN")
13
+ self.api_url = "https://api-inference.huggingface.co/models/google/flan-t5-large"
14
+
15
+ def generate_ad_copy(self, city: str, vibe: str = "exciting") -> str:
16
+ """
17
+ Generate a short ad copy for a city.
18
+ """
19
+ if self.api_key:
20
+ return self._generate_ai(city, vibe)
21
+ return self._generate_template(city, vibe)
22
+
23
+ def _generate_template(self, city: str, vibe: str) -> str:
24
+ templates = [
25
+ f"Discover the {vibe} magic of {city}! Book your trip today.",
26
+ f"{city} is calling! Experience a {vibe} adventure.",
27
+ f"Escape to {city}. It's simply {vibe}.",
28
+ ]
29
+ return random.choice(templates)
30
+
31
+ def _generate_ai(self, city: str, vibe: str) -> str:
32
+ prompt = f"Write a catchy marketing slogan for visiting {city}. The vibe should be {vibe}."
33
+ headers = {"Authorization": f"Bearer {self.api_key}"}
34
+ try:
35
+ response = requests.post(self.api_url, headers=headers, json={"inputs": prompt})
36
+ result = response.json()
37
+ if isinstance(result, list) and 'generated_text' in result[0]:
38
+ return result[0]['generated_text']
39
+ return self._generate_template(city, vibe)
40
+ except:
41
+ return self._generate_template(city, vibe)
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: contentflow
3
+ Version: 0.1.0
4
+ Summary: AI Marketing Content Generator
5
+ Requires-Python: >=3.8
6
+ Requires-Dist: requests
7
+ Dynamic: requires-dist
8
+ Dynamic: requires-python
9
+ Dynamic: summary
@@ -0,0 +1,9 @@
1
+ README.md
2
+ setup.py
3
+ src/contentflow/__init__.py
4
+ src/contentflow/generator.py
5
+ src/contentflow.egg-info/PKG-INFO
6
+ src/contentflow.egg-info/SOURCES.txt
7
+ src/contentflow.egg-info/dependency_links.txt
8
+ src/contentflow.egg-info/requires.txt
9
+ src/contentflow.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ requests
@@ -0,0 +1 @@
1
+ contentflow