nltk
/
setup.py
125 строк · 3.7 Кб
1#!/usr/bin/env python
2#
3# Setup script for the Natural Language Toolkit
4#
5# Copyright (C) 2001-2023 NLTK Project
6# Author: NLTK Team <nltk.team@gmail.com>
7# URL: <https://www.nltk.org/>
8# For license information, see LICENSE.TXT
9
10# Work around mbcs bug in distutils.
11# https://bugs.python.org/issue10945
12import codecs13
14try:15codecs.lookup("mbcs")16except LookupError:17ascii = codecs.lookup("ascii")18func = lambda name, enc=ascii: {True: enc}.get(name == "mbcs")19codecs.register(func)20
21import os22
23# Use the VERSION file to get NLTK version
24version_file = os.path.join(os.path.dirname(__file__), "nltk", "VERSION")25with open(version_file) as fh:26nltk_version = fh.read().strip()27
28# setuptools
29from setuptools import find_packages, setup30
31# Specify groups of optional dependencies
32extras_require = {33"machine_learning": [34"numpy",35"python-crfsuite",36"scikit-learn",37"scipy",38],39"plot": ["matplotlib"],40"tgrep": ["pyparsing"],41"twitter": ["twython"],42"corenlp": ["requests"],43}
44
45# Add a group made up of all optional dependencies
46extras_require["all"] = {47package for group in extras_require.values() for package in group48}
49
50# Adds CLI commands
51console_scripts = """52[console_scripts]
53nltk=nltk.cli:cli
54"""
55
56_project_homepage = "https://www.nltk.org/"57
58setup(59name="nltk",60description="Natural Language Toolkit",61version=nltk_version,62url=_project_homepage,63project_urls={64"Documentation": _project_homepage,65"Source Code": "https://github.com/nltk/nltk",66"Issue Tracker": "https://github.com/nltk/nltk/issues",67},68long_description="""\69The Natural Language Toolkit (NLTK) is a Python package for
70natural language processing. NLTK requires Python 3.8, 3.9, 3.10, 3.11 or 3.12.""",71license="Apache License, Version 2.0",72keywords=[73"NLP",74"CL",75"natural language processing",76"computational linguistics",77"parsing",78"tagging",79"tokenizing",80"syntax",81"linguistics",82"language",83"natural language",84"text analytics",85],86maintainer="NLTK Team",87maintainer_email="nltk.team@gmail.com",88author="NLTK Team",89author_email="nltk.team@gmail.com",90classifiers=[91"Development Status :: 5 - Production/Stable",92"Intended Audience :: Developers",93"Intended Audience :: Education",94"Intended Audience :: Information Technology",95"Intended Audience :: Science/Research",96"License :: OSI Approved :: Apache Software License",97"Operating System :: OS Independent",98"Programming Language :: Python :: 3.8",99"Programming Language :: Python :: 3.9",100"Programming Language :: Python :: 3.10",101"Programming Language :: Python :: 3.11",102"Programming Language :: Python :: 3.12",103"Topic :: Scientific/Engineering",104"Topic :: Scientific/Engineering :: Artificial Intelligence",105"Topic :: Scientific/Engineering :: Human Machine Interfaces",106"Topic :: Scientific/Engineering :: Information Analysis",107"Topic :: Text Processing",108"Topic :: Text Processing :: Filters",109"Topic :: Text Processing :: General",110"Topic :: Text Processing :: Indexing",111"Topic :: Text Processing :: Linguistic",112],113package_data={"nltk": ["test/*.doctest", "VERSION"]},114python_requires=">=3.8",115install_requires=[116"click",117"joblib",118"regex>=2021.8.3",119"tqdm",120],121extras_require=extras_require,122packages=find_packages(),123zip_safe=False, # since normal files will be present too?124entry_points=console_scripts,125)
126