ixc / python-edtf

MIT License
52 stars 19 forks source link

Is Django required? #19

Closed koenedaele closed 7 years ago

koenedaele commented 7 years ago

Just tried the example in the README and this is what I get:

Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from edtf import parse_edtf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/koen/Virtualenvs/edtf/local/lib/python2.7/site-packages/edtf/__init__.py", line 1, in <module>
    from parser.grammar import parse_edtf
  File "/home/koen/Virtualenvs/edtf/local/lib/python2.7/site-packages/edtf/parser/__init__.py", line 1, in <module>
    from grammar import parse_edtf
  File "/home/koen/Virtualenvs/edtf/local/lib/python2.7/site-packages/edtf/parser/grammar.py", line 5, in <module>
    from parser_classes import Date, DateAndTime, Interval, Unspecified, \
  File "/home/koen/Virtualenvs/edtf/local/lib/python2.7/site-packages/edtf/parser/parser_classes.py", line 6, in <module>
    from edtf import appsettings
  File "/home/koen/Virtualenvs/edtf/local/lib/python2.7/site-packages/edtf/appsettings.py", line 2, in <module>
    from django.core.exceptions import ImproperlyConfigured
ImportError: No module named django.core.exceptions

Does this mean EDTF is only meant to be used with Django?

I see the parser needs access to some configuration settings. I assume this could be decoupled from Django and that multiple settings providers could be written (on for Djano, one for Pyramid ini style config, one for Flask, one with an in-code dictionary, ...)?

markfinger commented 7 years ago

@koenedaele we've just pushed 2.6.0 to pypi, with a fix for the issue you experienced.