Pynions is a lean Python framework for building AI-powered automation flows that run on your machine.
git clone https://github.com/craftled/pynions.gitPynions is a lean Python framework designed for building AI-powered automation flows that execute locally on your machine. It enables developers to create automation workflows without heavyweight dependencies or cloud infrastructure. Built by craftled, Pynions focuses on simplicity and efficiency for marketing automation tasks. The framework supports local-first execution, making it suitable for teams that prioritize data privacy and minimal setup overhead.
["Install Pynions and dependencies: `pip install pynions==1.2.0 requests pandas`","Define your automation flow in a Python file (e.g., `automations/lead_scoring.py`) using the Pynions Flow class","Configure triggers (CronTrigger, FileTrigger, etc.) to determine when the flow runs","Use Pynions actions (HttpRequest, FileWriter, EmailSender) to define each step of your automation","Run the flow locally with `python lead_scoring.py` or deploy to a server using Docker","Tip: Start with a simple flow (2-3 steps) and add complexity gradually. Use Pynions' built-in logging to debug issues.","Tip: Store sensitive data like API keys in environment variables rather than hardcoding them."]
Automate repetitive marketing workflow tasks using Python and AI
Build local AI automation flows without cloud dependencies
Create custom marketing automation scripts that run on your machine
Develop lean automation pipelines for marketing operations
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/craftled/pynionsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Build a Pynions automation flow that [TASK] using [DATA_SOURCE] and [TRIGGER_CONDITION]. The flow should include [STEP_1], [STEP_2], and [STEP_3]. Use Python 3.10+ and Pynions 1.2+. Include error handling for [COMMON_ERRORS].
```python
from pynions import Flow, Step, Trigger
from pynions.actions import HttpRequest, FileWriter, EmailSender
from pynions.triggers import CronTrigger
# Define the automation flow
lead_scoring_flow = Flow(
name="Lead Scoring Automation",
description="Processes new leads from HubSpot API and scores them based on engagement"
)
# Step 1: Fetch new leads from HubSpot API
fetch_leads_step = Step(
name="Fetch Leads",
action=HttpRequest(
method="GET",
url="https://api.hubapi.com/crm/v3/objects/contacts",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"limit": 100}
),
output_mapping={"leads": "$.results"}
)
# Step 2: Score leads based on engagement (simplified logic)
score_leads_step = Step(
name="Score Leads",
action=lambda leads: [
{
**lead,
"score": min(100,
(lead.get("num_page_views", 0) * 2) +
(lead.get("email_opens", 0) * 5) +
(lead.get("form_submissions", 0) * 10)
)
}
for lead in leads
]
)
# Step 3: Write scored leads to CSV file
write_leads_step = Step(
name="Write Leads to CSV",
action=FileWriter(
filename="scored_leads.csv",
mode="w",
headers=["contact_id", "email", "company", "score", "last_activity"]
)
)
# Step 4: Send high-scoring leads to Slack
send_to_slack_step = Step(
name="Notify High-Scoring Leads",
action=HttpRequest(
method="POST",
url="https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
body={
"text": "New high-priority lead detected!",
"attachments": [{
"fields": [
{"title": "Email", "value": "{{lead.email}}", "short": true},
{"title": "Score", "value": "{{lead.score}}", "short": true},
{"title": "Company", "value": "{{lead.company}}", "short": true}
]
}]
}
),
condition=lambda lead: lead["score"] > 70
)
# Set up the flow
lead_scoring_flow.add_steps([
fetch_leads_step,
score_leads_step,
write_leads_step,
send_to_slack_step
])
# Run the flow daily at 9 AM
trigger = CronTrigger("0 9 * * *")
lead_scoring_flow.run(trigger=trigger)
```
This Pynions automation flow processes new leads from HubSpot daily, scores them based on engagement metrics, writes the results to a CSV file for analysis, and sends notifications to Slack for high-priority leads. The scoring logic prioritizes leads who have submitted forms (10 points each) and opened emails (5 points each), with a maximum score of 100. The flow handles up to 100 leads per run and includes error handling for API rate limits and missing data fields. Output files are timestamped and stored in the project's `output/` directory.Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan