Skip to content

Commit f37dcaf

Browse files
committed
setting up for first publication, copied setup structure and github action pipeline from entsoe-py
1 parent 9e18c80 commit f37dcaf

File tree

6 files changed

+151
-1
lines changed

6 files changed

+151
-1
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-n-publish:
9+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@master
13+
- name: Set up Python 3.9
14+
uses: actions/setup-python@v1
15+
with:
16+
python-version: 3.9
17+
- name: Install pypa/build
18+
run: >-
19+
python -m
20+
pip install
21+
build
22+
--user
23+
- name: Build a binary wheel and a source tarball
24+
run: >-
25+
python -m
26+
build
27+
--sdist
28+
--wheel
29+
--outdir dist/
30+
.
31+
- name: Upload distribution 📦 to release
32+
uses: svenstaro/upload-release-action@2.2.1
33+
with:
34+
repo_token: ${{ secrets.GITHUB_TOKEN }}
35+
file: dist/*.whl
36+
file_glob: true
37+
tag: ${{ github.ref }}
38+
- name: Publish distribution 📦 to Test PyPI
39+
uses: pypa/gh-action-pypi-publish@master
40+
with:
41+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
42+
repository_url: https://test.pypi.org/legacy/
43+
- name: Publish distribution 📦 to PyPI
44+
uses: pypa/gh-action-pypi-publish@master
45+
with:
46+
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# jao-py
2+
Python client for the various endpoints offered by jao.eu, the Joint Allocation Office.
3+
"Europe's single leading trading platform( e-CAT) for cross-border transmission capacity"
4+
5+
More information about JAO can be found on their website https://jao.eu/
6+
7+
jao.eu has various ways of retrieving data. This package tries to offer useful functions to handle them.
8+
This package is not exhaustive, more methods are added when the authors needs them.
9+
If you want to see other methods added please either open a feature request issue to give others ideas or
10+
supply a pull request yourself.
11+
12+
13+
## Installation
14+
`python3 -m pip install jao-py`
15+
16+
## Usage
17+
The package comes with 4 clients:
18+
- [`JaoAPIClient`](#JaoAPIClient): api client for the normal http api
19+
- [`JaoUtilityToolASMXClient`](#JaoUtilityToolASMXClient): a very light wrapper around the ASMX Web Service API implemented as a passthrough to the suds-community pakcage
20+
- [`JaoUtilityToolCSVClient`](#JaoUtilityToolCSVClient): client to download csv data inm the same way as the utility tool excel file, returns pandas dataframes
21+
- [`JaoUtilityToolXmlClient`](#JaoUtilityToolXmlClient): downloads xml data of the utilitytool, this requires solving a captcha by the user, returns pandas dataframes

jao/jao.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def help(self):
163163

164164

165165
class JaoUtilityToolCSVClient:
166-
# this ingests from the same client the excell macros in the utility tool is talking too
166+
# this ingests from the same client the excel macros in the utility tool is talking too
167167
# because of this the endpoints are open and thus no key or captcha is required
168168
def __init__(self):
169169
self.s = requests.Session()

manifest.in

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include README.md
2+
include LICENSE.md
3+
include requirements.txt
4+
include jao/*

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[metadata]
2+
description-file = README.md

setup.py

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""
4+
A setuptools based setup module for jao-py
5+
6+
Adapted from
7+
https://packaging.python.org/en/latest/distributing.html
8+
https://github.com/pypa/sampleproject
9+
"""
10+
11+
# Always prefer setuptools over distutils
12+
from setuptools import setup, find_packages
13+
# To use a consistent encoding
14+
from codecs import open
15+
from os import path
16+
17+
here = path.abspath(path.dirname(__file__))
18+
19+
# Get the long description from the README file
20+
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
21+
long_description = f.read()
22+
23+
# Get the version from the source code
24+
with open(path.join(here, 'jao', 'jao.py'), encoding='utf-8') as f:
25+
lines = f.readlines()
26+
for l in lines:
27+
if l.startswith('__version__'):
28+
__version__ = l.split('"')[1] # take the part after the first "
29+
30+
setup(
31+
name='jao-py',
32+
version=__version__,
33+
description='A python API wrapper for JAO.eu',
34+
long_description=long_description,
35+
long_description_content_type='text/markdown',
36+
url='https://github.com/fboerman/jao-py',
37+
author='Frank Boerman',
38+
author_email='frank@fboerman.nl',
39+
license='MIT',
40+
41+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
42+
classifiers=[
43+
'Development Status :: 3 - Alpha',
44+
45+
# Indicate who your project is intended for
46+
'Intended Audience :: Developers',
47+
'Topic :: Scientific/Engineering',
48+
49+
# Pick your license as you wish (should match "license" above)
50+
'License :: OSI Approved :: MIT License',
51+
52+
# Specify the Python versions you support here. In particular, ensure
53+
# that you indicate whether you support Python 2, Python 3 or both.
54+
'Programming Language :: Python :: 3.8',
55+
'Programming Language :: Python :: 3.9',
56+
],
57+
58+
keywords='JAO data api energy',
59+
60+
# You can just specify the packages manually here if your project is
61+
# simple. Or you can use find_packages().
62+
packages=find_packages(),
63+
64+
65+
# List run-time dependencies here. These will be installed by pip when
66+
# your project is installed.
67+
install_requires=['requests', 'pandas', 'suds-community', 'python-dateutil', 'beautifulsoup4', 'lxml', 'pillow'],
68+
69+
# If there are data files included in your packages that need to be
70+
# installed, specify them here. If using Python 2.6 or less, then these
71+
# have to be included in MANIFEST.in as well.
72+
# Note: for creating the source distribution, they had to be included in the
73+
# MANIFEST.in as well.
74+
package_data={
75+
'jao-py': ['LICENSE.md', 'README.md'],
76+
},
77+
)

0 commit comments

Comments
 (0)