diff --git a/README.rst b/README.rst
index ac059b1..7e1f8cd 100644
--- a/README.rst
+++ b/README.rst
@@ -105,6 +105,15 @@ Features
+---------------------------+
先手の持駒: 銀
+* Render board as SVG.
+
+ .. code:: python
+
+ >>> print(board.svg())
+
+
* Detects checkmates, stalemates.
.. code:: python
diff --git a/shogi/SVG.py b/shogi/SVG.py
new file mode 100644
index 0000000..0ae69a3
--- /dev/null
+++ b/shogi/SVG.py
@@ -0,0 +1,360 @@
+# -*- coding: utf-8 -*-
+#
+# This file is part of the python-shogi library.
+#
+# Copyright (C) 2020- Yui Matsumura
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+def sfen_to_svg(sfen):
+ svg = """
+ '
+ return svg
\ No newline at end of file
diff --git a/shogi/__init__.py b/shogi/__init__.py
index 992964b..57d0687 100644
--- a/shogi/__init__.py
+++ b/shogi/__init__.py
@@ -28,6 +28,8 @@
from .Move import *
from .Piece import *
from .Consts import *
+from .SVG import *
+
PIECE_TYPES_WITHOUT_KING = [
PAWN, LANCE, KNIGHT, SILVER,
@@ -1124,6 +1126,10 @@ def sfen(self):
return ''.join(sfen)
+ def svg(self):
+ svg = SVG.sfen_to_svg(self.sfen())
+ return svg
+
def set_sfen(self, sfen):
'''
Parses a SFEN and sets the position from it.