diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-12 04:22:53 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-12 04:22:53 +0000 |
commit | 74222a7a649833d77d837241ec4947f76e58dbff (patch) | |
tree | 1d53662a975817143fe17f43f7bf26c03c0c4cc7 /python-opennem.spec | |
parent | dbc88dd11ea0dd32f0f4f60a9c668cafe343dfc2 (diff) |
automatic import of python-opennem
Diffstat (limited to 'python-opennem.spec')
-rw-r--r-- | python-opennem.spec | 476 |
1 files changed, 476 insertions, 0 deletions
diff --git a/python-opennem.spec b/python-opennem.spec new file mode 100644 index 0000000..8c3cd26 --- /dev/null +++ b/python-opennem.spec @@ -0,0 +1,476 @@ +%global _empty_manifest_terminate_build 0 +Name: python-opennem +Version: 3.8.0 +Release: 1 +Summary: OpenNEM Australian Energy Data Python Client +License: MIT +URL: https://developers.opennem.org.au +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/5a/65/86dafd0f52993687809a61b31573ed20ed89b60b6b64f16078775786e805/opennem-3.8.0.tar.gz +BuildArch: noarch + +Requires: python3-requests +Requires: python3-pydantic +Requires: python3-click +Requires: python3-requests_cache +Requires: python3-dateutil +Requires: python3-dotenv +Requires: python3-PyYAML +Requires: python3-tomlkit + +%description +# OpenNEM Energy Market Data Access + +   + +The OpenNEM project aims to make the wealth of public National Electricity Market (NEM) data more accessible to a wider audience. + +This client library for Python enables accessing the Opennem API and data sets. + +Project homepage at https://opennem.org.au + +Developer documentation at https://developers.opennem.org.au/ + +Currently supporting the following energy networks: + +- Australia NEM: https://www.nemweb.com.au/ +- Australia WEM (West Australia): http://data.wa.aemo.com.au/ +- APVI rooftop solar data for Australia + +## 1. Requirements + +- Python 3.8+ (see `.python-version` with `pyenv`) +- Docker and `docker-compose` if you want to run the local dev stack + +## 2. Quickstart + +```sh +$ pip install opennem +``` + +``` +>>> import opennem +``` + +## 3. Development + +### 3.1 Auto setup and install + +For contributions and development of this repository you need to install all the requirements. There +are some helper scripts in the `scripts/` folder. + +```sh +$ ./scripts/init.sh +``` + +By default the venv is installed in the user local cache folder and not in the project path. To link the venv +so that it can be found automatically by the shell or editors run the helper script + +```sh +$ ./scripts/link_venv.sh +Created .venv +``` + +### 3.2 Manual Setup + +#### 3.2.1 Prerequisites + +For MacOS and Linux require `pyenv` and `poetry` + + * [pyenv homepage](https://github.com/pyenv/pyenv#installation) - simple install with `brew install pyenv` + * [poetry install](https://python-poetry.org/docs/) (don't install poetry with brew - see [this issue](https://github.com/python-poetry/poetry/issues/36)) + +#### 3.2.2 Initialize python + +We use `pyenv` for python versioning as it allows a system to run multiple version of python. The version for this project is specified in the `.python-version` file in the root of the repository. + +To install the locally required python version + +```sh +$ pyenv install `cat .python-version` +``` + +To initialize and use the local python version + +```sh +$ pyenv version local +3.9.6 (set by /Users/user/Projects/Opennem/opennempy/.python-version) +``` + +To test the install is correct + +```sh +❯ python -V +Python 3.9.6 +❯ which python +/Users/n/.pyenv/shims/python +``` + +#### 3.2.3 Install with poetry + +To manually setup the local development environment, simply create the virtual environment, link it and setup +the PYTHONPATH + +```sh +$ poetry install +$ ln -s `poetry env info -p` .venv +$ source .venv/bin/activate +$ pwd > .venv/lib/python3.9/site-packages/local.pth +``` + +Alternatively to actiavate the virtual environment `poetry` has a shell command: + +```sh +$ poetry shell +Spawning shell within /Users/n/Library/Caches/pypoetry/virtualenvs/opennem-pFt2SfpM-py3.9 +$ which python +/Users/n/Library/Caches/pypoetry/virtualenvs/opennem-pFt2SfpM-py3.9/bin/python +``` + +#### 3.2.4 Install with venv + +Alternatively if you do not wish to use `poetry` you can setup a simple venv in the local folder and activate it. + +```sh +$ python -m venv .venv +$ source .venv/bin/activate +$ pip install -r requirements.txt +``` + +### 3.3 Test Install + +You should be able to run a Python REPL (like `iPython`) and import the `opennem` module + +```sh +$ ipython +Python 3.9.6 (default, Jun 28 2021, 19:24:41) +Type 'copyright', 'credits' or 'license' for more information +IPython 7.23.0 -- An enhanced Interactive Python. Type '?' for help. + +In [1]: import opennem + +In [2]: +``` + + +%package -n python3-opennem +Summary: OpenNEM Australian Energy Data Python Client +Provides: python-opennem +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-opennem +# OpenNEM Energy Market Data Access + +   + +The OpenNEM project aims to make the wealth of public National Electricity Market (NEM) data more accessible to a wider audience. + +This client library for Python enables accessing the Opennem API and data sets. + +Project homepage at https://opennem.org.au + +Developer documentation at https://developers.opennem.org.au/ + +Currently supporting the following energy networks: + +- Australia NEM: https://www.nemweb.com.au/ +- Australia WEM (West Australia): http://data.wa.aemo.com.au/ +- APVI rooftop solar data for Australia + +## 1. Requirements + +- Python 3.8+ (see `.python-version` with `pyenv`) +- Docker and `docker-compose` if you want to run the local dev stack + +## 2. Quickstart + +```sh +$ pip install opennem +``` + +``` +>>> import opennem +``` + +## 3. Development + +### 3.1 Auto setup and install + +For contributions and development of this repository you need to install all the requirements. There +are some helper scripts in the `scripts/` folder. + +```sh +$ ./scripts/init.sh +``` + +By default the venv is installed in the user local cache folder and not in the project path. To link the venv +so that it can be found automatically by the shell or editors run the helper script + +```sh +$ ./scripts/link_venv.sh +Created .venv +``` + +### 3.2 Manual Setup + +#### 3.2.1 Prerequisites + +For MacOS and Linux require `pyenv` and `poetry` + + * [pyenv homepage](https://github.com/pyenv/pyenv#installation) - simple install with `brew install pyenv` + * [poetry install](https://python-poetry.org/docs/) (don't install poetry with brew - see [this issue](https://github.com/python-poetry/poetry/issues/36)) + +#### 3.2.2 Initialize python + +We use `pyenv` for python versioning as it allows a system to run multiple version of python. The version for this project is specified in the `.python-version` file in the root of the repository. + +To install the locally required python version + +```sh +$ pyenv install `cat .python-version` +``` + +To initialize and use the local python version + +```sh +$ pyenv version local +3.9.6 (set by /Users/user/Projects/Opennem/opennempy/.python-version) +``` + +To test the install is correct + +```sh +❯ python -V +Python 3.9.6 +❯ which python +/Users/n/.pyenv/shims/python +``` + +#### 3.2.3 Install with poetry + +To manually setup the local development environment, simply create the virtual environment, link it and setup +the PYTHONPATH + +```sh +$ poetry install +$ ln -s `poetry env info -p` .venv +$ source .venv/bin/activate +$ pwd > .venv/lib/python3.9/site-packages/local.pth +``` + +Alternatively to actiavate the virtual environment `poetry` has a shell command: + +```sh +$ poetry shell +Spawning shell within /Users/n/Library/Caches/pypoetry/virtualenvs/opennem-pFt2SfpM-py3.9 +$ which python +/Users/n/Library/Caches/pypoetry/virtualenvs/opennem-pFt2SfpM-py3.9/bin/python +``` + +#### 3.2.4 Install with venv + +Alternatively if you do not wish to use `poetry` you can setup a simple venv in the local folder and activate it. + +```sh +$ python -m venv .venv +$ source .venv/bin/activate +$ pip install -r requirements.txt +``` + +### 3.3 Test Install + +You should be able to run a Python REPL (like `iPython`) and import the `opennem` module + +```sh +$ ipython +Python 3.9.6 (default, Jun 28 2021, 19:24:41) +Type 'copyright', 'credits' or 'license' for more information +IPython 7.23.0 -- An enhanced Interactive Python. Type '?' for help. + +In [1]: import opennem + +In [2]: +``` + + +%package help +Summary: Development documents and examples for opennem +Provides: python3-opennem-doc +%description help +# OpenNEM Energy Market Data Access + +   + +The OpenNEM project aims to make the wealth of public National Electricity Market (NEM) data more accessible to a wider audience. + +This client library for Python enables accessing the Opennem API and data sets. + +Project homepage at https://opennem.org.au + +Developer documentation at https://developers.opennem.org.au/ + +Currently supporting the following energy networks: + +- Australia NEM: https://www.nemweb.com.au/ +- Australia WEM (West Australia): http://data.wa.aemo.com.au/ +- APVI rooftop solar data for Australia + +## 1. Requirements + +- Python 3.8+ (see `.python-version` with `pyenv`) +- Docker and `docker-compose` if you want to run the local dev stack + +## 2. Quickstart + +```sh +$ pip install opennem +``` + +``` +>>> import opennem +``` + +## 3. Development + +### 3.1 Auto setup and install + +For contributions and development of this repository you need to install all the requirements. There +are some helper scripts in the `scripts/` folder. + +```sh +$ ./scripts/init.sh +``` + +By default the venv is installed in the user local cache folder and not in the project path. To link the venv +so that it can be found automatically by the shell or editors run the helper script + +```sh +$ ./scripts/link_venv.sh +Created .venv +``` + +### 3.2 Manual Setup + +#### 3.2.1 Prerequisites + +For MacOS and Linux require `pyenv` and `poetry` + + * [pyenv homepage](https://github.com/pyenv/pyenv#installation) - simple install with `brew install pyenv` + * [poetry install](https://python-poetry.org/docs/) (don't install poetry with brew - see [this issue](https://github.com/python-poetry/poetry/issues/36)) + +#### 3.2.2 Initialize python + +We use `pyenv` for python versioning as it allows a system to run multiple version of python. The version for this project is specified in the `.python-version` file in the root of the repository. + +To install the locally required python version + +```sh +$ pyenv install `cat .python-version` +``` + +To initialize and use the local python version + +```sh +$ pyenv version local +3.9.6 (set by /Users/user/Projects/Opennem/opennempy/.python-version) +``` + +To test the install is correct + +```sh +❯ python -V +Python 3.9.6 +❯ which python +/Users/n/.pyenv/shims/python +``` + +#### 3.2.3 Install with poetry + +To manually setup the local development environment, simply create the virtual environment, link it and setup +the PYTHONPATH + +```sh +$ poetry install +$ ln -s `poetry env info -p` .venv +$ source .venv/bin/activate +$ pwd > .venv/lib/python3.9/site-packages/local.pth +``` + +Alternatively to actiavate the virtual environment `poetry` has a shell command: + +```sh +$ poetry shell +Spawning shell within /Users/n/Library/Caches/pypoetry/virtualenvs/opennem-pFt2SfpM-py3.9 +$ which python +/Users/n/Library/Caches/pypoetry/virtualenvs/opennem-pFt2SfpM-py3.9/bin/python +``` + +#### 3.2.4 Install with venv + +Alternatively if you do not wish to use `poetry` you can setup a simple venv in the local folder and activate it. + +```sh +$ python -m venv .venv +$ source .venv/bin/activate +$ pip install -r requirements.txt +``` + +### 3.3 Test Install + +You should be able to run a Python REPL (like `iPython`) and import the `opennem` module + +```sh +$ ipython +Python 3.9.6 (default, Jun 28 2021, 19:24:41) +Type 'copyright', 'credits' or 'license' for more information +IPython 7.23.0 -- An enhanced Interactive Python. Type '?' for help. + +In [1]: import opennem + +In [2]: +``` + + +%prep +%autosetup -n opennem-3.8.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-opennem -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 3.8.0-1 +- Package Spec generated |