This commit is contained in:
William Toohey 2018-01-09 17:05:30 +10:00
parent 1fc6b47484
commit acd3a4195d
3 changed files with 11 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.pyc *.pyc
dist/ dist/
kbinxml.egg-info/ kbinxml.egg-info/
build/

View File

@ -3,8 +3,11 @@
An encoder/decoder for Konami's binary XML format, used in some of their games. An encoder/decoder for Konami's binary XML format, used in some of their games.
### Setup: ### Setup:
`pip install git+https://github.com/mon/kbinxml/` `pip install kbinxml`
You can use `kbinxml` from the commandline to convert files.
Python usage:
```python ```python
In [1]: from kbinxml import KBinXML In [1]: from kbinxml import KBinXML
In [2]: text = KBinXML('<?xml version="1.0"?><root __type="str">Hello, world!</root>') In [2]: text = KBinXML('<?xml version="1.0"?><root __type="str">Hello, world!</root>')
@ -14,6 +17,4 @@ Out[4]: b'\xa0B\x80\x7f\x00\x00\x00\x08\x0b\x04\xdfM9\xfe\xff\x00\x00\x00\x00\x1
In [5]: bin = KBinXML(Out[4]) In [5]: bin = KBinXML(Out[4])
In [6]: bin.to_text() In [6]: bin.to_text()
Out[7]: u'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<root __type="str">Hello, world!</root>\n' Out[7]: u'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<root __type="str">Hello, world!</root>\n'
``` ```
You can also use `kbinxml` from the commandline to convert files.

View File

@ -9,14 +9,18 @@ requires = [
if sys.version_info < (3,0): if sys.version_info < (3,0):
requires.append('future') requires.append('future')
version = '1.2'
setup( setup(
name='kbinxml', name='kbinxml',
version='1.1', description="Decoder/encoder for Konami's binary XML format",
long_description="See Github for up to date documentation",
version=version,
entry_points = { entry_points = {
'console_scripts': ['kbinxml=kbinxml:main'], 'console_scripts': ['kbinxml=kbinxml:main'],
}, },
packages=['kbinxml'], packages=['kbinxml'],
url='https://github.com/mon/kbinxml/', url='https://github.com/mon/kbinxml/',
download_url = 'https://github.com/mon/kbinxml/archive/{}.tar.gz'.format(version),
author='mon', author='mon',
author_email='me@mon.im', author_email='me@mon.im',
install_requires=requires install_requires=requires