{"id":15451867,"url":"https://github.com/schollz/poetry-generator","last_synced_at":"2025-04-09T15:05:57.243Z","repository":{"id":23961913,"uuid":"27344170","full_name":"schollz/poetry-generator","owner":"schollz","description":"A Python2 based Backus-Naur poetry generator","archived":false,"fork":false,"pushed_at":"2020-05-14T17:18:19.000Z","size":102,"stargazers_count":294,"open_issues_count":4,"forks_count":69,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-09T15:05:53.327Z","etag":null,"topics":["poem","poetry-generator","python"],"latest_commit_sha":null,"homepage":"http://www.poetrygenerator.ninja","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/schollz.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},"funding":{"github":"schollz"}},"created_at":"2014-11-30T17:39:18.000Z","updated_at":"2024-11-01T12:48:55.000Z","dependencies_parsed_at":"2022-07-30T05:17:56.161Z","dependency_job_id":null,"html_url":"https://github.com/schollz/poetry-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Fpoetry-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Fpoetry-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Fpoetry-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Fpoetry-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schollz","download_url":"https://codeload.github.com/schollz/poetry-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055284,"owners_count":21040157,"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":["poem","poetry-generator","python"],"created_at":"2024-10-01T21:40:21.268Z","updated_at":"2025-04-09T15:05:57.223Z","avatar_url":"https://github.com/schollz.png","language":"Python","funding_links":["https://github.com/sponsors/schollz"],"categories":[],"sub_categories":[],"readme":"# A Python2 based Backus-Naur poetry generator.\n\nThis program works on the basis that every word in the English language is either \"positive\" or \"negative.\" For instance \"lovely\" is positive and \"thorn\" is negative. A \"poem\" is a group of sentences that are structured in a way to have +1, -1 or 0 in terms of the positivity/negativity.  A \"mushy poem\" is strictly positive.\n\nAll the syntax and word choices are in the `brain.yaml` file (more info about this below).\n\nTry the [demo here](http://www.poetrygenerator.ninja).\n\n# Docker\n\n```\n$ docker run -p 8000:8000 schollz/poetry-generator\n```\n\nNow open your browser to localhost:8000!\n\n### Changes in new version\n - Use YAML\n - Reverted to Python2 (to use Nodebox Linguistics)\n - Use Nodebox Linguistics for plurality and conjugations (saves much space)\n - Poem dictation (Chrome only)\n\n# Setup\nFollow these commands to generate a poem if you have minimal experience coding/etc. Open up a terminal and use\n\n```bash\ngit clone https://github.com/schollz/poetry-generator.git\ncd poetry-generator\n```\n\nInstall Python requirements\n\n```bash\npip install -r requirements.txt\n```\n\nDownload and unzip the NodeBox linguistics package:\n\n```bash\nwget https://www.nodebox.net/code/data/media/linguistics.zip\nunzip linguistics.zip\n```\n\nAnd then run using\n\n```bash\nwaitress-serve --port=8000 poetrygenerator:application\n```\n\nThen open your browser to `localhost:8000` to see the poetry generator.\n\n# About the brain file\n\nExamples of the types of words:\n\n```\nverb-pr = hopes\nverb-past = hoped\nverb = hope\nverb-inf = hoping\n```\n\nCurrently you only need to put in the infinitive form, and the other forms will be determined automaticlaly.\n\n# Deployment\nI wrote a deployment script for easy NGINX deployment (keep reading). This will install NGINX blocks, as well as a Linux `init.d` script to automatically start and stop gunicorn.\n\nEdit deploy.py to change\n\n```\nAPP_NAME = 'poetry-generator'\nAPP_URL = 'www.poetrygenerator.ninja'\nAPP_PORT = 8002\n```\n\nor leave the same - its up to you.\n\nThen run\n\n```\nsudo python deploy.py install\n```\n\nThis program now uses `virtualenv` so it can be deployed with `gunicorn`. The installation creates `virtualenv` and downloads the packages. Then it writes a new `init.d` script and sends that so that it can automatically start and stop. If you deploy, it will also generate a nginx server block so its already to go.\n\nThe program should be running and accessible on your LAN network at\n\n```\nYOURLOCALIP:8002/\n```\n\n### Common Error\nWhen you run, you may see the following error:\n\n```bash\n[....] Reloading nginx configuration (via systemctl): nginx.serviceJob for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.\n failed!\n```\n\nTo fix this, you just need to enable the server_names in nginx. First\n\n```\nsudo vim /etc/nginx/nginx.conf\n```\n\nAnd uncomment these lines:\n\n```bash\nserver_names_hash_bucket_size 64;\nserver_name_in_redirect off;\n```\n\nand _now_ you should be good to go!\n\n\n# Credits\nThanks to [nylen](https://github.com/nylen) for greatly improving Poetry Generator, by fixing code and adding permalinks to poems!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschollz%2Fpoetry-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschollz%2Fpoetry-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschollz%2Fpoetry-generator/lists"}