{"id":29112684,"url":"https://github.com/jixingcn/pytwee","last_synced_at":"2025-06-29T11:02:21.564Z","repository":{"id":298526437,"uuid":"1000283932","full_name":"jixingcn/pytwee","owner":"jixingcn","description":"Parse/convert the twine format by python","archived":false,"fork":false,"pushed_at":"2025-06-20T15:25:47.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-28T15:45:12.098Z","etag":null,"topics":["converter","interactive","parser","story","storybook","twine-format","twine-game","twine2","twine3","twinery"],"latest_commit_sha":null,"homepage":"https://pytwee.readthedocs.io/","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/jixingcn.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","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}},"created_at":"2025-06-11T14:38:46.000Z","updated_at":"2025-06-20T15:25:50.000Z","dependencies_parsed_at":"2025-06-11T16:22:40.725Z","dependency_job_id":null,"html_url":"https://github.com/jixingcn/pytwee","commit_stats":null,"previous_names":["jixingcn/pytwee"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jixingcn/pytwee","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jixingcn%2Fpytwee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jixingcn%2Fpytwee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jixingcn%2Fpytwee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jixingcn%2Fpytwee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jixingcn","download_url":"https://codeload.github.com/jixingcn/pytwee/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jixingcn%2Fpytwee/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262457997,"owners_count":23314295,"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":["converter","interactive","parser","story","storybook","twine-format","twine-game","twine2","twine3","twinery"],"created_at":"2025-06-29T11:02:06.034Z","updated_at":"2025-06-29T11:02:21.499Z","avatar_url":"https://github.com/jixingcn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pytwee\r\n######\r\n\r\n|pylint-action| |test-action| |pypi-action|\r\n\r\n|pypi-version| |pypi-python| |pypi-status|\r\n\r\n|docs-badge|\r\n\r\n\r\nFeatures\r\n********\r\n\r\n- Parse the **.twee** file with `twee 3 spec \u003chttps://github.com/iftechfoundation/twine-specs/blob/master/twee-3-specification.md\u003e`_\r\n    - **StoryTitle**\r\n    - **StoryData**\r\n    - Special Tags: **script**, **stylesheet**\r\n- Convert the **Story** to `twine 2 HTML spec \u003chttps://github.com/iftechfoundation/twine-specs/blob/master/twine-2-htmloutput-spec.md\u003e`_\r\n- Convert the **Story** to `twine 2 JSON doc \u003chttps://github.com/iftechfoundation/twine-specs/blob/master/twine-2-jsonoutput-doc.md\u003e`_\r\n- Run as a command\r\n\r\n\r\nUse\r\n***\r\n\r\n::\r\n\r\n    # Install by pip\r\n    $ python -m pip install pytwee\r\n\r\n::\r\n\r\n    # Run in console\r\n    $ python -m pytwee tests/t001.tw\r\n    $ pytwee tests/t001.tw\r\n\r\n::\r\n\r\n    # Import as a module\r\n    import pytwee\r\n\r\n    story = pytwee.story.Story()\r\n\r\n    with open('my-story.tw', 'rt') as f:\r\n        parser = pytwee.twee3.Parser(story)\r\n        for line in iter(f.readline, ''):\r\n            parser(line.rstrip('\\n'))\r\n        del parser #\u003c- very important\r\n\r\n    print('story:', story)\r\n\r\n\r\nLicense\r\n*******\r\n\r\n|license|\r\n\r\n\r\n\r\n.. |pylint-action| image:: https://img.shields.io/github/actions/workflow/status/jixingcn/pytwee/pylint.yml?label=pylint\r\n    :alt: pylint workflow Status\r\n    :target: https://github.com/jixingcn/pytwee/actions/workflows/pylint.yml\r\n\r\n\r\n.. |test-action| image:: https://img.shields.io/github/actions/workflow/status/jixingcn/pytwee/test.yml?label=test\r\n    :alt: test workflow Status\r\n    :target: https://github.com/jixingcn/pytwee/actions/workflows/test.yml\r\n\r\n\r\n.. |pypi-action| image:: https://img.shields.io/github/actions/workflow/status/jixingcn/pytwee/pypi.yml?label=pypi\r\n    :alt: pypi workflow Status\r\n    :target: https://github.com/jixingcn/pytwee/actions/workflows/pypi.yml\r\n\r\n\r\n.. |pypi-version| image:: https://img.shields.io/pypi/v/pytwee\r\n    :alt: PyPI - Version\r\n    :target: https://pypi.org/project/pytwee\r\n\r\n\r\n.. |pypi-status| image:: https://img.shields.io/pypi/status/pytwee\r\n    :alt: PyPI - Status\r\n    :target: https://pypi.org/project/pytwee\r\n\r\n\r\n.. |pypi-python| image:: https://img.shields.io/pypi/pyversions/pytwee\r\n    :alt: PyPI - Python Version\r\n    :target: https://pypi.org/project/pytwee\r\n\r\n\r\n.. |docs-badge| image:: https://img.shields.io/readthedocs/pytwee/latest\r\n    :alt: Read the Docs (version)\r\n    :target: https://pytwee.readthedocs.io\r\n\r\n \r\n.. |license| image:: https://img.shields.io/badge/license-MIT-green\r\n    :alt: Static Badge\r\n    :target: https://github.com/jixingcn/pytwee/blob/main/LICENSE\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjixingcn%2Fpytwee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjixingcn%2Fpytwee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjixingcn%2Fpytwee/lists"}