{"id":31501466,"url":"https://github.com/mthomason/objectivemorality","last_synced_at":"2025-10-02T18:05:30.938Z","repository":{"id":316530696,"uuid":"1052816013","full_name":"mthomason/ObjectiveMorality","owner":"mthomason","description":"A multi-perspective ethical analysis system that evaluates actions through major philosophical frameworks.","archived":false,"fork":false,"pushed_at":"2025-09-25T05:21:42.000Z","size":740,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-25T07:05:41.348Z","etag":null,"topics":["aristotelian-ethics","cli","decision-making","deontology","education","ethical-framework","ethics","ethics-of-care","kantian-ethics","moral-decision-making","morality","nietzsche","philosophy","python","rawlsian-justice","simulation","social-contract-theory","teaching-tool","trolley-problem"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mthomason.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-08T15:31:32.000Z","updated_at":"2025-09-25T05:21:46.000Z","dependencies_parsed_at":"2025-09-25T07:05:50.212Z","dependency_job_id":"94225217-b94a-45e8-b395-27f6fd6c6bd8","html_url":"https://github.com/mthomason/ObjectiveMorality","commit_stats":null,"previous_names":["mthomason/objectivemorality"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mthomason/ObjectiveMorality","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2FObjectiveMorality","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2FObjectiveMorality/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2FObjectiveMorality/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2FObjectiveMorality/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mthomason","download_url":"https://codeload.github.com/mthomason/ObjectiveMorality/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthomason%2FObjectiveMorality/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278047330,"owners_count":25921015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-02T02:00:08.890Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aristotelian-ethics","cli","decision-making","deontology","education","ethical-framework","ethics","ethics-of-care","kantian-ethics","moral-decision-making","morality","nietzsche","philosophy","python","rawlsian-justice","simulation","social-contract-theory","teaching-tool","trolley-problem"],"created_at":"2025-10-02T18:05:26.593Z","updated_at":"2025-10-02T18:05:30.928Z","avatar_url":"https://github.com/mthomason.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Objective Morality\n\nObjective Morality is a Python project that provides a framework for analyzing ethical dilemmas from various philosophical perspectives. It's designed to be a tool for teaching and exploring the differences between philosophical ideas and how they relate to one another. By defining a \"moral context\" for a given action, you can see how different ethical engines would evaluate that action, providing a side-by-side comparison of their conclusions.\n\nThis project is intended for educational purposes, particularly in a university setting, to help students understand the practical application of ethical theories.\n\n## Features\n\n*   **Multiple Moral Engines:** The project includes implementations of several major ethical frameworks:\n    *   Kantian Deontology\n    *   Utilitarianism\n    *   Aristotelian Virtue Ethics\n    *   Social Contract Theory (Contractualism)\n    *   Rossian Pluralism\n    *   Nietzschean Ethics\n    *   Ethics of Care\n    *   Rawlsian Justice\n*   **Customizable Scenarios:** Define your own ethical dilemmas by creating simple JSON files that describe the \"moral context\" of an action.\n*   **Comparative Analysis:** The output clearly shows the judgment of each philosophical engine, allowing for easy comparison.\n*   **Consistency-Checking:** The system runs checks to highlight logical tensions or divergences between the verdicts of different engines.\n*   **Typed and Extensible:** The codebase uses Python's type hinting for clarity and is designed to be easily extended with new moral engines or context parameters.\n\n## Getting Started\n\n### Prerequisites\n\n*   Python 3.x\n\n### Installation\n\n1.  Clone the repository:\n    ```bash\n    git clone https://github.com/mthomason/ObjectiveMorality.git\n    cd ObjectiveMorality\n    ```\n2.  There are no external libraries to install.\n\n### Running the Program\n\nTo run the demonstration with the pre-defined moral scenarios, execute the following command from the root directory:\n\n```bash\npython3 -m morals\n```\n\nThis will run the analyses for all the scenarios defined in `morals/main.py` and print the results to the console.\n\n![Example Terminal Output](assets/terminal-output-example.png)\n\n## Usage\n\nThere are two ways to create new moral scenarios: by editing the main Python file directly or by creating a separate JSON file. For beginners, we recommend editing the Python file.\n\n### Method 1: Editing the Python File (Recommended for Beginners)\n\nThis is the easiest way to see how the scenarios are constructed and to create your own.\n\n**Step 1: Open the main file**\n\nNavigate to the `morals/` directory and open the `main.py` file in a text editor.\n\n**Step 2: Find the examples**\n\nScroll down in the file. You will see sections clearly marked for each moral case, such as \"Moral Case: Adultery\" and \"Moral Case: Pork Modern\".\n\n**Step 3: Copy an existing example**\n\nTo create your own scenario, the easiest way is to copy an entire existing moral case block. For example, you could copy the whole \"Moral Case: Charity\" section, from the comment line to the `engine_runner.run_engines(...)` line.\n\n**Step 4: Paste and modify your new scenario**\n\nPaste the copied block at the end of the other examples (but before the `display_results` section). Now, you can modify it:\n\n1.  **Change the context variable name:** Rename `context_charity` to something unique, like `context_my_scenario`.\n2.  **Update the action description:** Change the text in `action_description` to describe your new dilemma.\n3.  **Adjust the parameters:** Change the values for `net_flourishing`, `duties_violated`, etc., to match your new scenario. The comments in the examples will help you understand what each parameter means.\n4.  **Run your scenario:** Make sure to update the `engine_runner.run_engines(...)` call to use your new context variable name (e.g., `result_my_scenario = engine_runner.run_engines(\"my_scenario\", context_my_scenario)`).\n5.  **Display the results:** Add a line to the display section at the bottom of the file, like `engine_runner.display_results(\"my_scenario\", context_my_scenario, result_my_scenario)`.\n\n**Step 5: Run the program**\n\nSave the `main.py` file and run the program as before. You will see the analysis for your new scenario in the output.\n\n### Method 2: Creating a JSON file\n\nThis method is for more advanced users who are comfortable with JSON.\n\nMoral scenarios can also be defined as JSON files in the `moral_data/` directory. Each JSON file represents a \"moral context\". You can see examples like `adultery.json` in that folder. To add a new scenario via JSON, you would create a new file and then load it in `main.py` using the `context_manager.load_context()` function, similar to how the \"adultery\" example is loaded.\n\n### Interpreting the Output\n\nThe output for each scenario is divided into several sections:\n\n1.  **Context:** A summary of the input parameters for the moral scenario.\n2.  **Quick Consensus:** A high-level overview grouping the philosophies by a core judgment of GOOD, BAD, or NEUTRAL.\n3.  **Detailed Analysis:** The specific verdict from each moral engine, along with a brief explanation of its meaning.\n4.  **Core Moral Value Mapping:** A list showing which philosophers fall under each core judgment.\n5.  **Cross-Engine Consistency Report:** (Optional) If any logical inconsistencies are detected between the engines, they will be reported here.\n\n## The Moral Engines\n\n*   **Kantian Engine:** Evaluates actions based on the Categorical Imperative. An action is impermissible if universalizing it would lead to a logical contradiction or a contradiction in will.\n*   **Utilitarian Engine:** Focuses on the consequences of an action, judging it based on whether it produces the greatest good (utility or flourishing) for the greatest number.\n*   **Aristotelian Engine:** Assesses actions based on whether they align with a virtuous character and contribute to a flourishing life (*eudaimonia*).\n*   **Contractualist Engine:** Judges actions based on whether they would be permitted by rules that free, equal, and rational people would agree to.\n*   **Rossian Engine:** Balances multiple *prima facie* (self-evident) duties to determine the right course of action in a specific context.\n*   **Nietzschean Engine:** Analyzes actions based on whether they express a \"will to power\" and affirm life (Master Morality) or stem from weakness and resentment (Slave Morality).\n*   **Ethics of Care Engine:** Prioritizes the maintenance of relationships and the needs of specific, vulnerable individuals over abstract principles.\n*   **Rawlsian Engine:** Evaluates actions from behind a \"veil of ignorance,\" focusing on whether they are just and do not disadvantage the least well-off members of society.\n\n## Future Directions\n\nThis project is under active development. Some of the planned features include:\n\n*   **Additional Moral Engines:**\n    *   Divine Command Theory\n    *   Existentialist Ethics\n    *   Buddhist Ethics\n*   **Resolution Engine:** A system to provide guidance when the moral engines produce conflicting results.\n*   **Markdown Output:** The ability to generate the analysis in a Markdown format for easier sharing and documentation.\n\n## Contributing\n\nContributions are welcome! If you have suggestions for new features, improvements, or new moral engines, please open an issue or submit a pull request.\n\n## License\n\nThis project is released into the public domain. See the [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthomason%2Fobjectivemorality","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmthomason%2Fobjectivemorality","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthomason%2Fobjectivemorality/lists"}