{"id":16901753,"url":"https://github.com/luismayo/objection_engine","last_synced_at":"2025-03-17T06:32:08.600Z","repository":{"id":37033685,"uuid":"332585422","full_name":"LuisMayo/objection_engine","owner":"LuisMayo","description":"Library that turns comment chains into ace attorney scenes, used in several bots","archived":false,"fork":false,"pushed_at":"2024-02-11T18:03:41.000Z","size":7055,"stargazers_count":112,"open_issues_count":27,"forks_count":22,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T19:28:32.868Z","etag":null,"topics":["bot","hacktoberfest","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LuisMayo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"luismayo","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-01-25T00:07:43.000Z","updated_at":"2025-02-21T19:10:30.000Z","dependencies_parsed_at":"2024-01-05T13:32:15.664Z","dependency_job_id":null,"html_url":"https://github.com/LuisMayo/objection_engine","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisMayo%2Fobjection_engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisMayo%2Fobjection_engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisMayo%2Fobjection_engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisMayo%2Fobjection_engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuisMayo","download_url":"https://codeload.github.com/LuisMayo/objection_engine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847061,"owners_count":20357317,"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","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":["bot","hacktoberfest","python"],"created_at":"2024-10-13T18:01:04.470Z","updated_at":"2025-03-17T06:32:04.999Z","avatar_url":"https://github.com/LuisMayo.png","language":"Python","funding_links":["https://ko-fi.com/luismayo"],"categories":[],"sub_categories":[],"readme":"## Objection! rendering engine 👨🏼‍⚖️\n\nCode that allows you to convert chains of comments into ace attorney scenes. It's meant to be used by bots or other apps.\nList of users:\n- [Twiitter Bot](https://github.com/LuisMayo/ace-attorney-twitter-bot)\n- [Telegram Bot](https://github.com/LuisMayo/ace-attorney-telegram-bot)\n- [Discord Bot](https://github.com/LuisMayo/ace-attorney-discord-bot)\n\nThis is a fork of a wonderful [Reddit bot](https://github.com/micah5/ace-attorney-reddit-bot)\n\n## Getting Started\n\n### Prerequisites\n - Python 3. Python 3.8 and 3.9 and 3.10 have been proven to work.\n - FFMPEG instalation. In most Linux distros it should be available in the default package manager. In Windows systems it'd include downloading a [pre-compiled zip folder](https://ffmpeg.org/download.html#build-windows), extracting it and adding the /bin folder into the [system path](https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/)\n\n#### Optional\n - [Google Translation API Credentials](https://cloud.google.com/translate/docs/setup): These are needed for language support other than English. Other languages may work even without this credentials as the system will fallback to TextBlob's translation system.\n - Libraqm: Improves text rendering on right-to-left languages. In windows refer to the faq.md\n\n### Installing\n\nClone the repository\n\n```\ngit clone https://github.com/LuisMayo/objection_engine\n```\n\nInstall dependencies (in case any problems are encountered please check faq.md)\nYou can use either pip\n``` bash\npython -m pip install .\n```\nOr poetry\n``` bash\npoetry install\n```\n\n\n\n(optional) In case you want language support outside English install polyglot and its dependencies:\n(if on windows check faq.md)\n\n```bash\npython3 -m pip install pyICU pycld2 morfessor polyglot\n```\n\nCheck the exmaple\n`python example.py`\n\n### Using it as a library\n - Add this git repository as a library:\n`pip install objection_engine`\n\n - Import it into your python file\n``` python\nimport objection_engine\n# You can also import the components like this\nfrom objection_engine.renderer import render_comment_list\nfrom objection_engine.beans.comment import Comment\n```\n - Create a list of comments\n``` python\nfoo = [objection_engine.comment.Comment(), objection_engine.comment.Comment(text_content='Second comment',  user_name=\"Second user\")]\n```\n - Render the list\n``` python\nobjection_engine.renderer.render_comment_list(foo)\n```\nFor a list of arguments to the class and method check both https://github.com/LuisMayo/objection_engine/blob/main/renderer.py and https://github.com/LuisMayo/objection_engine/blob/main/beans/comment.py\n\nThere is a complete example in https://github.com/LuisMayo/objection-engine-testing\n\n### Rendering a video using Docker\n\n``` bash\ncp example.py docker-entrypoint.py\n\ndocker build --tag objection-engine .\ndocker run --rm \\\n  --volume $(pwd)/docker-entrypoint.py:/app/entrypoint.py:ro \\\n  --volume $(pwd)/assets:/app/assets \\\n  --volume $(pwd)/outputs:/app/outputs \\\n  objection-engine\n```\n\nThe video will be in the `/outputs` directory.\n\nYou can download Polyglot models by setting `oe_polyglot_models` environment variable and preserve the data by mounting `/root/polyglot_data`:\n\n``` bash\ndocker run --rm \\\n  --volume $(pwd)/docker-entrypoint.py:/app/entrypoint.py:ro \\\n  --volume $(pwd)/assets:/app/assets \\\n  --volume $(pwd)/outputs:/app/outputs \\\n  --volume $(pwd)/polyglot_data:/root/polyglot_data \\\n  --env oe_polyglot_models=\"de fr\" \\\n  objection-engine\n```\n\n#### Settings\nThe following environment variables are honored by objection_engine:\n- oe_bypass_sentiment: If on any value other than the empty string, the sentiment analysis is bypassed\n- oe_sentiment_model: If \"polyglot\", polyglot will be used for sentiment analisis, if empty or \"hf\" it would be a huggingface model. When using polyglot models remember to do python -m polyglot download TASK:sentiment2\n- ~~oe_stats_server~~ (not longer supported as of Objection engine 3.3.0): If present, it will be used as the URL to post statistics to. The server responsible should be similar to https://github.com/LuisMayo/simple-server-counter\n- oe_polyglot_models: (docker only) If on polyglot model(s), the data for the model will be downloaded when starting the container.\n- OE_DIRECT_H264_ENCODING: If \"true\" then it will directly encode the videos in H264 with OpenCV, instead of encoding in mp4v and re-encoding later. This is faster than the default, but it requires running on windows or having a self-compiled OpenCV build in your system. If you don't know what any of this means, don't enable it.\n## Contributing\nSince this is a tiny project we don't have strict rules about contributions. Just open a Pull Request to fix any of the project issues or any improvement you have percieved on your own. Any contributions which improve or fix the project will be accepted as long as they don't deviate too much from the project objectives. If you have doubts about whether the PR would be accepted or not you can open an issue before coding to ask for my opinion.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluismayo%2Fobjection_engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluismayo%2Fobjection_engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluismayo%2Fobjection_engine/lists"}