Skip to content

Commit

Permalink
prepare for 2.2 release; updated changelog, readme, version & remove …
Browse files Browse the repository at this point in the history
…old class based API
  • Loading branch information
petri committed Nov 16, 2021
1 parent 6391604 commit 33b9b05
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 57 deletions.
9 changes: 6 additions & 3 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
Changelog
**********

2.2 (Unpublished)
2.2 (2021-11-16)
-----------------

- Nothing yet

- Terms no longer need to be explicitly passed to basename()
- New custom_basename() can be used with custom terms
- prepare_terms() was renamed to prepare_default_terms()
- Tests were simplified
- Old class based API was removed

2.1 (2021-01-30)
----------------
Expand Down
37 changes: 5 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ Just use 'pip install cleanco' if you have pip installed (as most systems do). O
## How does it work?
Let's look at some sample code. To get the base name of a business without legal suffix:

>>> from cleanco import prepare_default_terms, basename
>>> from cleanco import basename
>>> business_name = "Some Big Pharma, LLC"
>>> terms = prepare_default_terms()
>>> basename(business_name, terms, prefix=False, middle=False, suffix=True)
>>> basename(business_name)
>>> 'Some Big Pharma'

Note that sometimes a name may have e.g. two different suffixes after one another. The cleanco
term data covers many of these but you may want to run `basename()` twice, just in case.
term data covers many of these, but you may want to run `basename()` twice on the name, just in case.

If you want to use your custom terms, please see `custom_basename()` that also provides some other ways to adjust how base name is produced.

To get the business type or country:

Expand All @@ -49,34 +50,6 @@ To get the possible countries of jurisdiction:
>>> matches("Some Big Pharma, LLC", classification_sources) ´
['United States of America', 'Philippines']

The legacy (versions < 2.0) way can still be used, too, but will eventually be discontinued:

Import the utility class:

>>> from cleanco import cleanco

Prepare a string of a company name that you want to process:

>>> business_name = "Some Big Pharma, LLC"

Throw it into the instance:

>>> x = cleanco(business_name)

You can now get the company types:

>>> x.type()
['Limited Liability Company']

...the possible countries...

>>> x.country()
['United States of America', 'Philippines']

...and a clean version of the company name.

>>> x.clean_name()
'Some Big Pharma'

## Are there bugs?
See the issue tracker. If you find a bug or have enhancement suggestion or question, please file an issue and provide a PR if you can. For example, some of the company suffixes may be incorrect or there may be suffixes missing.
Expand Down
1 change: 0 additions & 1 deletion cleanco/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from .cleanco import cleanco
from .clean import prepare_default_terms, basename
from .classify import typesources, countrysources, matches
20 changes: 0 additions & 20 deletions cleanco/cleanco.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
description='Python library to process company names',
long_description=long_description,
long_description_content_type='text/markdown',
version='2.2-dev0',
version='2.2',
license="MIT",
license_files=('LICENSE.txt',),
classifiers = [
Expand Down

0 comments on commit 33b9b05

Please sign in to comment.