Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
.env
.venv
env/
venv/
ENV/

# Testing
.coverage
.pytest_cache/
htmlcov/
.tox/
.nox/

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Build artifacts
*.png
!/src/teamverse/templates/*.png
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# teamverse-py
# policyengine-content

Content generation for PolicyEngine - social images, newsletters, blog posts.

Expand All @@ -13,7 +13,7 @@ Content generation for PolicyEngine - social images, newsletters, blog posts.
## Installation

```bash
pip install teamverse
pip install policyengine-content
```

Or for development:
Expand All @@ -28,23 +28,23 @@ pip install -e ".[dev]"

```bash
# Generate social image
teamverse social --headline "PolicyEngine meets PM" --badge "Major Milestone"
policyengine-content social --headline "PolicyEngine meets PM" --badge "Major Milestone"

# Validate image dimensions
teamverse validate image.png
policyengine-content validate image.png

# Parse content from URL
teamverse parse-source https://example.com/article
policyengine-content parse-source https://example.com/article

# Generate content bundle
teamverse generate --source https://example.com/article
policyengine-content generate --source https://example.com/article
```

### Python API

```python
from teamverse.models.content import SocialPost, Audience
from teamverse.renderers.social import SocialRenderer
from policyengine_content.models.content import SocialPost, Audience
from policyengine_content.renderers.social import SocialRenderer

# Create social post
post = SocialPost(
Expand All @@ -63,7 +63,7 @@ path = renderer.render(post)

```bash
# Start server
uvicorn teamverse.api:app
uvicorn policyengine_content.api:app

# Health check
curl http://localhost:8000/health
Expand Down
68 changes: 68 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "policyengine-content"
version = "0.1.0"
description = "Content generation for PolicyEngine - social images, newsletters, blog posts"
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.10"
authors = [
{name = "PolicyEngine", email = "hello@policyengine.org"}
]
keywords = ["policyengine", "content", "newsletter", "social-media"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"pydantic>=2.0",
"jinja2>=3.0",
"pillow>=10.0",
"click>=8.0",
"httpx>=0.25",
"fastapi>=0.109",
"uvicorn>=0.27",
]

[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
"pytest-asyncio>=0.23",
"black>=23.0",
"ruff>=0.1",
"pixelmatch>=0.3",
"beautifulsoup4>=4.12",
"html2text>=2020.1.16",
]

[project.scripts]
policyengine-content = "policyengine_content.cli:main"

[project.urls]
Homepage = "https://github.com/PolicyEngine/policyengine-content"
Repository = "https://github.com/PolicyEngine/policyengine-content"

[tool.setuptools.packages.find]
where = ["src"]

[tool.black]
line-length = 88
target-version = ["py310"]

[tool.ruff]
line-length = 88
target-version = "py310"

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v --cov=policyengine_content --cov-report=term-missing"
16 changes: 16 additions & 0 deletions src/policyengine_content/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Teamverse - Content generation for PolicyEngine."""

__version__ = "0.1.0"

from policyengine_content.models.content import BlogPost, Newsletter, SocialPost, Audience
from policyengine_content.renderers.social import render_social_image
from policyengine_content.renderers.newsletter import render_newsletter

__all__ = [
"BlogPost",
"Newsletter",
"SocialPost",
"Audience",
"render_social_image",
"render_newsletter",
]
Loading