testformyclasspks1


Nametestformyclasspks1 JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/myNKUST/testformyclass.git
SummaryAn NLP python package for computing Boilerplate score and many other text features.
upload_time2023-04-07 12:01:42
maintainer
docs_urlNone
authortimenet2300
requires_python
license
keywords text mining data science
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Your First Python Package on PyPI

Reference Blog: https://towardsdatascience.com/an-end-to-end-guide-to-publish-your-python-package-bdb56639662c

## [![Typing SVG](https://readme-typing-svg.herokuapp.com?multiline=true&width=1200&lines=An+end+to+end+project+helps+you+publish+your+first+python+package+in+a+simple+way.++++++++++)](https://git.io/typing-svg)

## Step 1

Go to the following two websites to register your own account, respectively.
- PyPI test: https://test.pypi.org/
- PyPI: https://pypi.org/

Note: I highly recommend trying your package on the test site first to avoid mistakes in the uploading process. Since any change, you make to your package on PyPI is not revertable, uploading errors may lead to a malfunctioning patch for your package. You want to avoid that!!


## Step 2

Fork this repository to your own GitHub account and make it available in your local. You can make the most changes on GitHub, but you will need to publish your package via cmd with those files available in local.

And here is the list of the core files you will need:

* src
  * \_\_init\_\_.py
  * your_main_code.py  (This is only one module, if you have multi-modules included in this package, you probably want to create subfolders for them. For details, check the OPTIONAL part following this section.)
* setup.py
* README.md
* MANIFEST.in
* LICENSE
* pyproject.toml
* CHANGELOG.md

I know that's a lot. But bear with me. You only need to make necessary changes to some of them, and the rest will stay as default.

## OPTIONAL - Multiple Modules
Suppose you have multiple classes with functions created in separate files. You want to make the folders (or subfolders) following this convention:

* Lib1
  * \_\_init\_\_.py
  * \_Class1.py
  * \_Class2.py

* Lib2
  * ...
  * ...

Inside each folder, update the "\_\_init\_\_.py" by doing this:

    from ._Class1 import Function1
    from ._Class1 import Function2
    from ._Class2 import Function1
    ... 

In the main folder, update the "\_\_init\_\_.py" by doing this:

    from Lib1._Class1 import Function1
    from Lib1._Class1 import Function2
    from Lib1._Class2 import Function1
    ... 

Then the users will be able to import your library properly like this:

    from YourPackage.Class1 import Function1
    
If You want to import something from the main (previous) folder, here is what you should do:

    from .._ClassFromThePreviousFolder import Function1
    
Consider adding a list in your "\_\_init\_\_.py", so that the users can check what functions are available:

    __all__ = [ 'Function1',
                'Function2',
                ...,
                'FunctionN'
    ]
    

## Step 3

Install the following python package in your cmd:

```css
pip install setuptools
pip install twine
pip install wheel
pip install pytest # optional
```

You will need them later.

## Step 4

Do the following changes in ANY order you want:

1. Replace your_main_code.py in src folder with your own python package and leave "\_\_init\_\_.py" as it is.
2. Make changes to setup.py, and instructions included in that file.
3. Pick your own license. 
  * Open the LICENSE file, click on Edit, click "Choose a license template", and select the license fullfills your needs.
  * If you have no idea which license works for you, you can use the MIT license, which is one of the most common choices.
  * Or, you can use this link to pick one: https://choosealicense.com/
4. Update CHANGELOG.md to reflect version information
5. Optional: create a "test.py" and put the file in the tests folder. Or you can remove the whole folder if you are confident that everything works great in your module.
6. Delete everything in this "README.md" file, and update the file with the long decription of your package.

## Step 5

You have multiple choices for step 5 to perform the rest of the steps. Here are two examples:

1. Do it in cmd - Command Prompt
- In your local, open the cmd, navigate to the directory where your package is and type the following:
```css
# First, change root disk
C:\User\Yourname> d:

# Second, navigate to the folder
D:\> cd D:\my_works\Your-First-Python-Package-on-PyPI
```

2. Do it in the Jupyter Notebook terminal:
```css
C:\User\Yourname> jupyter notebook --notebook-dir D:/my_works/Your-First-Python-Package-on-PyPI
```

## Step 6

In this step, we will use the following code in cmd/terminal to build your package:
```css
python setup.py sdist bdist_wheel
```

Once you run the code, you will see the following two folders in the current directory:
- build
- dist

Under the dist folder, you will see a 'tar' file called "TheNameofYourPackage-TheVersionofYourPackage.tar.gz". At this point of time, if you do not need to publish your code in public; instead, if you just want to share your code with your friends or colleagues, you may just share this file with them. All they need to do is to do "pip install" to use your code:
```css
pip install relative_path_to_yourpackage.tar.gz  
```

## OPTIONAL - Test Your Package on PyPI

Now, you are about to publish your package to PyPI. Before you make it public, one more thing you may want to do is to test if your package will work as expected once people download them. What you can do is to create a folder called "test", and create a test.py, which includes some sample implementations of your package. Then, type "pytest" in your cmd/terminal. If everything works fine, it will run your test.py automatically and pass. Otherwise, it will raise errors and you should fix the bugs accordingly before moving to the next step.

And here is one more thing you might want to try to test if the architecture of your package is good to go. In the cmd/terminal, type the following code:
```css
twine check dist/*
```
You should see something like this:
```
Checking distribution dist/TheNameofYourPackage-TheVersionofYourPackage-1.0.0-py3-none-any.whl: Passed
Checking distribution dist/TheNameofYourPackage-TheVersionofYourPackage.tar.gz: Passed
```

## Step 7

Upload your package to TestPyPI:
```css
twine upload --repository-url https://test.pypi.org/legacy/ dist/* #pay attention there is an extra space before dist.
```
Then you will see a link leading to the testing version of your package on TestPyPI. Check it out! If there are any typos or incompatible bugs, fix them before uploading your package to the real PyPI.

And, now, it is the most exciting moment, upload your package to PyPI to help hundreds of thousands of people in our community:
```css
twine upload dist/*
```
By this point, your package should be officially online and can be "pip install" by anyone at any time from anywhere. Big moment! I still remember how I felt at the moment when I saw my first package is out there. I told myself, that's why I code! CONGRATULATIONS!!!  


## A few tips

- Whenever you want to update your package, you should remove the 'build' and 'dist' folders, make changes to your code, edit the "CHANGLOG.txt" file, and revise the version number in the "setup.py". And repeat steps 5–7.
- You may upgrade your package after the updates by doing this: ___pip install YOURPACKAGENAME --upgrade___
- You can always find your package on PyPi here: ___ht<span>tp://</span>pypi.org/project/YOURPACKAGENAME/___
- Do not publish packages arbitrarily. Even though there are no hard restrictions on what you can or cannot publish, make sure you are uploading something that is actually meaningful and someone will benefit from your work. 
# CHANGELOG

## Version 0.0.3 05/01/2023
1. Upaded ...
2. Fixed ...
3. ...



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/myNKUST/testformyclass.git",
    "name": "testformyclasspks1",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Text Mining,Data Science",
    "author": "timenet2300",
    "author_email": "timenet2300@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2b/ce/796f53752e8c94af69ca4ec29b09d16d119449af1b343ed6c9dc6ca6365e/testformyclasspks1-0.0.7.tar.gz",
    "platform": null,
    "description": "# Your First Python Package on PyPI\r\n\r\nReference Blog: https://towardsdatascience.com/an-end-to-end-guide-to-publish-your-python-package-bdb56639662c\r\n\r\n## [![Typing SVG](https://readme-typing-svg.herokuapp.com?multiline=true&width=1200&lines=An+end+to+end+project+helps+you+publish+your+first+python+package+in+a+simple+way.++++++++++)](https://git.io/typing-svg)\r\n\r\n## Step 1\r\n\r\nGo to the following two websites to register your own account, respectively.\r\n- PyPI test: https://test.pypi.org/\r\n- PyPI: https://pypi.org/\r\n\r\nNote: I highly recommend trying your package on the test site first to avoid mistakes in the uploading process. Since any change, you make to your package on PyPI is not revertable, uploading errors may lead to a malfunctioning patch for your package. You want to avoid that!!\r\n\r\n\r\n## Step 2\r\n\r\nFork this repository to your own GitHub account and make it available in your local. You can make the most changes on GitHub, but you will need to publish your package via cmd with those files available in local.\r\n\r\nAnd here is the list of the core files you will need:\r\n\r\n* src\r\n  * \\_\\_init\\_\\_.py\r\n  * your_main_code.py  (This is only one module, if you have multi-modules included in this package, you probably want to create subfolders for them. For details, check the OPTIONAL part following this section.)\r\n* setup.py\r\n* README.md\r\n* MANIFEST.in\r\n* LICENSE\r\n* pyproject.toml\r\n* CHANGELOG.md\r\n\r\nI know that's a lot. But bear with me. You only need to make necessary changes to some of them, and the rest will stay as default.\r\n\r\n## OPTIONAL - Multiple Modules\r\nSuppose you have multiple classes with functions created in separate files. You want to make the folders (or subfolders) following this convention:\r\n\r\n* Lib1\r\n  * \\_\\_init\\_\\_.py\r\n  * \\_Class1.py\r\n  * \\_Class2.py\r\n\r\n* Lib2\r\n  * ...\r\n  * ...\r\n\r\nInside each folder, update the \"\\_\\_init\\_\\_.py\" by doing this:\r\n\r\n    from ._Class1 import Function1\r\n    from ._Class1 import Function2\r\n    from ._Class2 import Function1\r\n    ... \r\n\r\nIn the main folder, update the \"\\_\\_init\\_\\_.py\" by doing this:\r\n\r\n    from Lib1._Class1 import Function1\r\n    from Lib1._Class1 import Function2\r\n    from Lib1._Class2 import Function1\r\n    ... \r\n\r\nThen the users will be able to import your library properly like this:\r\n\r\n    from YourPackage.Class1 import Function1\r\n    \r\nIf You want to import something from the main (previous) folder, here is what you should do:\r\n\r\n    from .._ClassFromThePreviousFolder import Function1\r\n    \r\nConsider adding a list in your \"\\_\\_init\\_\\_.py\", so that the users can check what functions are available:\r\n\r\n    __all__ = [ 'Function1',\r\n                'Function2',\r\n                ...,\r\n                'FunctionN'\r\n    ]\r\n    \r\n\r\n## Step 3\r\n\r\nInstall the following python package in your cmd:\r\n\r\n```css\r\npip install setuptools\r\npip install twine\r\npip install wheel\r\npip install pytest # optional\r\n```\r\n\r\nYou will need them later.\r\n\r\n## Step 4\r\n\r\nDo the following changes in ANY order you want:\r\n\r\n1. Replace your_main_code.py in src folder with your own python package and leave \"\\_\\_init\\_\\_.py\" as it is.\r\n2. Make changes to setup.py, and instructions included in that file.\r\n3. Pick your own license. \r\n  * Open the LICENSE file, click on Edit, click \"Choose a license template\", and select the license fullfills your needs.\r\n  * If you have no idea which license works for you, you can use the MIT license, which is one of the most common choices.\r\n  * Or, you can use this link to pick one: https://choosealicense.com/\r\n4. Update CHANGELOG.md to reflect version information\r\n5. Optional: create a \"test.py\" and put the file in the tests folder. Or you can remove the whole folder if you are confident that everything works great in your module.\r\n6. Delete everything in this \"README.md\" file, and update the file with the long decription of your package.\r\n\r\n## Step 5\r\n\r\nYou have multiple choices for step 5 to perform the rest of the steps. Here are two examples:\r\n\r\n1. Do it in cmd - Command Prompt\r\n- In your local, open the cmd, navigate to the directory where your package is and type the following:\r\n```css\r\n# First, change root disk\r\nC:\\User\\Yourname> d:\r\n\r\n# Second, navigate to the folder\r\nD:\\> cd D:\\my_works\\Your-First-Python-Package-on-PyPI\r\n```\r\n\r\n2. Do it in the Jupyter Notebook terminal:\r\n```css\r\nC:\\User\\Yourname> jupyter notebook --notebook-dir D:/my_works/Your-First-Python-Package-on-PyPI\r\n```\r\n\r\n## Step 6\r\n\r\nIn this step, we will use the following code in cmd/terminal to build your package:\r\n```css\r\npython setup.py sdist bdist_wheel\r\n```\r\n\r\nOnce you run the code, you will see the following two folders in the current directory:\r\n- build\r\n- dist\r\n\r\nUnder the dist folder, you will see a 'tar' file called \"TheNameofYourPackage-TheVersionofYourPackage.tar.gz\". At this point of time, if you do not need to publish your code in public; instead, if you just want to share your code with your friends or colleagues, you may just share this file with them. All they need to do is to do \"pip install\" to use your code:\r\n```css\r\npip install relative_path_to_yourpackage.tar.gz  \r\n```\r\n\r\n## OPTIONAL - Test Your Package on\u00a0PyPI\r\n\r\nNow, you are about to publish your package to PyPI. Before you make it public, one more thing you may want to do is to test if your package will work as expected once people download them. What you can do is to create a folder called \"test\", and create a test.py, which includes some sample implementations of your package. Then, type \"pytest\" in your cmd/terminal. If everything works fine, it will run your test.py automatically and pass. Otherwise, it will raise errors and you should fix the bugs accordingly before moving to the next step.\r\n\r\nAnd here is one more thing you might want to try to test if the architecture of your package is good to go. In the cmd/terminal, type the following code:\r\n```css\r\ntwine check dist/*\r\n```\r\nYou should see something like this:\r\n```\r\nChecking distribution dist/TheNameofYourPackage-TheVersionofYourPackage-1.0.0-py3-none-any.whl: Passed\r\nChecking distribution dist/TheNameofYourPackage-TheVersionofYourPackage.tar.gz: Passed\r\n```\r\n\r\n## Step 7\r\n\r\nUpload your package to TestPyPI:\r\n```css\r\ntwine upload --repository-url https://test.pypi.org/legacy/ dist/* #pay attention there is an extra space before dist.\r\n```\r\nThen you will see a link leading to the testing version of your package on TestPyPI. Check it out! If there are any typos or incompatible bugs, fix them before uploading your package to the real PyPI.\r\n\r\nAnd, now, it is the most exciting moment, upload your package to PyPI to help hundreds of thousands of people in our community:\r\n```css\r\ntwine upload dist/*\r\n```\r\nBy this point, your package should be officially online and can be \"pip install\" by anyone at any time from anywhere. Big moment! I still remember how I felt at the moment when I saw my first package is out there. I told myself, that's why I code! CONGRATULATIONS!!!  \r\n\r\n\r\n## A few tips\r\n\r\n- Whenever you want to update your package, you should remove the 'build' and 'dist' folders, make changes to your code, edit the \"CHANGLOG.txt\" file, and revise the version number in the \"setup.py\". And repeat steps 5\u20137.\r\n- You may upgrade your package after the updates by doing this: ___pip install YOURPACKAGENAME --upgrade___\r\n- You can always find your package on PyPi here: ___ht<span>tp://</span>pypi.org/project/YOURPACKAGENAME/___\r\n- Do not publish packages arbitrarily. Even though there are no hard restrictions on what you can or cannot publish, make sure you are uploading something that is actually meaningful and someone will benefit from your work. \r\n# CHANGELOG\r\n\r\n## Version 0.0.3 05/01/2023\r\n1. Upaded ...\r\n2. Fixed ...\r\n3. ...\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "An NLP python package for computing Boilerplate score and many other text features.",
    "version": "0.0.7",
    "split_keywords": [
        "text mining",
        "data science"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4fa0c4d1c2522696363cab26da648d8a8ed535e53db5a1d5d0f9fd81dc4c8136",
                "md5": "a33a0abe351b91718164ed62b4031fb3",
                "sha256": "c551eeea7bc2f1777958f59f92f70d9d87c36885eac585e428f087a2a55d46ea"
            },
            "downloads": -1,
            "filename": "testformyclasspks1-0.0.7-py3.9.egg",
            "has_sig": false,
            "md5_digest": "a33a0abe351b91718164ed62b4031fb3",
            "packagetype": "bdist_egg",
            "python_version": "0.0.7",
            "requires_python": null,
            "size": 7503,
            "upload_time": "2023-04-07T12:01:40",
            "upload_time_iso_8601": "2023-04-07T12:01:40.514161Z",
            "url": "https://files.pythonhosted.org/packages/4f/a0/c4d1c2522696363cab26da648d8a8ed535e53db5a1d5d0f9fd81dc4c8136/testformyclasspks1-0.0.7-py3.9.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e3c5329cb16686b9565eca782c47f9ccf046449a86a65a759410bfaff74f650d",
                "md5": "92569c2ba8e60cb4a4c2f80bee0b39a3",
                "sha256": "54de707718dd3ce4731a10ac3aeb62f7054f84255ba77b5079af3de71b5343d4"
            },
            "downloads": -1,
            "filename": "testformyclasspks1-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "92569c2ba8e60cb4a4c2f80bee0b39a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7233,
            "upload_time": "2023-04-07T12:01:38",
            "upload_time_iso_8601": "2023-04-07T12:01:38.344980Z",
            "url": "https://files.pythonhosted.org/packages/e3/c5/329cb16686b9565eca782c47f9ccf046449a86a65a759410bfaff74f650d/testformyclasspks1-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2bce796f53752e8c94af69ca4ec29b09d16d119449af1b343ed6c9dc6ca6365e",
                "md5": "2888d05c9feabc24e4a4caa694531d41",
                "sha256": "7c82483490ae8c97f7519b34a0c565b5a758475b50e26f4327fb1f0ea6e25f5d"
            },
            "downloads": -1,
            "filename": "testformyclasspks1-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "2888d05c9feabc24e4a4caa694531d41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11183,
            "upload_time": "2023-04-07T12:01:42",
            "upload_time_iso_8601": "2023-04-07T12:01:42.739985Z",
            "url": "https://files.pythonhosted.org/packages/2b/ce/796f53752e8c94af69ca4ec29b09d16d119449af1b343ed6c9dc6ca6365e/testformyclasspks1-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-07 12:01:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "myNKUST",
    "github_project": "testformyclass.git",
    "lcname": "testformyclasspks1"
}
        
Elapsed time: 0.08221s