Metadata-Version: 2.1
Name: py_fumen
Version: 0.1.11
Summary: A package that replicates js fumen in python. More description on 'https://github.com/hsohliyt105/py-fumen'
Project-URL: Homepage, https://github.com/hsohliyt105/py-fumen
Project-URL: Issues, https://github.com/hsohliyt105/py-fumen/issues
Author-email: hsohliyt105 <hsohliyt105@naver.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: hatchling
Description-Content-Type: text/markdown

# py-fumen
Python implementation of knewjade's fumen

# Installation 
Enter `pip install py-fumen` in terminal / cmd if you have python3 already.

# Uses
The usage of this package is very similar to the original fumen package.

## Decode
```
from py_fumen.decoder import decode

decode_pages = decode("v115@vhHJEJWPJyKJz/I1QJUNJvIJAgH")

for page in decode_pages:
    print(page.get_field().string())
```

## Encode
```
from py_fumen.encoder import encode
from py_fumen.field import Field, create_inner_field
from py_fumen.page import Page

pages = []
pages.append(
    Page(field=create_inner_field(Field.create(
        'LLL_____SS' +
        'LOO____SST' +
        'JOO___ZZTT' +
        'JJJ____ZZT',
        '__________',
    )),
    comment='Perfect Clear Opener'))

print(encode(pages))
```

# Difference between the knewjade's fumen
Some of functions and variables are non-private because of the disparity between python and typescript (e.g. quiz variable in the Quiz class).

Function and varibale names are changed with python naming convention.

create_inner_field function and create_new_inner_field are moved to field.py because of cross importing issue.

page.py is created for better OOP.

js_escape.py is added to imitate javascript's escape/unescape.

buffer.ts is renamed to fumen_buffer.py and Buffer object to FumenBuffer.

getters and setters are changed into methods (e.g. Page.get_field()). 
