diff --git a/.hound.yml b/.hound.yml deleted file mode 100644 index c5ab916..0000000 --- a/.hound.yml +++ /dev/null @@ -1,2 +0,0 @@ -python: - enabled: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d069e49..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -sudo: false -matrix: - fast_finish: true - include: - - python: "3.5" - env: TOXENV=py35 - - python: "3.6" - env: TOXENV=py36 - - python: "3.6-dev" - env: TOXENV=py36 -cache: - directories: - - $HOME/.cache/pip -install: - - pip install --upgrade pip setuptools wheel - - pip install -r requirements.txt - - pip install -r requirements_test.txt - - python3 setup.py develop - - pip install -U tox coveralls -language: python -script: - - py.test - - flake8 - - travis_wait tox -after_success: coveralls \ No newline at end of file diff --git a/examples/example_download_parse_xml.py b/examples/example_download_parse_xml.py index 921cca5..4c0f00b 100644 --- a/examples/example_download_parse_xml.py +++ b/examples/example_download_parse_xml.py @@ -1,23 +1,26 @@ # Hack to allow relative import above top level package -import sys import os +import sys + folder = os.path.dirname(os.path.abspath(__file__)) # noqa sys.path.insert(0, os.path.normpath("%s/.." % folder)) # noqa -from pygleif.const import URL_LEVEL2_CONCAT_FILES -from pygleif import GLEIFParseRelationshipRecord -import arrow -import wget -from zipfile import ZipFile import os import xml.etree.ElementTree as ET +from zipfile import ZipFile + +import arrow +import wget + +from pygleif import GLEIFParseRelationshipRecord +from pygleif.const import URL_LEVEL2_CONCAT_FILES debug = 1 -today = arrow.now().format('YYYYMMDD') -level_2_url = URL_LEVEL2_CONCAT_FILES.replace('%date%', today) -save_name = 'file'+today+'.zip' -extracted_file = today+'-gleif-concatenated-file-rr.xml' +today = arrow.now().format("YYYYMMDD") +level_2_url = URL_LEVEL2_CONCAT_FILES.replace("%date%", today) +save_name = "file" + today + ".zip" +extracted_file = today + "-gleif-concatenated-file-rr.xml" if debug == 0: @@ -28,8 +31,8 @@ wget.download(level_2_url, save_name) # opening the zip file in READ mode - with ZipFile(save_name, 'r') as zip: - print('Extracting all the files now...') + with ZipFile(save_name, "r") as zip: + print("Extracting all the files now...") zip.extractall() os.remove(save_name) @@ -38,7 +41,7 @@ # for i in range(len(root[1])): for i in range(5): - xml_data = ET.tostring(root[1][i], encoding='utf8', method='xml') + xml_data = ET.tostring(root[1][i], encoding="utf8", method="xml") data = GLEIFParseRelationshipRecord(xml_data) relationship_type = data.raw.Relationship.RelationshipType.text diff --git a/examples/query_api.py b/examples/query_api.py index 5a6bd91..53b9067 100644 --- a/examples/query_api.py +++ b/examples/query_api.py @@ -1,14 +1,16 @@ # Hack to allow relative import above top level package -import sys import os +import sys + folder = os.path.dirname(os.path.abspath(__file__)) # noqa sys.path.insert(0, os.path.normpath("%s/.." % folder)) # noqa from pprint import pprint -from pygleif.gleif import GLEIF + from pygleif import Search +from pygleif.gleif import GLEIF -gleif_data = GLEIF('506700GE1G29325QX363') -gleif_search = Search('986228608') +gleif_data = GLEIF("506700GE1G29325QX363") +gleif_search = Search("986228608") pprint((gleif_data.raw)) diff --git a/setup.py b/setup.py index b01b078..f4fc25a 100644 --- a/setup.py +++ b/setup.py @@ -1,35 +1,34 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from setuptools import setup, find_packages - # To use a consistent encoding from codecs import open from os import path +from setuptools import find_packages, setup + here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() -VERSION = "2.0.0" -DOWNLOAD_URL = \ - 'https://github.com/ggravlingen/pygleif/archive/{}.zip'.format(VERSION) +VERSION = "3.0.0" +DOWNLOAD_URL = 'https://github.com/ggravlingen/pygleif/archive/{}.zip'.format(VERSION) PACKAGES = find_packages(exclude=['tests', 'tests.*']) setup( - name='pygleif', - packages=PACKAGES, - python_requires='>=3.8', - version=VERSION, - description='API for LEI', - long_description=long_description, - author='ggravlingen', - author_email='no@email.com', - url='https://github.com/ggravlingen/pygleif', - license='MIT', - keywords='lei-code lei api gleif leicode', - download_url=DOWNLOAD_URL + name='pygleif', + packages=PACKAGES, + python_requires='>=3.8', + version=VERSION, + description='API for LEI', + long_description=long_description, + author='ggravlingen', + author_email='no@email.com', + url='https://github.com/ggravlingen/pygleif', + license='MIT', + keywords='lei-code lei api gleif leicode', + download_url=DOWNLOAD_URL, )