storyfed 1.0.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,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: storyfed
3
+ Version: 1.0.0
4
+ Summary: The official Python SDK for the Storyfed Video Generation API.
5
+ Home-page: https://github.com/YOUR_GITHUB_USERNAME/storyfed-python
6
+ Author: Storyfed
7
+ Requires-Python: >=3.7
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: requests
10
+ Dynamic: author
11
+ Dynamic: description
12
+ Dynamic: description-content-type
13
+ Dynamic: home-page
14
+ Dynamic: requires-dist
15
+ Dynamic: requires-python
16
+ Dynamic: summary
17
+
18
+ # Storyfed Python SDK
19
+
20
+ The official Python wrapper for the Storyfed AI Video Generation API.
21
+
22
+ ## Installation
23
+ ```bash
24
+ pip install storyfed
25
+ ```
26
+
27
+ ## Quick Start
28
+
29
+ ```bash
30
+ from storyfed import Storyfed
31
+
32
+ client = Storyfed(api_key="YOUR_API_KEY")
33
+
34
+ video = client.generate_video(
35
+ prompt="[Scene 1]\nA cinematic shot of space.",
36
+ ratio="16:9"
37
+ )
38
+
39
+ print(f"Success! Watch here: {video['url']}")
40
+ ```
@@ -0,0 +1,23 @@
1
+ # Storyfed Python SDK
2
+
3
+ The official Python wrapper for the Storyfed AI Video Generation API.
4
+
5
+ ## Installation
6
+ ```bash
7
+ pip install storyfed
8
+ ```
9
+
10
+ ## Quick Start
11
+
12
+ ```bash
13
+ from storyfed import Storyfed
14
+
15
+ client = Storyfed(api_key="YOUR_API_KEY")
16
+
17
+ video = client.generate_video(
18
+ prompt="[Scene 1]\nA cinematic shot of space.",
19
+ ratio="16:9"
20
+ )
21
+
22
+ print(f"Success! Watch here: {video['url']}")
23
+ ```
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,14 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="storyfed",
5
+ version="1.0.0",
6
+ description="The official Python SDK for the Storyfed Video Generation API.",
7
+ long_description=open("README.md").read(),
8
+ long_description_content_type="text/markdown",
9
+ author="Storyfed",
10
+ url="https://github.com/YOUR_GITHUB_USERNAME/storyfed-python",
11
+ packages=find_packages(),
12
+ install_requires=["requests"],
13
+ python_requires=">=3.7",
14
+ )
@@ -0,0 +1 @@
1
+ from .client import Storyfed
@@ -0,0 +1,36 @@
1
+ import requests
2
+ import time
3
+
4
+ class Storyfed:
5
+ def __init__(self, api_key, base_url="https://api.storyfed.com"):
6
+ self.api_key = api_key
7
+ self.base_url = base_url
8
+ self.headers = {"Content-Type": "application/json", "X-API-Key": self.api_key}
9
+
10
+ def generate_video(self, prompt, quality_tier="Budget", ratio="9:16", estimated_length=60, poll_interval=15):
11
+ """Generates the video and returns the metadata and URL."""
12
+ payload = {"prompt": prompt, "quality_tier": quality_tier, "ratio": ratio, "estimated_length": estimated_length}
13
+
14
+ res = requests.post(f"{self.base_url}/storyfed-1", headers=self.headers, json=payload)
15
+ if res.status_code != 200: raise Exception(f"Failed to start: {res.text}")
16
+
17
+ job_id = res.json().get("response", {}).get("job_id")
18
+
19
+ while True:
20
+ status_res = requests.get(f"{self.base_url}/storyfed-1/status/{job_id}", headers=self.headers)
21
+ status_data = status_res.json()
22
+ stage = status_data.get("stage")
23
+
24
+ if stage == "finished" or status_data.get("status") == "completed":
25
+ return status_data.get("result", {})
26
+ elif stage == "failed" or status_data.get("status") == "error":
27
+ raise Exception("Generation failed on server.")
28
+
29
+ time.sleep(poll_interval)
30
+
31
+ def download(self, video_url, output_path="/tmp/video.mp4"):
32
+ """Helper to download the MP4 for platforms like Replicate/Fal"""
33
+ video_response = requests.get(video_url)
34
+ with open(output_path, "wb") as file:
35
+ file.write(video_response.content)
36
+ return output_path
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: storyfed
3
+ Version: 1.0.0
4
+ Summary: The official Python SDK for the Storyfed Video Generation API.
5
+ Home-page: https://github.com/YOUR_GITHUB_USERNAME/storyfed-python
6
+ Author: Storyfed
7
+ Requires-Python: >=3.7
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: requests
10
+ Dynamic: author
11
+ Dynamic: description
12
+ Dynamic: description-content-type
13
+ Dynamic: home-page
14
+ Dynamic: requires-dist
15
+ Dynamic: requires-python
16
+ Dynamic: summary
17
+
18
+ # Storyfed Python SDK
19
+
20
+ The official Python wrapper for the Storyfed AI Video Generation API.
21
+
22
+ ## Installation
23
+ ```bash
24
+ pip install storyfed
25
+ ```
26
+
27
+ ## Quick Start
28
+
29
+ ```bash
30
+ from storyfed import Storyfed
31
+
32
+ client = Storyfed(api_key="YOUR_API_KEY")
33
+
34
+ video = client.generate_video(
35
+ prompt="[Scene 1]\nA cinematic shot of space.",
36
+ ratio="16:9"
37
+ )
38
+
39
+ print(f"Success! Watch here: {video['url']}")
40
+ ```
@@ -0,0 +1,9 @@
1
+ README.md
2
+ setup.py
3
+ storyfed/__init__.py
4
+ storyfed/client.py
5
+ storyfed.egg-info/PKG-INFO
6
+ storyfed.egg-info/SOURCES.txt
7
+ storyfed.egg-info/dependency_links.txt
8
+ storyfed.egg-info/requires.txt
9
+ storyfed.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ requests
@@ -0,0 +1 @@
1
+ storyfed