{ "info": { "author": "SomsriCat", "author_email": "s.wuttiprasit@gmail.com", "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 grandmasomsri should look like this:\n```\n somsri/\n setup.py\n REAME.md\n MANIFEST.in\n bin/\n grandpaprayud-status\n grandmasomsri-status\n graph-power\n src/\n grandmasomsri/\n __init__.py\n grandmaSomsri.py\n grandpaPrayud.py\n graph/\n power.py\n```\nThe subdirectory grandmasomsri 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='grandmasomsri',\n version='0.3',\n description='Grandma Somsri and Grandpa Prayud',\n long_description=readme(),\n url='https://github.com/SOMSRICAT/grandmasomsri',\n author='SomsriCat',\n author_email='s.wuttiprasit@gmail.com',\n license='Somsri',\n install_requires=[\n 'matplotlib',\n 'numpy',\n ],\n scripts=['bin/grandmasomsri-status',\n 'bin/grandpaprayud-status',\n 'bin/graph-power'],\n keywords='grandmasomsri grandpaprayud somsri prayud',\n packages=['grandmasomsri'],\n package_dir={'grandmasomsri': 'src/grandmasomsri'},\n package_data={'grandmasomsri': ['graph/*.py']\n },\n)\n```\n\n* If your package required any package you needso 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 grandmasomsri, we will add a grandmasomsri-status, grandpaprayud-status, graph-power, command line tool by adding scripts keyword argument \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* 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\n\nsee more setup.py in the [PyPA sample project](https://github.com/pypa/sampleproject)\n\n# Package\ngrandmaSomsri.py contains:\n```Python\ndef somsri():\n print (\"---------------------------------------------\")\n print (\"| / |\")\n print (\"| ,.. / |\")\n print (\"| ,' '; |\")\n print (\"| ,,.__ _,' /'; . |\")\n print (\"| :',' ~~~~ '. '~ |\")\n print (\"| :' ( ) )::, |\")\n print (\"| '. '. .=----=..-~ .;' |\")\n print (\"| ' ;' :: ':. '' |\")\n print (\"| (: ': ;) |\")\n print (\"| \\\\\\ ' //' |\")\n print (\"| '' '' |\")\n print (\"---------------------------------------------\")\n print (\"| Name: Grandma Somsri(\u0e22\u0e32\u0e22\u0e2a\u0e21\u0e28\u0e23\u0e35) |\")\n print (\"| Ability: Very good eyesight (DEX +99) |\")\n print (\"| Weapon: Kar98k |\")\n print (\"| Hobby: Camping in the forest |\")\n print (\"---------------------------------------------\")\n```\ngrandpaPrayud.py contains:\n```Python\ndef prayud():\n print (\"---------------------------------------------\")\n print (\"| (( ####@@!!$$ )) |\")\n print (\"| `#####@@!$$` )) |\")\n print (\"| (( '####@!!$: |\")\n print (\"| (( ,####@!!$: )) |\")\n print (\"| .###@!!$: |\")\n print (\"| `##@@!$: |\")\n print (\"| `#@!!$ |\")\n print (\"| !@# `#@!$: @#$ |\")\n print (\"| #$ `#@!$: !@! |\")\n print (\"| '@!$: |\")\n print (\"| '`\\ !$: /`' |\")\n print (\"| '\\ '!: /' |\")\n print (\"| '\\ : /' |\")\n print (\"---------------------------------------------\")\n print (\"| Name: Grandpa Prayud(\u0e15\u0e32\u0e1b\u0e23\u0e30\u0e2b\u0e22\u0e31\u0e14) |\")\n print (\"| Ability: Can get angry anytime |\") \n print (\"| he want (str +99) |\")\n print (\"| Weapon: Table |\")\n print (\"| Hobby: Do an exercise |\")\n print (\"---------------------------------------------\")\n```\n```Python\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport random\n\ndef powerGraph():\n y = np.arange(0,100)\n prayud = []\n somsri = []\n for i in y:\n tmp = i * 0.8\n if tmp % 3 == 0:\n tmp *= 1.2\n if tmp % 4 == 0:\n tmp *= 2\n prayud.append(tmp)\n\n tmp = i * 0.6\n if tmp % 4 == 0:\n tmp *= 1.1\n if tmp % 7 == 0:\n tmp *= 0.5\n if tmp % 6 == 0:\n tmp *= 2.5\n somsri.append(tmp)\n\n\n plt.plot(y,somsri,'-', label='Grandma Somsri')\n plt.plot(y,prayud, '-', label='Grandpa Prayud')\n plt.title(\"Power Graph\")\n plt.xlabel('100 %')\n plt.ylabel('Power')\n\n plt.legend()\n\n plt.show()\n\npowerGraph()\n```\n# Script\nThe grandmasomsri-status script in bin looks like this:\n```Python\n#!/usr/bin/env python \n\nfrom grandmasomsri.grandmaSomsri import somsri \n\nprint (somsri())\n\n``` \nThe grandpaprayud-status script in bin looks like this:\n```Python\n#!/usr/bin/env python \n\nfrom grandmasomsri.grandpaPrayud import prayud \n\nprint (prayud())\n\n``` \nThe graph-power script in bin looks like this:\n```Python\n#!/usr/bin/env python \n\nfrom grandmasomsri.graph import power\n\nprint (powerGraph())\n``` \nMANIFEST.in contains:\n```\ninclude README.md\n```\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/grandmasomsri-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 grandmasomsri\n```\n\n\nIts will be automatically installed to your Python package folder\nand setuptools will copy the script to your PATH and make it available for general use\n\nYou can run package in command line by following this command:\n```\n$ grandmasomsri-status\n```\n```\n$ grandpaprayud-status\n```\n```\n$ graph-power\n```", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SOMSRICAT/grandmasomsri", "keywords": "grandmasomsri grandpaprayud somsri prayud", "license": "Somsri", "maintainer": "", "maintainer_email": "", "name": "grandmasomsri", "package_url": "https://pypi.org/project/grandmasomsri/", "platform": "", "project_url": "https://pypi.org/project/grandmasomsri/", "project_urls": { "Homepage": "https://github.com/SOMSRICAT/grandmasomsri" }, "release_url": "https://pypi.org/project/grandmasomsri/0.3/", "requires_dist": null, "requires_python": "", "summary": "Grandma Somsri and Grandpa Prayud", "version": "0.3" }, "last_serial": 4045787, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "7daa9fc4e7579eef911e6b2b7fa9a94d", "sha256": "632c338c0e216126ee6990fce2e5b68658f6184d9bbb4baeda4c86dc56cd3b54" }, "downloads": -1, "filename": "grandmasomsri-0.3.tar.gz", "has_sig": false, "md5_digest": "7daa9fc4e7579eef911e6b2b7fa9a94d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4649, "upload_time": "2018-07-10T02:49:51", "url": "https://files.pythonhosted.org/packages/a0/8b/1af0bed0659efc5bbdd5d39c3953b1161eda7f60270aa934cc93eaef4762/grandmasomsri-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7daa9fc4e7579eef911e6b2b7fa9a94d", "sha256": "632c338c0e216126ee6990fce2e5b68658f6184d9bbb4baeda4c86dc56cd3b54" }, "downloads": -1, "filename": "grandmasomsri-0.3.tar.gz", "has_sig": false, "md5_digest": "7daa9fc4e7579eef911e6b2b7fa9a94d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4649, "upload_time": "2018-07-10T02:49:51", "url": "https://files.pythonhosted.org/packages/a0/8b/1af0bed0659efc5bbdd5d39c3953b1161eda7f60270aa934cc93eaef4762/grandmasomsri-0.3.tar.gz" } ] }