A parser for the twee format
Project description
Features
- Parse the .twee file with twee 3 spec
StoryTitle
StoryData
Special Tags: script, stylesheet
Convert the Story to twine 2 HTML spec
Convert the Story to twine 2 JSON doc
Run as a command
Use
# Install by pip $ python -m pip install pytwee
# Run in console $ python -m pytwee tests/t001.tw $ pytwee tests/t001.tw
# Import as a module
import pytwee
story = pytwee.story.Story()
with open('my-story.tw', 'rt') as f:
parser = pytwee.twee3.Parser(story)
for line in iter(f.readline, ''):
parser(line.rstrip('\n'))
del parser #<- very important
print('story:', story)
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytwee-0.3.3.tar.gz.
File metadata
- Download URL: pytwee-0.3.3.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
379bb96a014b806ee6781f467dd28a3fbebb7489bff265f0c37842c01716f6ad
|
|
| MD5 |
15c2c4dd11954b14e9cf1705ca8c925e
|
|
| BLAKE2b-256 |
7feee301d4d6c5b2202287ef9e01f8f82b0dbe2e9482faa05ba97ca9f7687163
|
Provenance
The following attestation bundles were made for pytwee-0.3.3.tar.gz:
Publisher:
pypi.yml on jixingcn/pytwee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytwee-0.3.3.tar.gz -
Subject digest:
379bb96a014b806ee6781f467dd28a3fbebb7489bff265f0c37842c01716f6ad - Sigstore transparency entry: 244775525
- Sigstore integration time:
-
Permalink:
jixingcn/pytwee@fc4ce7b021593a7a7ed1e5209f96ad42a8d5f03b -
Branch / Tag:
refs/tags/0.3.3 - Owner: https://github.com/jixingcn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@fc4ce7b021593a7a7ed1e5209f96ad42a8d5f03b -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytwee-0.3.3-py3-none-any.whl.
File metadata
- Download URL: pytwee-0.3.3-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
351fc1ef5b253ab2f761a955d39401e0c0e74c83bf5e4484252c120ef08f3066
|
|
| MD5 |
8d4979a098c6765493672ceeb669c019
|
|
| BLAKE2b-256 |
80f1f75c71ba547e1dee67eaf21571ca14566588d055d34c3a716a3dd731bc2f
|
Provenance
The following attestation bundles were made for pytwee-0.3.3-py3-none-any.whl:
Publisher:
pypi.yml on jixingcn/pytwee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytwee-0.3.3-py3-none-any.whl -
Subject digest:
351fc1ef5b253ab2f761a955d39401e0c0e74c83bf5e4484252c120ef08f3066 - Sigstore transparency entry: 244775530
- Sigstore integration time:
-
Permalink:
jixingcn/pytwee@fc4ce7b021593a7a7ed1e5209f96ad42a8d5f03b -
Branch / Tag:
refs/tags/0.3.3 - Owner: https://github.com/jixingcn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@fc4ce7b021593a7a7ed1e5209f96ad42a8d5f03b -
Trigger Event:
push
-
Statement type: