typograf

Client for atrlebedev typograf service


License
MIT
Install
pip install typograf==0.1.1

Documentation

Typograf

Build Status Latest Version

client for artlebedev typograf webservice

«Вы все еще кое-как верстаете в „Ворде“? — Тогда мы идем к вам!»

--- Python2 not Unicode ================ ```python # -*- encoding: windows-1251 -*- from typograf import RemoteTypograf rt = RemoteTypograf('windows-1251', p=True, br=True) print rt.process_text(u'"Âû âñå åùå êîå-êàê âåðñòàåòå â "Âîðäå"? - Òîãäà ìû èäåì ê âàì!"') ```
<p>&laquo;Вы&nbsp;все еще кое-как верстаете в&nbsp;&bdquo;Ворде&ldquo;? &mdash;&nbsp;Тогда мы&nbsp;идем к&nbsp;вам!&raquo;<br />
</p>

Python2 Unicode

# -*- encoding: utf-8 -*-
from typograf import RemoteTypograf
rt = RemoteTypograf(p=True, br=True) # UTF-8
print rt.process_text(u'"Вы все еще кое-как верстаете в "Ворде"? - Тогда мы идем к вам!"')
<p>&laquo;Вы&nbsp;все еще кое-как верстаете в&nbsp;&bdquo;Ворде&ldquo;? &mdash;&nbsp;Тогда мы&nbsp;идем к&nbsp;вам!&raquo;<br />
</p>

Python3

from typograf import RemoteTypograf
rt = RemoteTypograf(p=True, br=True)
print(rt.process_text('"Вы все еще кое-как верстаете в "Ворде"? - Тогда мы идем к вам!"'))
<p>&laquo;Вы&nbsp;все еще кое-как верстаете в&nbsp;&bdquo;Ворде&ldquo;? &mdash;&nbsp;Тогда мы&nbsp;идем к&nbsp;вам!&raquo;<br />
</p>