Code that allows you to convert chains of comments into ace attorney scenes. It's meant to be used by bots or other apps. List of users:
This is a fork of a wonderful Reddit bot
Clone the repository
git clone https://github.com/LuisMayo/objection_engine
Install dependencies (in case any problems are encountered please check faq.md) You can use either pip
python -m pip install .
Or poetry
poetry install
(optional) In case you want language support outside English install polyglot and its dependencies: (if on windows check faq.md)
python3 -m pip install pyICU pycld2 morfessor polyglot
Check the exmaple
python example.py
Add this git repository as a library:
pip install objection_engine
Import it into your python file
import objection_engine
# You can also import the components like this
from objection_engine.renderer import render_comment_list
from objection_engine.beans.comment import Comment
Create a list of comments
foo = [objection_engine.comment.Comment(), objection_engine.comment.Comment(text_content='Second comment', user_name="Second user")]
Render the list
objection_engine.renderer.render_comment_list(foo)
For 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
There is a complete example in https://github.com/LuisMayo/objection-engine-testing
cp example.py docker-entrypoint.py
docker build --tag objection-engine .
docker run --rm \
--volume $(pwd)/docker-entrypoint.py:/app/entrypoint.py:ro \
--volume $(pwd)/assets:/app/assets \
--volume $(pwd)/outputs:/app/outputs \
objection-engine
The video will be in the /outputs
directory.
You can download Polyglot models by setting oe_polyglot_models
environment variable and preserve the data by mounting /root/polyglot_data
:
docker run --rm \
--volume $(pwd)/docker-entrypoint.py:/app/entrypoint.py:ro \
--volume $(pwd)/assets:/app/assets \
--volume $(pwd)/outputs:/app/outputs \
--volume $(pwd)/polyglot_data:/root/polyglot_data \
--env oe_polyglot_models="de fr" \
objection-engine
The following environment variables are honored by objection_engine:
Since 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.