Skip to content

Commit

Permalink
Upgrade Unidecode, add text-unidecode as extra option (#71)
Browse files Browse the repository at this point in the history
* Add replacements option (#67)

* add text-unidecode option as extra
  • Loading branch information
un33k committed Feb 25, 2019
1 parent 8aea5c4 commit 00e43c6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.0.0
- Upgrade Unidecode
- Allow install of text-unidecode as extra. "pip install python-slugify[text-unidecode]"

## 2.0.1
- Add replacements option e.g. [['|', 'or'], ['%', 'percent'], ['-', '_']] (@andriyor)

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ Overview
Notice
====================

By default, this modules installs and uses [Unidecode](https://github.com/avian2/unidecode) *(GPL)* for its decoding needs. However if you wish to use [text-unidecode](https://github.com/kmike/text-unidecode) *(GPL & Perl Artistic)* instead, please ensure it is installed prior to `python-slugify` installation.

In cases where both `Unidecode` and `text-unidecode` are installed, `Unidecode` is used as the default decoding module.
By default, this modules installs and uses [Unidecode](https://github.com/avian2/unidecode) *(GPL)* for its decoding needs. However if you wish to use [text-unidecode](https://github.com/kmike/text-unidecode) *(GPL & Perl Artistic)* instead, you must
install it as `python-slugify[text-unidecode]`.


How to install
Expand Down
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@
import sys
import codecs

install_requires = []
try:
import text_unidecode
except ImportError:
install_requires.append('Unidecode>=0.04.16')

name = 'python-slugify'
package = 'slugify'
description = 'A Python Slugify application that handles Unicode'
url = 'https://github.com/un33k/python-slugify'
author = 'Val Neekman'
author_email = 'info@neekware.com'
license = 'MIT'
install_requires = ['Unidecode==1.0.23']
extras_require = {'text-unidecode': ['text-unidecode==1.2']}

classifiers = [
'Development Status :: 5 - Production/Stable',
Expand Down Expand Up @@ -70,6 +66,7 @@ def get_version(package):
author_email=author_email,
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
install_requires=install_requires,
extras_require=extras_require,
classifiers=classifiers,
entry_points={'console_scripts': ['slugify=slugify.slugify:main']},
)
2 changes: 1 addition & 1 deletion slugify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

__author__ = 'Val Neekman @ Neekware Inc. [@vneekman]'
__description__ = 'A Python slugify application that also handles Unicode'
__version__ = '2.0.1'
__version__ = '3.0.0'
4 changes: 2 additions & 2 deletions slugify/slugify.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
unichr = chr

try:
import unidecode
except ImportError:
import text_unidecode as unidecode
except ImportError:
import unidecode

__all__ = ['slugify', 'smart_truncate']

Expand Down

0 comments on commit 00e43c6

Please sign in to comment.