pyproject-starter


Namepyproject-starter JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryPython Package Cookiecutter Code
upload_time2025-07-12 21:10:27
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2022 Vamsee Achanta Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords cookiecutter library module package template
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Introduction

Python Package Cookiecutter Code to help make faster libraries. The objective of this repo is to concentrate on developing source code by standardizing the ecosystem of tools for development

## Summary

Writing code helps us solve a business problem. However writing good code will make it reusable. Writing good code with tests around it will help convert the code into a python library (or module or package) usable by fellow team members or to the open source community.

A developer will want to go through this process in a seamless manner. This article and repo will define a proven process and provide guidelines to write a python library.

 #TODO 
- Convert library to a cookiecutter template. Helps parametrize the library name.
- Use GitHub actions to include testing, test coverage etc.

For library guidance on a typical data science, see see [for data science projects](docs\data_science_guidance.md)

## Usage

The recommended practices for developing python libraries are given below:

<img src="docs/package_development.svg" width=auto, height=auto/>

[https://realpython.com/pypi-publish-python-package/](https://realpython.com/pypi-publish-python-package/)

**Using toml file, bumpver and twine**

| Step |  Description | Commands/Detailed Description | Reference |
|---|---|---|---|
| 1 | Create python project with directory structure | Follow pep8 guidelines | [https://www.freecodecamp.org/news/build-your-first-python-package/](https://www.freecodecamp.org/news/build-your-first-python-package/) |
| 2 | Package compliance | Ensure all directories are package modules using __init__.py  | [https://www.freecodecamp.org/news/build-your-first-python-package/](https://www.freecodecamp.org/news/build-your-first-python-package/) |
| 3 | Add .toml file and setup.py to build wheels | pip install bumpver <br> bumpver update --patch  <br> pip install build <br> python -m build | https://realpython.com/pypi-publish-python-package/ |
| 4 | Create account on pypi and upload using twine package | These commands will push the .whl and .tar.gz file into the pypi repository <br> conda install twine <br> twine upload dist/*  | https://realpython.com/pypi-publish-python-package/ |

To see instructions using setup.py & twine, without Version Bump, see [using setup.py](docs\using_setuppy.md)

## CI

More CI/CD streamlining for python packages:
- use cookiecutter to generate a package template
- set up travis CI for auto deployment of package to pypi

 #TODO 
- Convert library to a cookiecutter template. Helps parametrize the library name.

https://github.com/audreyfeldroy/cookiecutter-pypackage
https://cookiecutter-pypackage.readthedocs.io/en/latest/tutorial.html
https://pypi.org/project/cookiecutter/

https://github.com/boromir674/cookiecutter-python-package
https://github.com/boromir674/cookiecutter-python-package/tox.ini

https://youtu.be/ugGu8fHWFog (A data science project example folder)

### Github

Helps cover testing, test coverage, etc.
https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
https://hynek.me/articles/python-github-actions/

### Travis CI, No Free Support?

https://jacobtomlinson.dev/posts/2021/testing-and-continuous-integration-for-python-packages-with-github-actions/

https://github.com/ksator/continuous-integration-with-python

https://medium.com/swlh/automate-python-testing-with-github-actions-7926b5d8a865


## Testing a Package Locally 

**Using .toml file (Working)**

A package can be imported locally from another code and thoroughly tested as well if required. Editable install is the best way to achieve this.
The steps to do so are:
- Change to the current working directory where the pyproject.toml file is located
- Execute the following command to install the package locally
	- python -m pip install -e .
- This installation uses the files in the current working directory

**Using conda-build (Did not work)**

Building A Package Locally
- Add following package to the base environment
    -Install conda-buiild
    -Conda install conda-build
- Utilize the below to build the package in current path. A specific path can also be specified.
    - Conda develop . 
    - https://docs.conda.io/projects/conda-build/en/latest/user-guide/tutorials/build-pkgs.html


## Writing Tests
- Write tests. Preferably utilize pytest. 
- Example test and file structure
	- https://github.com/jumptrading/luddite
	- Utilized test_package.py for all tests 
	- pytest.ini file for pytest configurations
	- Utilize github test workflows
	- https://github.com/jumptrading/luddite/blob/master/.github/workflows/tests.yml
- https://tox.wiki/en/latest/

### References

[https://www.freecodecamp.org/news/build-your-first-python-package/](https://www.freecodecamp.org/news/build-your-first-python-package/)

[https://python-packaging-tutorial.readthedocs.io/en/latest/setup_py.html](https://python-packaging-tutorial.readthedocs.io/en/latest/setup_py.html)

[https://packaging.python.org/](https://packaging.python.org/)

Guidelines to contribute to libraries:
[https://pandas.pydata.org/docs/development/contributing.html#contributing](https://pandas.pydata.org/docs/development/contributing.html#contributing)

https://realpython.com/pypi-publish-python-package/

https://github.com/johnthagen/python-blueprint

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyproject-starter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "cookiecutter, library, module, package, template",
    "author": null,
    "author_email": "Vamsee Achanta <vamsee.achanta@aceengineer.com>",
    "download_url": "https://files.pythonhosted.org/packages/b8/2d/2b682da1f9c6e86fecaed1eb14af858c8eb90d81217469f7a295bcb6ea94/pyproject_starter-0.0.2.tar.gz",
    "platform": null,
    "description": "# Introduction\n\nPython Package Cookiecutter Code to help make faster libraries. The objective of this repo is to concentrate on developing source code by standardizing the ecosystem of tools for development\n\n## Summary\n\nWriting code helps us solve a business problem. However writing good code will make it reusable. Writing good code with tests around it will help convert the code into a python library (or module or package) usable by fellow team members or to the open source community.\n\nA developer will want to go through this process in a seamless manner. This article and repo will define a proven process and provide guidelines to write a python library.\n\n #TODO \n- Convert library to a cookiecutter template. Helps parametrize the library name.\n- Use GitHub actions to include testing, test coverage etc.\n\nFor library guidance on a typical data science, see see [for data science projects](docs\\data_science_guidance.md)\n\n## Usage\n\nThe recommended practices for developing python libraries are given below:\n\n<img src=\"docs/package_development.svg\" width=auto, height=auto/>\n\n[https://realpython.com/pypi-publish-python-package/](https://realpython.com/pypi-publish-python-package/)\n\n**Using toml file, bumpver and twine**\n\n| Step |  Description | Commands/Detailed Description | Reference |\n|---|---|---|---|\n| 1 | Create python project with directory structure | Follow pep8 guidelines | [https://www.freecodecamp.org/news/build-your-first-python-package/](https://www.freecodecamp.org/news/build-your-first-python-package/) |\n| 2 | Package compliance | Ensure all directories are package modules using __init__.py  | [https://www.freecodecamp.org/news/build-your-first-python-package/](https://www.freecodecamp.org/news/build-your-first-python-package/) |\n| 3 | Add .toml file and setup.py to build wheels | pip install bumpver <br> bumpver update --patch  <br> pip install build <br> python -m build | https://realpython.com/pypi-publish-python-package/ |\n| 4 | Create account on pypi and upload using twine package | These commands will push the .whl and .tar.gz file into the pypi repository <br> conda install twine <br> twine upload dist/*  | https://realpython.com/pypi-publish-python-package/ |\n\nTo see instructions using setup.py & twine, without Version Bump, see [using setup.py](docs\\using_setuppy.md)\n\n## CI\n\nMore CI/CD streamlining for python packages:\n- use cookiecutter to generate a package template\n- set up travis CI for auto deployment of package to pypi\n\n #TODO \n- Convert library to a cookiecutter template. Helps parametrize the library name.\n\nhttps://github.com/audreyfeldroy/cookiecutter-pypackage\nhttps://cookiecutter-pypackage.readthedocs.io/en/latest/tutorial.html\nhttps://pypi.org/project/cookiecutter/\n\nhttps://github.com/boromir674/cookiecutter-python-package\nhttps://github.com/boromir674/cookiecutter-python-package/tox.ini\n\nhttps://youtu.be/ugGu8fHWFog (A data science project example folder)\n\n### Github\n\nHelps cover testing, test coverage, etc.\nhttps://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python\nhttps://hynek.me/articles/python-github-actions/\n\n### Travis CI, No Free Support?\n\nhttps://jacobtomlinson.dev/posts/2021/testing-and-continuous-integration-for-python-packages-with-github-actions/\n\nhttps://github.com/ksator/continuous-integration-with-python\n\nhttps://medium.com/swlh/automate-python-testing-with-github-actions-7926b5d8a865\n\n\n## Testing a Package Locally \n\n**Using .toml file (Working)**\n\nA package can be imported locally from another code and thoroughly tested as well if required. Editable install is the best way to achieve this.\nThe steps to do so are:\n- Change to the current working directory where the pyproject.toml file is located\n- Execute the following command to install the package locally\n\t- python -m pip install -e .\n- This installation uses the files in the current working directory\n\n**Using conda-build (Did not work)**\n\nBuilding A Package Locally\n- Add following package to the base environment\n    -Install conda-buiild\n    -Conda install conda-build\n- Utilize the below to build the package in current path. A specific path can also be specified.\n    - Conda develop . \n    - https://docs.conda.io/projects/conda-build/en/latest/user-guide/tutorials/build-pkgs.html\n\n\n## Writing Tests\n- Write tests. Preferably utilize pytest. \n- Example test and file structure\n\t- https://github.com/jumptrading/luddite\n\t- Utilized test_package.py for all tests \n\t- pytest.ini file for pytest configurations\n\t- Utilize github test workflows\n\t- https://github.com/jumptrading/luddite/blob/master/.github/workflows/tests.yml\n- https://tox.wiki/en/latest/\n\n### References\n\n[https://www.freecodecamp.org/news/build-your-first-python-package/](https://www.freecodecamp.org/news/build-your-first-python-package/)\n\n[https://python-packaging-tutorial.readthedocs.io/en/latest/setup_py.html](https://python-packaging-tutorial.readthedocs.io/en/latest/setup_py.html)\n\n[https://packaging.python.org/](https://packaging.python.org/)\n\nGuidelines to contribute to libraries:\n[https://pandas.pydata.org/docs/development/contributing.html#contributing](https://pandas.pydata.org/docs/development/contributing.html#contributing)\n\nhttps://realpython.com/pypi-publish-python-package/\n\nhttps://github.com/johnthagen/python-blueprint\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2022 Vamsee Achanta\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "Python Package Cookiecutter Code",
    "version": "0.0.2",
    "project_urls": {
        "changelog": "https://github.com/vamseeachanta/pyproject_starter/blob/main/CHANGELOG.md",
        "documentation": "https://github.com/vamseeachanta/pyproject_starter/blob/main/README.md",
        "issues": "https://github.com/vamseeachanta/pyproject_starter/issues",
        "repository": "https://github.com/vamseeachanta/pyproject_starter"
    },
    "split_keywords": [
        "cookiecutter",
        " library",
        " module",
        " package",
        " template"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "676ddfa46293e1b73d597ac23167fb86c03451c153f476a762dcc3ba07f73725",
                "md5": "2731e392b9485bb1c8f3992b3689e346",
                "sha256": "3a445bb5583c623cf260346c4960c20dacf7ea35e2ae26dbae454ac1152900fe"
            },
            "downloads": -1,
            "filename": "pyproject_starter-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2731e392b9485bb1c8f3992b3689e346",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6284,
            "upload_time": "2025-07-12T21:10:25",
            "upload_time_iso_8601": "2025-07-12T21:10:25.588744Z",
            "url": "https://files.pythonhosted.org/packages/67/6d/dfa46293e1b73d597ac23167fb86c03451c153f476a762dcc3ba07f73725/pyproject_starter-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b82d2b682da1f9c6e86fecaed1eb14af858c8eb90d81217469f7a295bcb6ea94",
                "md5": "6f9df51cce6cccbf28af6144d24b5a5d",
                "sha256": "2f234972e53394291c8d8aebce24eb5b0a3d93bd0a1e0f1d83ce8ce439978e5e"
            },
            "downloads": -1,
            "filename": "pyproject_starter-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6f9df51cce6cccbf28af6144d24b5a5d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 321099,
            "upload_time": "2025-07-12T21:10:27",
            "upload_time_iso_8601": "2025-07-12T21:10:27.015851Z",
            "url": "https://files.pythonhosted.org/packages/b8/2d/2b682da1f9c6e86fecaed1eb14af858c8eb90d81217469f7a295bcb6ea94/pyproject_starter-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-12 21:10:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vamseeachanta",
    "github_project": "pyproject_starter",
    "github_not_found": true,
    "lcname": "pyproject-starter"
}
        
Elapsed time: 0.53152s