Skip to content

Conversation

@Devesh36
Copy link

@Devesh36 Devesh36 commented Dec 13, 2025

This pull request introduces a new workflow for generating Python Pydantic models from the Circuit JSON TypeScript definitions. It adds scripts and commands to automate the creation of Python type files, including utility functions and sample types, and organizes the generated code into a structured Python package.

Python Pydantic type generation:

  • Added a new script scripts/generate-pydantic-types.ts that generates Python files with Pydantic models and utility functions for Circuit JSON types, including PCB and source component models, as well as unit conversion utilities. The script creates a well-organized directory structure under python/ for the generated files.
  • Added a runner script scripts/run-pydantic-generator.ts to execute the Pydantic types generator and print out the resulting directory structure and usage instructions.

Build and workflow enhancements:

  • Updated package.json to add new scripts: generate-pydantic (runs the Python types generator) and generate-all (runs both the Python types and documentation generators).

/fix #90

Copy link

@rushabhcodes rushabhcodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this solves the issue

@Devesh36
Copy link
Author

I don't think this solves the issue

wip

@seveibar
Copy link
Contributor

not accepting contributions like this from non-maintainers because you need to have a history of maintaining complex solutions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce Pydantic Bindings

3 participants