{
"info": {
"author": "Supphawit,Sukit",
"author_email": "supphawit@thinknet.co.th",
"bugtrack_url": null,
"classifiers": [],
"description": "# How to upload your package to PyPI \n\nIf you haven\u2019t published things on PyPI before, you\u2019ll need to create an account at [PyPI](https://pypi.org/).\n\nWe need you to create an account at [TestPyPI](https://test.pypi.org/) to test before you publish your package to PyPI. (You should set username and passwords PyPI same as TestPyPI)\n\n# Picking A Name\nPython module/package names should generally follow the following constraints:\n\n* All lowercase\n* Unique on PyPI\n* Underscore-separated or no word separators at all \n\n# Creating The Scaffolding\n\nDirectory structure for tnthai should look like this:\n```\nTnThai/\n tnthai/\n setup.py\n REAME.md\n MANIFEST.in\n bin/\n tnthai-run\n tnthai-test\n src/\n tnthai/\n __init__.py\n AbstractWordSegment.py\n SC.py\n dict/\n my.trie\n tests/\n test_tnthai.py\n```\nThe subdirectory tnthai is actually our Python module\n\nsetup.py contains:\n```Python\nfrom setuptools import setup\n\ndef readme():\n with open('README.md') as f:\n return f.read()\n\nsetup(name='tnthai',\n version='0.1',\n description='tnthai for Python3',\n long_description=readme(),\n url='https://gitlab.thinknet.co.th/research/swathclone',\n author='Supphawit',\n author_email='supphawit@thinknet.co.th',\n license='Thinknet',\n python_requires='>=3',\n install_requires=[\n 'datrie',\n ],\n scripts=['bin/tnthai-run','bin/tnthai-test'],\n keywords='tnthai thinknet thai wordsegment',\n packages=['tnthai'],\n package_dir={'tnthai': 'src/tnthai'},\n package_data={\n 'tnthai': ['tests/*.py','dict/*.trie']\n },\n)\n```\n\n* If your package required any package you needs to add install_requires keyword argument to setup.py \n* Many Python packages include command line tools. This is useful for distributing support tools which are associated with a library \nfor tnthai, we will add a tnthai-run command line tool by adding scripts keyword argument \n* Package data can be added to packages using the package_data keyword argument to the setup() function\n* Use package_dir key argument to path your package location\n* Changed in version 3.1: All the files that match package_data will be added to the MANIFEST file if no template is provided. \n* You\u2019ll probably want a README file in your source distribution, and that file can serve double purpose as the long_description specified to PyPI. Further, if that file is written in reStructuredText, it can be formatted nicely\n\nsee more setup.py in the [PyPA sample project](https://github.com/pypa/sampleproject)\n\nThe tnthai-run script in bin/tnthai-run looks like this:\n```Python\n#!/usr/bin/env python \n\n * code *\n ...\n ...\n ...\n``` \nThe tnthai-test script in bin/tnthai-test use to run test for ```tnthai``` looks like this:\n```Python\n#!/usr/bin/env python \n\nimport os\nimport sys\n\nfor p in sys.path:\n if \"site-packages\" in p:\n path = p + \"/tnthai/tests/test_tnthai.py\"\nos.system(\"python3 \" + path)\n``` \n\nMANIFEST.in contains:\n```\ninclude README.md\n```\nIf you have other files that you want to include in your package just add include in MANIFEST.in it's meaning all files in the distribution root matching *.txt,and recursive-include meaning all files anywhere under the tnthai directory matching *.txt or *.py\n\nNow we can install the package locally (for use on our system or test before publish) with:\n```\n$ pip install .\n```\n\n# Publishing on TestPyPI and PyPI \n\nFirst create a source distribution with:\n```\n$ python setup.py sdist\n```\nor\n```\n$python3 setup.py sdist bdist_wheel\n```\nThis will create dist/tnthai-0.1.tar.gz inside our top-level directory. \n\nYou can use twine to upload the distribution packages. You\u2019ll need to install twine by this command:\n```\n$ pip install twine --upgrade\n```\nor \n```\n$ python3 -m pip install --user --upgrade twine\n```\n\n### TestPyPI\nYou should upload your package to TestPyPI before PyPI\n\nRun Twine to upload all of the archives under dist:\n```\n$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*\n```\nYou will be prompted for the username and password you registered with TestPyPI. \nAfter the command completes you can check your package at [TestPyPI](https://test.pypi.org/manage/projects/)\n\n### PyPI\nNow you ready to upload your package to PyPI\nby following this command:\n```\n$ twine upload --repository-url https://upload.pypi.org/legacy/ dist/*\n```\nYou will be prompted for the username and password you registered with PyPI. \nAfter the command completes you can check your package at [PyPI](https://pypi.org/manage/projects/)\n\n# Installing the Package\n\nAt this point, other consumers of this package can install the package with pip:\n```\n$ pip install tnthai\n```\nSometimes you update your package it will take about 5-10 minutes to update your package. \n\nyou can upgrade your package by following this command:\n```\n$ pip install tnthai --upgrade\n```\n\nIt will be automatically installed to your Python package folder\nand setuptools will copy the script to our PATH and make it available for general use\n\n# How to Use\nIn ```tnthai``` package have 3 features ```Safe Mode```, ```Unsafe Mode```, ```Smart Mode```\n\nYou can run package in command line by following this command:\n```\n$ tnthai-run \u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\n```\nIf you want to choose the features you can do by following this command:\n\n```\n$ tnthai-run \u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19 Safe\n```\n\n### Simple Demo\n\n\n```\nimport tnthai.segment as tn\n\n\nsafe = tn.SafeSegment(\"\u0e04\u0e19\u0e41\u0e01\u0e48\u0e02\u0e19\u0e02\u0e2d\u0e07\")\n\nunsafe = tn.UnsafeSegment(\"\u0e04\u0e19\u0e41\u0e01\u0e48\u0e02\u0e19\u0e02\u0e2d\u0e07\")\n\nsmart = tn.SmartSegment(\"\u0e04\u0e19\u0e41\u0e01\u0e48\u0e02\u0e19\u0e02\u0e2d\u0e07\")\n```\nBut if you use python2 you need to add ```# -*- coding: utf-8 -*-``` like this:\n```\n# -*- coding: utf-8 -*-\n\nimport tnthai.segment as tnthai\n\n * code *\n ...\n ...\n ...\n```\n\n\nResult of ```Safe Mode``` will be like this:\n```\n('Safe', [['\u0e04\u0e19\u0e41\u0e01\u0e48', '\u0e02\u0e19\u0e02\u0e2d\u0e07'], ['\u0e04\u0e19\u0e41\u0e01\u0e48', '\u0e02\u0e19', '\u0e02\u0e2d\u0e07'], ['\u0e04\u0e19', '\u0e41\u0e01\u0e48', '\u0e02\u0e19\u0e02\u0e2d\u0e07'], ['\u0e04\u0e19', '\u0e41\u0e01\u0e48', '\u0e02\u0e19', '\u0e02\u0e2d\u0e07']])\n```\nResult of ```Unsafe Mode``` will be like this:\n```\n('Unsafe', [['\u0e04\u0e19\u0e41\u0e01\u0e48', '\u0e02\u0e19\u0e02\u0e2d\u0e07']])\n```\nTo show you how its work we will show you an example:\n```\nimport tnthai.segment as tn\n\n\nmisspellings_safe = tn.SafeSegment(\"\u0e04\u0e19\u0e41\u0e01\u0e48\u0e2a\u0e02\u0e19\u0e02\u0e2d\u0e07\")\n\nspellings_smartmode = tn.SmartSegment(\"\u0e04\u0e19\u0e41\u0e01\u0e48\u0e02\u0e19\u0e02\u0e2d\u0e07\")\n\nmisspellings_smartmode = tn.SmartSegment(\"\u0e04\u0e19\u0e41\u0e01\u0e48\u0e2a\u0e02\u0e19\u0e02\u0e2d\u0e07\")\n```\n```Safe Mode``` doesn't work with misspellings text so the \nresult will be empty list ( ```Smart Mode``` can solve this problem )\n\nThe result of ```misspellings_safe``` is:\n```\n('Safe', [])\n```\n\n```Smart Mode``` will automatically use ```Safe Mode``` but if its doesn't work (which mean text have misspellings) its going to use ```Unsafe Mode``` instead\n\n\nThe result of ```spellings_smartmode``` is:\n```\n('Safe', [['\u0e04\u0e19\u0e41\u0e01\u0e48', '\u0e02\u0e19\u0e02\u0e2d\u0e07'], ['\u0e04\u0e19\u0e41\u0e01\u0e48', '\u0e02\u0e19', '\u0e02\u0e2d\u0e07'], ['\u0e04\u0e19', '\u0e41\u0e01\u0e48', '\u0e02\u0e19\u0e02\u0e2d\u0e07'], ['\u0e04\u0e19', '\u0e41\u0e01\u0e48', '\u0e02\u0e19', '\u0e02\u0e2d\u0e07']])\n```\nThe result of ```misspellings_smartmode``` is:\n```\n('Unsafe', [['\u0e04\u0e19\u0e41\u0e01\u0e48', '\u0e2a', '\u0e02\u0e19\u0e02\u0e2d\u0e07']])\n```\n\nIf you want to test package you can run ```tnthai-test``` by following this command:\n```\n$ tnthai-test\n```",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://gitlab.thinknet.co.th/research/swathclone",
"keywords": "tnthai thinknet thai wordsegment",
"license": "Thinknet",
"maintainer": "",
"maintainer_email": "",
"name": "tnthai",
"package_url": "https://pypi.org/project/tnthai/",
"platform": "",
"project_url": "https://pypi.org/project/tnthai/",
"project_urls": {
"Homepage": "https://gitlab.thinknet.co.th/research/swathclone"
},
"release_url": "https://pypi.org/project/tnthai/1.11/",
"requires_dist": null,
"requires_python": "",
"summary": "tnthai for Python",
"version": "1.11"
},
"last_serial": 4610766,
"releases": {
"1.10": [
{
"comment_text": "",
"digests": {
"md5": "86c03ad447bc22afe4d12243edd491fe",
"sha256": "e98be3510b0e8209502acd5b3d456ffa1fdbb45416effa83f7a2f98267060d01"
},
"downloads": -1,
"filename": "tnthai-1.10.tar.gz",
"has_sig": false,
"md5_digest": "86c03ad447bc22afe4d12243edd491fe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 680901,
"upload_time": "2018-09-04T06:47:34",
"url": "https://files.pythonhosted.org/packages/85/57/88e6276cd4d493d002c22bc17ac23807dc4a79e82c49fd913d8042c623c7/tnthai-1.10.tar.gz"
}
],
"1.11": [
{
"comment_text": "",
"digests": {
"md5": "8ba3e9e6c88624ef4913624410e56794",
"sha256": "aa08ec8291018f1335ab5c55ed812f87cc86678a33f3d1bf46189187ff9eca6f"
},
"downloads": -1,
"filename": "tnthai-1.11.tar.gz",
"has_sig": false,
"md5_digest": "8ba3e9e6c88624ef4913624410e56794",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 680925,
"upload_time": "2018-12-18T04:13:50",
"url": "https://files.pythonhosted.org/packages/3d/86/de20ef323dbaba3463aa5e1239f7e909597ee426704208e8883903e319eb/tnthai-1.11.tar.gz"
}
],
"1.6": [
{
"comment_text": "",
"digests": {
"md5": "da7a514205a4fac4647c2b0c6783c5cd",
"sha256": "97a307326b7b64c2e34b93be123c94295c6e9d71505dbdb20459a686079d3829"
},
"downloads": -1,
"filename": "tnthai-1.6.tar.gz",
"has_sig": false,
"md5_digest": "da7a514205a4fac4647c2b0c6783c5cd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 678819,
"upload_time": "2018-07-03T07:07:35",
"url": "https://files.pythonhosted.org/packages/99/11/e53972d20d3e789163f322fc2ddf3e332b8e9c82d9ebd32ebd7cc960312c/tnthai-1.6.tar.gz"
}
],
"1.7": [
{
"comment_text": "",
"digests": {
"md5": "a083e9e2b108c49e250a481601f79a22",
"sha256": "a6d3298ba1fc42b0ef805c8a5d31db288a897df820de71120881afef39c77f5f"
},
"downloads": -1,
"filename": "tnthai-1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a083e9e2b108c49e250a481601f79a22",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 687047,
"upload_time": "2018-07-05T06:52:46",
"url": "https://files.pythonhosted.org/packages/62/70/f1093039203c8fa11c84d552c87a754a8b6cb67304d57269229139dafb20/tnthai-1.7-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "23c74e4f053535cbab0ffb90e6c1cdec",
"sha256": "0040d5dbae2ec50ca45cecc8a5679ab07f8074a0ad42e05513ac7f9bb7685ec3"
},
"downloads": -1,
"filename": "tnthai-1.7.tar.gz",
"has_sig": false,
"md5_digest": "23c74e4f053535cbab0ffb90e6c1cdec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 680130,
"upload_time": "2018-07-05T06:52:48",
"url": "https://files.pythonhosted.org/packages/43/25/314e30656cdee36c0bf73f1ef1386079db84c1ee60e54d2e685e290a6267/tnthai-1.7.tar.gz"
}
],
"1.8": [
{
"comment_text": "",
"digests": {
"md5": "0d29e61dd2fb2426c9d991ec03e18369",
"sha256": "35eec988ac327008253c763f6f0ae22dc2d74e551484de83c4edec67c6e4e9ae"
},
"downloads": -1,
"filename": "tnthai-1.8.tar.gz",
"has_sig": false,
"md5_digest": "0d29e61dd2fb2426c9d991ec03e18369",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 680721,
"upload_time": "2018-07-05T07:09:07",
"url": "https://files.pythonhosted.org/packages/19/50/39932725c395c728c24481e179b1330002068da44c9239e538eab830f589/tnthai-1.8.tar.gz"
}
],
"1.9": [
{
"comment_text": "",
"digests": {
"md5": "9e9e428fd569b1c31992a0dd6754c396",
"sha256": "2b4db3e33bb4bd6c8c455d38b203a02fdd190c2d58b9bab587b698a119fd68e3"
},
"downloads": -1,
"filename": "tnthai-1.9.tar.gz",
"has_sig": false,
"md5_digest": "9e9e428fd569b1c31992a0dd6754c396",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 680718,
"upload_time": "2018-07-05T07:11:58",
"url": "https://files.pythonhosted.org/packages/44/d9/38757fd4ce65d9f68f7a8b675c44016921492c483b2a1001729806e424a4/tnthai-1.9.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "8ba3e9e6c88624ef4913624410e56794",
"sha256": "aa08ec8291018f1335ab5c55ed812f87cc86678a33f3d1bf46189187ff9eca6f"
},
"downloads": -1,
"filename": "tnthai-1.11.tar.gz",
"has_sig": false,
"md5_digest": "8ba3e9e6c88624ef4913624410e56794",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 680925,
"upload_time": "2018-12-18T04:13:50",
"url": "https://files.pythonhosted.org/packages/3d/86/de20ef323dbaba3463aa5e1239f7e909597ee426704208e8883903e319eb/tnthai-1.11.tar.gz"
}
]
}