World Energy Data from Public Sources
Project description
Introduction
World Energy Data Library to get data from public sources. The energy includes the following:
- Oil and Gas facilities
- Wind
- Other Source (TBA)
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:
- 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://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.
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://python-packaging-tutorial.readthedocs.io/en/latest/setup_py.html
Guidelines to contribute to libraries: https://pandas.pydata.org/docs/development/contributing.html#contributing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file worldenergydata-0.0.1.tar.gz.
File metadata
- Download URL: worldenergydata-0.0.1.tar.gz
- Upload date:
- Size: 72.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee38913e050bd685c3d70150ce9ebf3ab739465d901c03f938d5ddcfc2357d0f
|
|
| MD5 |
cba709e17062d3b407770af67d5918df
|
|
| BLAKE2b-256 |
940d5bfdfd7ddfb377db7b204a407e6e2301c7b75eb3dbee8e341992874d8667
|
File details
Details for the file worldenergydata-0.0.1-py3-none-any.whl.
File metadata
- Download URL: worldenergydata-0.0.1-py3-none-any.whl
- Upload date:
- Size: 94.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de6f3ae86b0d9d161c233120faf9ceb176550cf85438c7eaa60b11a42449f861
|
|
| MD5 |
a44c3b05fbfde994c05ff3a4cd0bdd71
|
|
| BLAKE2b-256 |
97f53d75cd58aeb2840465c62922e6a44f27de1d5b067e33bcbb45ec1c8cafb7
|