Skip to main content

This Python tool accurately inserts the historical long S character ( ſ ) back into the given text to make it appear as if it were written before the 20th century. English, French, German, Spanish and Italian are supported.

Project description

py-long-s

This Python tool accurately inserts the historical long S character ( Å¿ ) back into the given text to make it appear as if it were written before the 20th century.

English, French, German, Spanish, and Italian are supported.

Requirements:

pip install unidecode is the only required library for conversion, but if you want to convert .odf and .docx file types as well, install:

pip install unidecode odfpy python-docx

Online Converter

There's also a JavaScript version available that can be used online.


Example

import long_s

print(long_s.convert("The discussion was surprisingly insightful.", lang="en"))
print(long_s.convert("La discussion était étonnamment perspicace.", lang="fr"))
print(long_s.convert("Die Diskussion war überraschend aufschlussreich.", lang="de"))
print(long_s.convert("La discusión fue sorprendentemente perspicaz.", lang="es"))
print(long_s.convert("La discussione è stata sorprendentemente perspicace.", lang="it"))
The diſcuſſion was ſurpriſingly inſightful.
La diſcuſſion était étonnamment perſpicace.
Die Diskuſſion war überraſchend aufſchluſsreich.
La diſcuſión fue ſorprendentemente perſpicaz.
La diſcuſſione è ſtata ſorprendentemente perſpicace.

Converting Files

.txt files

long_s.convert_text_file(src_path="story.txt", dst_path=None, lang="en"))

Since dst_path is None, the program will save the converted text file as story-long-s.txt.


.odf files

long_s.convert_odf_file(src_path="story.odt", dst_path="old-story.odt", lang="en"))

.docx files

long_s.convert_docx_file(src_path="märschen.docx", lang="de"))

Special Thanks

Thank you Andrew West of the TeX Users Group for the documentation found under The Rules for Long S, which was fundamental in writing the conversion functions for English, French, Spanish, and Italian.

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

long-s-1.0.3.tar.gz (46.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

long_s-1.0.3-py3-none-any.whl (49.1 kB view details)

Uploaded Python 3

File details

Details for the file long-s-1.0.3.tar.gz.

File metadata

  • Download URL: long-s-1.0.3.tar.gz
  • Upload date:
  • Size: 46.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.6

File hashes

Hashes for long-s-1.0.3.tar.gz
Algorithm Hash digest
SHA256 7337951b85a4bc795ded1e56519f2a6086d5d0e5ea6274d54c0c37b00432f2d1
MD5 1eeaab0d2ff97c57989e41c920ab5752
BLAKE2b-256 a8a122d181ce55ecda9214b2b5975a01f20ea37376b57ebe946667b7eae23730

See more details on using hashes here.

File details

Details for the file long_s-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: long_s-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 49.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.6

File hashes

Hashes for long_s-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90e8819ce122889d992cb27a6f08f9ac086e970bbf47443558531d4a2717e269
MD5 9bfb8c0ad86ccba02c01aae55175a76f
BLAKE2b-256 98d9ca33acb872f31ccc85dd978c2986274ed34acd06fdeca0c4ce4a77b99e8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page