john-kurkowski/tldextract — pull request #45 by hangtwenty (2013-10-22 22:17:11+00:00)
Title: Changes related to #38, #39, #41 (PSL flexibility)

Make changes with the goal of more flexibility when using
`TLDExtract` (i.e. instantiating your own callable, with custom options).

Goal: control of data source & network activity, while maintaining
the nice, clean API.

* Add more tests covering most or all new cases introduced
** No regressions for existing tests
* Update docstring of `tldextract.TLDExtract`
* #38
** Add `suffix_list_url` kwarg. Allows you to specify
the location of the Public Suffix List, or anything like
this file. This is expected to be a UTF-8 encoded text file.
** Rename keyword argument for TLDExtract from `suffix_list_file` to
`suffix_list_url`. Update docstring accordingly. This makes it so
that it is compatible with the `fetch` keyword argument.
** Add `fallback_to_snapshot` kwarg. Defaults to `True`.
If disabled, it will NOT use the distributed snapshot
of the PSL when `tlds` is empty.
** README += section re: features from #38
* #39
** Simplification of keyword arguments.
* `suffix_list_url` for both files and public suffix list url;
remove `Fetch`. (if you don't want it to fetch, set
`suffix_list_url` to `False`.)
* `cache_file` can now be set to something that evaluates to
`False`, in order to disable caching.
** Only complain about 1 combination of keyword arguments, where it's
necessary - and complain on construction, not calling.
** Update README examples
* #41
** Address concerns in Pull Request #41.
** keep `fetch` around; if EITHER `fetch` or `suffix_list_url` are falsey,
it will disable anything that depends on `suffix_list_url` (i.e.
pulling in from the net or from local).
*** log warning