Menu

Tree [d6bf47] master /
 History

HTTPS access


File Date Author Commit
 LICENSE 2026-01-15 CybertekMktg CybertekMktg [d6bf47] Initial commit
 README.md 2026-01-15 CybertekMktg CybertekMktg [d6bf47] Initial commit
 localbiz_schema.py 2026-01-15 CybertekMktg CybertekMktg [d6bf47] Initial commit

Read Me

LocalBiz Schema Generator

A lightweight Python utility for generating structured data (JSON-LD schema.org markup) and formatted citations for local businesses.

Features

  • Generate schema.org LocalBusiness JSON-LD markup
  • Format NAP (Name, Address, Phone) data consistently
  • Support for 15+ business types (Restaurant, Plumber, Dentist, etc.)
  • Output as JSON, HTML embed, or plain text citation
  • Zero dependencies - pure Python 3

Installation

git clone https://git.code.sf.net/p/localbiz-schema-generator/code
cd localbiz-schema-generator

Usage

Generate JSON-LD Schema

from localbiz_schema import generate_schema, get_business_type

schema = generate_schema(
    name="Joe's Plumbing",
    address="123 Main Street",
    city="Austin",
    state="TX",
    zipcode="78701",
    phone="(512) 555-0123",
    website="https://joesplumbing.com",
    business_type=get_business_type("plumber")
)

Format Citation

from localbiz_schema import format_citation

citation = format_citation(
    name="Joe's Plumbing",
    address="123 Main Street",
    city="Austin",
    state="TX",
    zipcode="78701",
    phone="(512) 555-0123"
)
# Output:
# Joe's Plumbing
# 123 Main Street
# Austin, TX 78701
# (512) 555-0123

Get HTML Embed

from localbiz_schema import generate_schema, schema_to_html

schema = generate_schema(...)
html = schema_to_html(schema)
# Output: <script type="application/ld+json">...</script>

Supported Business Types

Industry Schema Type
restaurant Restaurant
plumber Plumber
electrician Electrician
locksmith Locksmith
hvac HVACBusiness
lawyer LegalService
dentist Dentist
doctor Physician
realtor RealEstateAgent
auto_repair AutoRepair
salon BeautySalon
gym HealthClub
hotel Hotel
store Store
contractor GeneralContractor

Output Examples

See the Wiki for real-world output examples across various business types and industries.

License

MIT License - see LICENSE file.

Contributing

Pull requests welcome. For major changes, please open an issue first.