un33k / python-slugify Goto Github PK
View Code? Open in Web Editor NEWReturns unicode slugs
License: MIT License
Returns unicode slugs
License: MIT License
It seems python-slugify's dependency is fixed to text-unicode 1.2.
So I think you may need to fix this.
Hello,
can you make a breakdown what option exactly does and not only provide some sample examples for usage?
Thank you.
In your example:
txt = 'C\'est déjà l\'été.'
r = slugify(txt)
self.assertEqual(r, "cest-deja-lete")
I believe the result should be 'c-est-deja-l-ete', not 'cest-deja-lete'.
It would be nice to be able to specify a list of common English words which add little to a slug, e.g.
>>> slugify('The quick brown fox jumps over the lazy dog', stopwords=['the'])
'quick-brown-fox-jumps-over-lazy-dog'
I'm trying to test installing python-slugify with unidecode
vs text-unidecode
for Airflow, however, for some reason I'm getting the unidecode package installed by pip always even when passing the explicit flag for text-unidecode. I can see in the setup.py that this shouldn't happen, so I'm not really sure how it is.
Can you replicate what I'm experiencing below?
Note: I'm using pyenv and virtualenvwrapper commands.
SLUGIFY_USES_TEXT_UNIDECODE
(expected unidecode)t-mbp:~ taylor$ pyenv shell 3.6.5 && mktmpenv -i python-slugify
Using base prefix '/Users/taylor/.pyenv/versions/3.6.5'
New python executable in /Users/taylor/.local/share/virtualenvs/tmp-63bc530c9c5a5f1/bin/python3.6
Also creating executable in /Users/taylor/.local/share/virtualenvs/tmp-63bc530c9c5a5f1/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-63bc530c9c5a5f1/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-63bc530c9c5a5f1/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-63bc530c9c5a5f1/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-63bc530c9c5a5f1/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-63bc530c9c5a5f1/bin/get_env_details
Collecting python-slugify
Collecting Unidecode>=0.04.16 (from python-slugify)
Using cached https://files.pythonhosted.org/packages/59/ef/67085e30e8bbcdd76e2f0a4ad8151c13a2c5bce77c85f8cad6e1f16fb141/Unidecode-1.0.22-py2.py3-none-any.whl
Installing collected packages: Unidecode, python-slugify
Successfully installed Unidecode-1.0.22 python-slugify-1.2.5
This is a temporary environment. It will be deleted when you run 'deactivate'.
SLUGIFY_USES_TEXT_UNIDECODE=yes
(expected text-unidecode)t-mbp:~ taylor$ pyenv shell 3.6.5 && export SLUGIFY_USES_TEXT_UNIDECODE=yes && mktmpenv -i python-slugify
Using base prefix '/Users/taylor/.pyenv/versions/3.6.5'
New python executable in /Users/taylor/.local/share/virtualenvs/tmp-6e020af8417d51b/bin/python3.6
Also creating executable in /Users/taylor/.local/share/virtualenvs/tmp-6e020af8417d51b/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-6e020af8417d51b/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-6e020af8417d51b/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-6e020af8417d51b/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-6e020af8417d51b/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-6e020af8417d51b/bin/get_env_details
Collecting python-slugify
Collecting Unidecode>=0.04.16 (from python-slugify)
Using cached https://files.pythonhosted.org/packages/59/ef/67085e30e8bbcdd76e2f0a4ad8151c13a2c5bce77c85f8cad6e1f16fb141/Unidecode-1.0.22-py2.py3-none-any.whl
Installing collected packages: Unidecode, python-slugify
Successfully installed Unidecode-1.0.22 python-slugify-1.2.5
This is a temporary environment. It will be deleted when you run 'deactivate'.
Last login: Tue Aug 28 15:21:47 on ttys004
t-mbp:~ taylor$ pyenv shell 3.6.5 && export SLUGIFY_USES_TEXT_UNIDECODE=yes && mktmpenv -i text-unidecode -i python-slugify
Using base prefix '/Users/taylor/.pyenv/versions/3.6.5'
New python executable in /Users/taylor/.local/share/virtualenvs/tmp-8bec3e8a00b8e0b/bin/python3.6
Also creating executable in /Users/taylor/.local/share/virtualenvs/tmp-8bec3e8a00b8e0b/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-8bec3e8a00b8e0b/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-8bec3e8a00b8e0b/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-8bec3e8a00b8e0b/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-8bec3e8a00b8e0b/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/taylor/.virtualenvs/tmp-8bec3e8a00b8e0b/bin/get_env_details
Collecting text-unidecode
Using cached https://files.pythonhosted.org/packages/79/42/d717cc2b4520fb09e45b344b1b0b4e81aa672001dd128c180fabc655c341/text_unidecode-1.2-py2.py3-none-any.whl
Installing collected packages: text-unidecode
Successfully installed text-unidecode-1.2
Collecting python-slugify
Collecting Unidecode>=0.04.16 (from python-slugify)
Using cached https://files.pythonhosted.org/packages/59/ef/67085e30e8bbcdd76e2f0a4ad8151c13a2c5bce77c85f8cad6e1f16fb141/Unidecode-1.0.22-py2.py3-none-any.whl
Installing collected packages: Unidecode, python-slugify
Successfully installed Unidecode-1.0.22 python-slugify-1.2.5
This is a temporary environment. It will be deleted when you run 'deactivate'.
Installing python-slugify can takes ages as due to recompilation. It would prove very useful if pre-build wheels would also be published to pypi.
As a note, github actions can be used to produce binaries for almost any platform, including arm64. There is no need to cover all platforms, including linux and macos x64 would probably already cover most use case. Once the project has
I am not yet sure if that is only a performance issue but even after 10mins, pip is still stuck trying to build it.
Processing /Users/ssbarnea/Library/Caches/pip/wheels/11/94/81/312969455540cb0e6a773e5d68a73c14128bfdfd4a7969bb4f/python_slugify-4.0.0-py2.py3-none-any.whl
pip install python-slugify
Collecting python-slugify
Downloading python-slugify-4.0.1.tar.gz (11 kB)
Collecting text-unidecode>=1.3
Downloading text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
|████████████████████████████████| 78 kB 110 kB/s
Building wheels for collected packages: python-slugify
Building wheel for python-slugify (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: '/home/admin/Documents/GitHub/The Blog/envroment/bin/python' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4483in9n/python-slugify/setup.py'"'"'; file='"'"'/tmp/pip-install-4483in9n/python-slugify/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-t_kn76sm
cwd: /tmp/pip-install-4483in9n/python-slugify/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
ERROR: Failed building wheel for python-slugify
Version 1.0.1 of this package has disappeared from PyPi repository and this broke our pip requirement python-slugify==1.0.1
.
Please never remove old versions from PyPy repository.
In [1]: from slugify import slugify
In [2]: slugify('રાજમાં')
Out[2]: 'raajmaan'
In [3]: slugify('好こん안tวั')
Out[3]: 'hao-konantwa'
In [4]: slugify('😀 😃 😄 😁 😆 😅 😂 🤣 🥲 ☺️ 😊 😇 🙂 🙃 😉')
Out[4]: ''
For emojis and other special characters, the slug is coming empty.
Downloads: 10 items
Traceback (most recent call last):
File "gparch_cli.py", line 138, in <module>
account.download_all_albums()
File "C:\Projects\ArchiverForGooglePhotos\gparch.py", line 315, in download_all_albums
self.download_single_album(album)
File "C:\Projects\ArchiverForGooglePhotos\gparch.py", line 362, in download_single_album
album_path = auto_mkdir(self.albums_dir + "/" + album["title"])
File "C:\Projects\ArchiverForGooglePhotos\gparch.py", line 73, in auto_mkdir
os.mkdir(new_path)
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Projects\\ArchiverForGooglePhotos/Albums/Demänovská Dolina: путешествие'
Type stubs for this library were submitted to typeshed in python/typeshed#4429
You don't need to take any action, but:
a) If you wish to include type stubs as part of your package, we're happy to transfer them to this repo (or potentially aid with the addition of inline types)
b) If you want us to remove the stubs from typeshed, we will!
The right single quotation mark (’
) should be replaced by a separator, like the standard apostrophe.
Maybe \u2019
should be searched in QUOTE_PATTERN
?
More info : Response to "What’s the right character for an apostrophe?"
Currently getting:
Traceback (most recent call last):
...
File "/home/adys/.local/share/virtualenvs/wow/lib/python3.4/site-packages/slugify.py", line 24, in slugify
unicode(
Thanks for merging #26. I believe for this to take effect, there needs to be a new release of python-slugify. Could you create v1.2.1 to include these changes?
Would it be possible to release a new version of this package on PyPI? I am heavily relying on #54 and, for that reason, currently have users installing this package from the development branch of this repository on github, which is far from optimal.
Python 2.7
setuptools error when pip install python-slugify==1.2.5
ImportError: No module named pkg_resources
Running pip install python-slugify==1.2.4
works fine.
I'm trying a very simple test as we look at moving from the outdated awesome-slugify
to python-slugify
. For backward compatibility reasons we are trying to match its present behavior.
For the data involved this can be accomplished after jumping through a few small hoops, but not all of them can be accomplished within python-slugify
using the options available.
One hoop is trivial (you can't seem to force the conversion of ,
to -
short of pre-replacing the comma with something else.)
However, the other hoop is more odd: I can't seem to disable HTML entity decoding.
In [1]: slugify.slugify('1-209-3-Ž', entities=True)
Out[1]: '1-209-3-z'
In [2]: slugify.slugify('1-209-3-Ž', entities=False)
Out[2]: '1-209-3-z'
If entities
isn't what mediates this conversion, what does, and is it configurable? Currently (like commas) replacing #&
with something like _
seems to be the only way to disable that behavior when necessary.
Hello,
When installing version 1.2.2 with buildout I have this error :
Getting distribution for 'python-slugify'.
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 2270, in main
**kw
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 411, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 655, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 700, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 881, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1120, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1106, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 258, in run_setup
raise
File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 169, in save_modules
saved_exc.resume()
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 144, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 157, in save_modules
yield saved
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 255, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 285, in run
return func()
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in runner
_execfile(setup_script, ns)
File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-nJRC3I/python-slugify-1.2.2/setup.py", line 89, in <module>
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 209, in run
os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
File "/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 245, in zip_safe
return analyze_egg(self.bdist_dir, self.stubs)
File "/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 355, in analyze_egg
safe = scan_module(egg_dir, base, name, stubs) and safe
File "/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 392, in scan_module
code = marshal.load(f)
ValueError: bad marshal data (unknown type code)
An error occurred when trying to install /tmp/tmpN77DXmget_dist/python-slugify-1.2.2.tar.gz. Look above this message for any errors that were output by easy_install.
While:
Installing eggs.
Getting distribution for 'python-slugify'.
I do not have this problem when using version 1.2.1
Hi there, could you please tag 5.0.2? The arch linux package pulls git tags instead of pulling from pypi. Thanks in advance.
Hi There,
I am one of the maintainers of Apache Airflow, licensed under the Apache License 2.0. A contributor made us aware that we are dependent on “unidecode” a GPLv3 licensed python library, due to an indirect dependency on python-slugify (by means of python-nvd3).
As derivative works of GPLv3 also need to GPL licensed this would make also python-slugify incompliant due to its MIT license. I have asked the maintainer of “unidecode” to dual license under the perl artistic license which would be compatible, but unfortunately that was refused (avian2/unidecode#23).
As python-slugify therefore seems to have a license incompatibility issue, would you accept a patch that changes the dependency to text-unidecode (https://github.com/kmike/text-unidecode)?
Thanks
Bolke
This is probably beyond doable, since it would require extensive lookups, but slugifying can result in erroneous output if a given character has multiple readings (多音字), and context would be required to determine the correct slug, e.g. 行 is correctly rendered 'xing' when it stands alone, but 'hang' it would have to be slugified as 'hang' when it stands with 银行 (銀行) in a compound word. (See 3rd paragraph in this.)
I'd like to use this library for sanitizing the URL by stripping out non-letters, converting spaces to dashes, etc.
But I don't want to convert non-english letters to their ASCII equivalents. For example, I want slugify('ß')
to return 'ß'. Could you add a parameter that supports this behavior?
Similar to the default behavior of this library? https://github.com/mozilla/unicode-slugify
I want the extra options of python-slugify
such as max length, word boundary, stopwords, and an active maintainer, otherwise I'd use that library.
Hi, is there a plan for declaring Python 3.7 support in python-slugify?
Gotchas ...
awesome-slugify
Given a title of "Baby's new shoes", slugify ought to return "babys-new-shoes" but instead returns "baby-s-new-shoes" which isn't right. Seems related to changes made for #17.
I may have misunderstood the original intentions of this module, but some German, Danish/Norwegian letters aren't mapped correctly by slugify
. E.g. while 'æ' is correctly resolved as 'ae' (Danish/Norwegian), 'ø' is incorrectly rendered 'o' (in Danish only, but correct for Norwegian usage). The mapping of 'ö' is also language dependent (German: 'oe', but Hungarian, Finnish, Swedish: 'o')
python-slugify
is now used by 21k+ projects and many major companies. As such, it would be smart to have more than one person with admin access to the project, especially, in times of pandemics.
If you would like to contribute in de-risking python-slugify
and posses solid python background, with keen interests in supporting open source projects for the benefit of many; - send me an email with links to a few python projects you are maintaining.
I will select two individuals and promote them to admin level.
I'd appreciate your consideration.
Val
I see these warnings each time I run:
...python3.6/site-packages/slugify/slugify.py:25
...python3.6/site-packages/slugify/slugify.py:25: DeprecationWarning: invalid escape sequence \d
DECIMAL_PATTERN = re.compile('&#(\d+);')
...python3.6/site-packages/slugify/slugify.py:26
...python3.6/site-packages/slugify/slugify.py:26: DeprecationWarning: invalid escape sequence \d
HEX_PATTERN = re.compile('&#x([\da-fA-F]+);')
...python3.6/site-packages/slugify/slugify.py:31
...python3.6/site-packages/slugify/slugify.py:31: DeprecationWarning: invalid escape sequence \d
NUMBERS_PATTERN = re.compile('(?<=\d),(?=\d)')
Perhaps this is the problem:
https://stackoverflow.com/questions/50504500/deprecationwarning-invalid-escape-sequence-what-to-use-instead-of-d
Hi guys,
While this library is MIT licensed, it uses unidcode, which is GPL licensed, practically making any SW that uses slugify to comply with GPL.
Was it an intentional decision to use GPL licensed library underneath?
Thank.
hi
please add support utf-8
Unicode, for example, Persian language
I get something like this
slugify.slugify('Hola això és - * - = +', replacements=[['-','menys']])
'holamenysaixomenysesmenysmenysmenysmenys'
While I expect something like this:
hola-aixo-es-menys-menys
because I want to replace '-' by 'menys' before replacing ' ' by '-'
I'm not sure if it would fit the definition of a "slug", but an option to preserve case would be nice. In my current context, it is mandatory, so it's a showstopper unfortunately.
Hi,
Unfortunately the check for text-unidecode (#63) does not work with pip. Pip executes installations in an isolated environment and does not support setup_requires
, hence it cannot detect if text-unidecode is installed when text-unidecode was used in install_requires and not installed beforehand.
Honestly it seems that this is just very hard or impossible to do in Python land. So, what we probably will do is to put slugify in a vendor location and make it dependent on text-unidecode.
Just opening this to see if you would have other suggestions or ideas.
Cheers
>>> s
'=--comfy-children-s-adult-diaper-skirt-shorts-2-in-1'
>>> slugify(s)
'comfy-children-s-adult-diaper-skirt-shorts-2-in-1'
>>> slugify(s, regex_pattern = r'[^-=a-z0-9_]+')
'=-comfy-children-s-adult-diaper-skirt-shorts-2-in-1'
Some of the content is already slugified, I wanna keep it untouched.
Getting below error on Ubuntu.
The same code works on Windows machine.
Ubuntu Version is 14.04
Python version is 2.7
File "/usr/local/lib/python2.7/dist-packages/py/_builtin.py", line 221, in exec_
exec2(obj, globals, locals)
File "<string>", line 7, in exec2
File "/home/sba001/cnssauto/pytest_suites/conftest.py", line 106, in <module>
os.makedirs(slugify(SUITE_RESULT_LOG_DIR))
File "/usr/local/lib/python2.7/dist-packages/slugify.py", line 26, in slugify
unicodedata.normalize('NFKD', string)
TypeError: must be unicode, not str
And this break some build systems like buildout.
Hi @un33k ,
Thanks for this library! 👍
I would like to request an option for users to install python-slugify
with their preferred decoders.
When using requirements.txt
, everyone is forced to used Unidecode
which is GPL-licensed.
Using the "Extras" feature of setuptools would be a great help!
Example:
pip install python-slugify[unidecode]
pip install python-slugify[text-unidecode]
As a reference, this has been used by popular libraries like Django:
pip install django[bcrypt]
pip install django[argon2]
from slugify import slugify
txt='hello你好'
slugify(txt)
Out: 'helloni-hao'
i hope the out: 'hello-ni-hao'
how to fix it ?
thank you very much
Hi,
I have reached out before to discuss the dependency on unidecode
which for some is an issue due to unidecode
being GPL. It was argued by you as authors of python-slugify
and the author of unidecode
that this is not an issue. While I personally agree, I have a hard time convincing others (https://issues.apache.org/jira/browse/LEGAL-362).
This means as a project (Apache Airflow) we are caught between a rock and hard place. The dependency is buried deep down for us and if we are really forced to remove it from our dependency tree we would need to replace some core items (ie. forking python-nvd3 and python-slugify most likely). This is obviously not what we want: we are very happy with both. So this is a call for help.
In the exchanges I had with you and the author of unidecode
it was argued that the usage of unidecode
by python-slugify
is equal to the usage of an API (i.e. the same as glibc/linux kernel headers). This would mean that one should be able to replace unidecode
by an equivalent that exposes the same API. Fortunately, there is one text-unidecode
.
However, the way python works makes this a bit tough. A pip install python-slugify
(or a pip install apache-airflow
) will always bring in unidecode
although text-unidecode
might be present on the system. This also makes the argument that unidecode
is just an API weaker.
What I would like to suggest is to have a conditional dependency which would default to unidecode
. If an environment variable called WITH_TEXTUNIDECODE
is defined (inspired by FreeBSD's make.conf https://www.freebsd.org/cgi/man.cgi?make.conf(5)) text_unidecode
would be used instead when installing. An alternative approach could be to make use of setup.cfg, although that seems less flexible. Both are PEP508 compatible (https://hynek.me/articles/conditional-python-dependencies/).
I volunteer to create a PR for this and to maintain it for at least a year. It would really help us getting past the hurdle that we see in https://issues.apache.org/jira/browse/LEGAL-362 .
Thanks a lot for your consideration.
When working on the following code:
from slugify import slugify
fname = slugify("cc / loc") + ".png"
My IDE (PyCharm 2018.2.5) will suggest to automatically download a package, but the wrong one. And this results in an error: NameError: name 'unicode' is not defined
The namespace of this package should be changed, or the half implemented package should be removed from PIP.
A tool like this should work out of the box.
I just noticed, that Unidecode is licensed under the GPL, while python-slugify uses the MIT license.
The way I understand things, this is not possible since any code using the API of a GPL licensed piece of software must also be releases under the terms of the GPL.
Because PyPI not support Markdown and not hightlight code blocks.
In [2]: slugify("aaa bbb-ccc")
Out[2]: 'aaa-bbb-ccc'
In [3]: slugify("aaa bbb-ccc", separator='.')
Out[3]: 'aaa.bbb.ccc'
I was expecting to get 'aaa.bbb-ccc'.
It would be great if slugify support German umlaut like
slugify_de('ÜBER Über slugify') # UEBER-Ueber-slugify
awesome-slugify does a great job but the development hass been stoped.
Hi,
I can call slugify from the command line after installing your package. Would you be okay moving the main function into the module slugify.cli ?
Thanks!
normalize() argument 2 must be unicode, not str
Traceback (most recent call last):
File "./gnib_par_pool.py", line 383, in screenshot
screenshot(self.driver, str(ids)+str(self.sess))
File "./gnib_par_pool.py", line 86, in screenshot
driver.save_screenshot(slugify('%s-screenie-%s' % (datetime.datetime.now().isoformat(), str(sid),))+".png")
File "/usr/local/lib/python2.7/dist-packages/slugify.py", line 26, in slugify
unicodedata.normalize('NFKD', string)
TypeError: normalize() argument 2 must be unicode, not str
saw this already at #35
happy to debug
the code works in pipenv but does not in ubuntu 16.04
there is something to do with ubuntu I guess
While python-slugify
itself is BSD licensed its dependency Unidecode is a pure GPL library. It's technically not a problem for python-slugify
because the licenses are compatible, but it should probably be mentioned somewhere because this makes python-slugify
unfit for most commercial deployments.
I don't know the definition of slug, so I'd like to ask: is there some kind of guarantee (I know that the license says no guarantees and stuff, but some guarantee for normal human/developer) that the slug will be url-safe? Also this might be mentioned in the "docs" (readme)...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.