python flask json guide
via PatrickJS/awesome-cursorrules
Flask development guide for Drawscape Factorio module integration with JSON data handling.
What is python flask json guide?
This rule provides Flask development patterns for working with the custom Drawscape Factorio Python module. Use it when building Flask applications that need to import Factorio entity data from JSON and generate SVG output with configurable themes and layers.
- Import and parse JSON entity data using the importFUE5 function
- Create Factorio visualizations with createFactorio using theme and color scheme configuration
- Configure visible layers (assets, belts, walls, rails, electrical, spaceship) in output
- Generate and write SVG string output to files
- Handle JSON file I/O for Factorio entity imports
Applies to
File patterns this rule matches.
Rule definition (reference)
Source of truth, from the repository.
This project is heavily reliant on our custom Drawscape Factorio python module.
Here is code examples of how to use the module:
from drawscape_factorio import create as createFactorio
from drawscape_factorio import importFUE5
with open('/path/to/exported-entities.json', 'r') as file:
json_data = json.load(file)
data = importFUE5(json_data)
result = createFactorio(data, {
'theme_name': 'default',
'color_scheme': 'main',
'show_layers': ['assets', 'belts', 'walls', 'rails', 'electrical', 'spaceship']
})
with open(output_file_name, 'w') as f:
f.write(result['svg_string'])
Related rules
Senior full-stack TypeScript, React, Node.js guidance with clean architecture, testing, and WHY-oriented reasoning.
Quantitative factor research skills for designing, evaluating, and mining alpha factors in equities markets.
Android development with Jetpack Compose, clean architecture, and Material Design 3.
Angular development with Novo Elements UI library using standalone components.
Expert Angular 18 + TypeScript development with Jest, emphasizing clean code and performance.
Manage Kubernetes clusters, add-ons, stacks, and credentials via the Ankra CLI platform.