Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ordereddict dependency #55

Open
yosukesan opened this issue Apr 16, 2021 · 1 comment
Open

Remove ordereddict dependency #55

yosukesan opened this issue Apr 16, 2021 · 1 comment
Assignees

Comments

@yosukesan
Copy link
Contributor

yosukesan commented Apr 16, 2021

Ordereddict was used before collections was introduced at Python 2.7. Since Python 2 is no longer supported I feel it's probably safe to remove. Python 2.6 or older users may have trouble. If you are happy, I will send a pull request.

To change following should be enough.

diff --git a/setup.py b/setup.py
index 9b1bada..ec9ecc3 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ setup(
     keywords='xbrl, Financial, Accounting, file formats',
     packages=['xbrl'],
     install_requires=['pytest', 'pep8', 'marshmallow',
-    'beautifulsoup4', 'ordereddict', 'lxml', 'six'],
+    'beautifulsoup4', 'lxml', 'six'],
     classifiers=[
         'Intended Audience :: Developers',
         'Natural Language :: English',
diff --git a/xbrl/xbrl.py b/xbrl/xbrl.py
index b93f8e8..ff4087a 100644
--- a/xbrl/xbrl.py
+++ b/xbrl/xbrl.py
@@ -4,7 +4,7 @@
 import re
 from marshmallow import Schema, fields
 import datetime
-import collections
+import collections as odict
 import six
 import logging
 
@@ -13,12 +13,6 @@ try:
 except ImportError:
     from io import StringIO
 
-if 'OrderedDict' in dir(collections):
-    odict = collections
-else:
-    import ordereddict as odict
-
-
 def soup_maker(fh):
     """ Takes a file handler returns BeautifulSoup"""
     try:
@greedo greedo self-assigned this Jun 20, 2022
@greedo
Copy link
Owner

greedo commented Jun 20, 2022

This sounds good, happy to review the PR @yosukesan

@greedo greedo assigned yosukesan and unassigned greedo and yosukesan Jun 20, 2022
yosukesan added a commit to yosukesan/python-xbrl that referenced this issue Dec 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants