Python OpenNEM Setup .cursorrules prompt file
About .cursorrules prompt file
What you can build
Energy Data Visualization Platform: Develop an interactive web application using FastAPI and React for real-time visualization of Australia's energy data. Utilize asyncpg and SqlAlchemy for efficient data retrieval, and include advanced filtering options for users to explore NEM datasets.
NEM Data Analysis Toolkit: Create a Python package that provides analysts with tools to perform complex queries and analysis on NEM data. Include async methods for data retrieval and leverage Pydantic models for structured data manipulation.
Energy Forecasting Service: Implement a prediction service using machine learning libraries like scikit-learn or TensorFlow, integrated with the OpenNEM database. Provide an API endpoint for real-time energy production and consumption forecasts across different regions.
Renewable Energy Tracker: Design a dashboard application to track renewable energy contributions in the NEM. Use FastAPI for the backend API and Plotly for visual components, allowing users to see insights such as peak renewable production times and carbon reduction metrics.
Electricity Pricing Alert System: Develop a notification system using Arq scheduler to alert users to significant changes in electricity prices. Set up criteria for alerts based on API queries and send notifications via email or text message.
OpenNEM Database Management Interface: Build a Web UI for admin operations including database migrations using Alembic, backup tasks, and performance monitoring. Implement authentication mechanisms to ensure security.
Energy Market Simulation Tool: Create a simulation tool that allows researchers to model energy flow scenarios in the NEM. Use async functions to handle simulations and provide a web interface for parameter input and results visualization.
Environmental Impact Assessment App: Develop an application that assesses the environmental impact of different energy sources based on OpenNEM data. Provide reports using data visualizations with insights into emissions and ecological effects.
OpenNEM Educational Platform: Launch an online platform offering educational resources about the Australian electricity market. Incorporate interactive tutorials and quizzes, utilizing the OpenNEM data for hands-on learning experiences.
Energy Data API Gateway: Create an API gateway that facilitates access to NEM data for developers and researchers. Optimize data queries with async methods and provide comprehensive API documentation to guide users on effective utilization.
Benefits
- Adherence to type hinting and async programming ensures robust, efficient code generation.
- Comprehensive documentation in Australian English supports clear communication and code maintenance.
- Emphasis on SqlAlchemy ORM and Pydantic models promotes structured, type-safe data handling.
Synopsis
Python developers familiar with web development and database management can build a high-performance, asynchronous API for visualizing Australia's electricity system using OpenNEM's stack.
Overview of .cursorrules prompt
The .cursorrules file outlines guidelines and conventions for contributing code to the OpenNEM project, an open-source initiative aimed at mapping and visualizing Australia's electricity system. It specifies using Python with several libraries such as FastAPI, Postgres, asyncpg, SqlAlchemy, and Alembic for managing database migrations. Code contributions should focus on functional and declarative programming, utilize asynchronous methods, and include type definitions and comprehensive docstrings. The use of environment variables and Pydantic models is encouraged, and developers should prefer exception handling over returning None. The project uses Docker for deployment, with separate processes for the FastAPI API and Arq scheduler managed via Uvicorn. The file encourages proposing more optimal methods and suggests using additional efficiency-enhancing libraries where applicable.