Helping Canadian Citizens write their MLA, MPP, MNA, or MHA using the power of AI.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Write My MLA is an application that helps Canadian citizens write their local MLA, MPP, MNA, or MHA. The application uses the postal code of the user to search for their representative, and then input the issue that they're experiencing. Their experience is sent to either the OpenAI api, or a local instance of the GPT4all api to generate a professional letter that can then be sent on to their local representative.
This application was developed in Python and deployed on Streamlit.io with the intention that it can be quickdly and easily re-deployed and re-used on this platform.
To get a local copy up and running follow these simple steps.
- pip
python get-pip.py pip install --upgrade openai pip install streamlit
- openai
pip install --upgrade openai
- streamlit
pip install streamlit
-
Get an API Key for openAI at https://platform.openai.com/account/api-keys
-
Clone the repo
git clone https://github.com/brysonbest/writemymla.git
-
Create .streamlit/.secrets.toml folder and file in the root directory and add your API key
mkdir .streamlit cd .streamlit touch .secrets.tomlopenai_key="your key here"
-
Local Deployment
streamlit run writemymla.py
- Create a streamlit.io account https://share.streamlit.io/signup
- Deploy your application following the instructions at https://docs.streamlit.io/en/stable/deploy_streamlit_app.html
Use this application to search for and write Canadian MLA's, MPP's, MNA's, or MHA's. The application will return the name, party, and contact information for the representative, and provide the user with the opportunity to create an AI-generated letter. This is a not-for-profit project intended to aid citizens with finding their representatives.
The application is not intended to be used for any other purpose. Information is not vetted prior to dissemination, and may be inaccurate. Please go to your provincial website for the most up-to-date information. The application is not affiliated with any government body. Any actions taken based on the information provided by this application are the sole responsibility of the user.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
Project Link: https://github.com/brysonbest/writemymla
- Geocoder.ca Provided the API used to accurately search using postal code information.
- Represent Civic Information API Provided the API used to search for representatives based on location.
- OpenAI API Provided the API used to generate letters based on user input details.
- GPT4All API provided an open-source alternative for letter generation based on the user details.
OpenAI Provides the letter generation based on the user details
