vamseeachanta / energydata

MIT License
0 stars 0 forks source link

Introduction

Energy Data Library to get data from public sources. The energy includes the following:

Summary

Usage

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/
2 Package compliance Ensure all directories are package modules using init.py https://www.freecodecamp.org/news/build-your-first-python-package/
3 Add .toml file and setup.py to build wheels pip install bumpver
bumpver update --patch
pip install build
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
conda install twine
twine upload dist/*
https://realpython.com/pypi-publish-python-package/

To see instructions using setup.py & twine, without Version Bump, see using setup.py

CI

More CI/CD streamlining for python packages:

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:

Using conda-build (Did not work)

Building A Package Locally

Writing Tests

References

https://www.freecodecamp.org/news/build-your-first-python-package/

https://python-packaging-tutorial.readthedocs.io/en/latest/setup_py.html

https://packaging.python.org/

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

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