parsedatetime icon indicating copy to clipboard operation
parsedatetime copied to clipboard

Separate `parsedatetime/__init__.py` into several small `.py` files

Open philiptzou opened this issue 10 years ago • 1 comments

The current parsedatetime/__init__.py is extremely huge (~ 2,800 lines) which is not human-friendly for both reading and debugging. We should find a way to separate this one into several small modules. My suggestion is:

  • __init__.py - an empty init module only import classes/functions that are exposed to public access;
  • helpers.py - all helper functions, for example, _extract_date, _extract_time and _pop_time_accuracy, etc.;
  • parse.py - all parser functions which can be separated from Calendar class;
  • calendar.py - for Calendar class which contains all variables for parser functions (or just keep context.py is enough?);
  • constants.py - for Constants class which contains all constants for parser functions;
  • shortcut.py - new shortcut functions, e.g. parse(), nlp(), etc.

These features should shoot for version 2.0 or later.

philiptzou avatar Oct 19 '15 04:10 philiptzou

blocking https://github.com/bear/parsedatetime/issues/121

bear avatar Nov 05 '15 06:11 bear