Structured Data Automation Kit: Audit, Generate and Validate JSON-LD with Python
Most schema markup tools work one page at a time: paste a URL, read the errors, fix, repeat. That stops working at a few hundred pages, and it never tells you where markup is missing. This free Python toolkit treats structured data as a pipeline. One script, sd_toolkit.py, has three commands that follow the three steps of my guide.
What each command does
- audit reads each URL, extracts the JSON-LD, Microdata and RDFa already there, runs a rule-based page classifier to flag structured data opportunities, marks whether Google still shows a rich result for each one, and validates what it finds. One CSV row per URL.
- generate builds JSON-LD from a data source (a CSV, or any SQL query) instead of a generator page by page. Each page gets one connected
@graphwith Organization, WebSite, WebPage, BreadcrumbList and the main entity (Article, Product, Event or Course), linked by @id. It writes a.jsonfile and a ready-to-paste script tag per page. - validate checks a file or a live URL against the current schema.org vocabulary, Google’s required and recommended properties for rich results that still exist, and the page’s visible text.
Who it’s for
Technical SEOs and developers implementing schema across a whole site, especially on templates or product catalogues that already live in a spreadsheet or database.
How to use it
- Install the requirements locally, or upload
sd_toolkit.pyandexample_data/to Google Colab. - Put the URLs you want to check in a text file and run
audit. Review the opportunities before you generate anything. - Fill a CSV with one row per page, using columns named after schema.org properties (the sample
pages.csvshows the format), or pointgenerateat a SQL query. - Run
generateto write the JSON-LD files. - Run
validateon the generated files, then on the live pages once they’re deployed.
Limits
- The classifier suggests; it doesn’t decide. Every suggestion names the signal that fired so you can check it.
- It doesn’t replace Google’s Rich Results Test, which has no public API. Spot-check a sample of templates there.
- It reads the HTML the server returns, so markup injected by JavaScript (for example through Google Tag Manager) won’t show up.
- Free to run. The first validation downloads the schema.org vocabulary (about 1.5 MB) and caches it.
The method and the reasoning behind the connected graph are in Structured Data Automation with Python. For the entity side of schema, see the Entity SEO and Knowledge Graph Strategies for Brands course.
What’s included
- audit: extracts JSON-LD, Microdata and RDFa from each URL, flags structured data opportunities and whether Google still shows that rich result
- generate: builds one connected @graph per page (Organization, WebSite, WebPage, BreadcrumbList, main entity) from a CSV or SQL query
- validate: checks the current schema.org vocabulary, Google's required and recommended properties, and that the markup matches visible page text
- Up-to-date rich result status, including FAQPage and HowTo retirements
- Sample CSV and SQLite demo included
Where this resource is used on MLforSEO
Walkthroughs on the blog
Concepts behind it
More entity SEO resources
- No-Code TemplateTopical Map Template and Generator Based on the EAV Model (Google Sheets)
- ChecklistGenerative Engine Optimisation (GEO) Checklist
- ChecklistKnowledge Panel & Brand SERP Audit Checklist
- Coding Script or NotebookEntity Salience Checker: Google NL API v1, Page vs Target Entity
- WorkbookEntity Confidence Recovery Tracker
- No-Code TemplateEntity Analysis with Google Cloud Natural Language API (No-Code Template)
See all 18 entity SEO resources →See all 16 content audits resources →See all 42 coding script or notebook resources →
