{"id":2433,"library":"cleanco","title":"Cleanco","description":"Cleanco is a Python library (current version 2.3) designed to process company names. It cleans names by stripping away terms indicating organization type (like 'Ltd.' or 'Corp.'), deduces the business entity type (e.g., 'limited liability company'), and suggests possible countries of establishment. Releases are somewhat irregular, with recent updates in late 2023 and early 2024.","status":"active","version":"2.3","language":"en","source_language":"en","source_url":"https://github.com/psolin/cleanco","tags":["company names","natural language processing","nlp","data cleaning","business entities"],"install":[{"cmd":"pip install cleanco","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The old class-based API (cleanco.cleanco().clean_name()) was removed in version 2.2. Use the functional API (cleanco.basename()) instead.","wrong":"from cleanco import cleanco; x = cleanco(name); x.clean_name()","symbol":"basename","correct":"from cleanco import basename"},{"note":"Use this function for advanced customization with your own terms.","symbol":"custom_basename","correct":"from cleanco import custom_basename"},{"note":"`prepare_terms()` was renamed to `prepare_default_terms()` in version 2.2.","wrong":"from cleanco import prepare_terms","symbol":"prepare_default_terms","correct":"from cleanco import prepare_default_terms"}],"quickstart":{"code":"from cleanco import basename, typesources, matches, countrysources\n\nbusiness_name = \"Some Big Pharma, LLC\"\ncleaned_name = basename(business_name)\nprint(f\"Cleaned name: {cleaned_name}\")\n\nclassification_sources = typesources()\nbusiness_types = matches(business_name, classification_sources)\nprint(f\"Business types: {business_types}\")\n\ncountry_classification_sources = countrysources()\npossible_countries = matches(business_name, country_classification_sources)\nprint(f\"Possible countries: {possible_countries}\")","lang":"python","description":"This example demonstrates how to clean a company name, deduce its business type, and suggest possible countries of origin using the primary functions of the cleanco library."},"warnings":[{"fix":"Migrate to the new functional API, primarily `from cleanco import basename` and `basename(name)`.","message":"The old class-based API, such as `cleanco.cleanco(name).clean_name()`, was entirely removed in version 2.2.","severity":"breaking","affected_versions":">=2.2"},{"fix":"Update imports and function calls from `prepare_terms` to `prepare_default_terms`.","message":"The function `prepare_terms()` was renamed to `prepare_default_terms()` in version 2.2.","severity":"breaking","affected_versions":">=2.2"},{"fix":"Ensure your project runs on Python 3.6 or newer (2.3 supports 3.8-3.12).","message":"Cleanco moved to be Python 3 only from version 2.0.1.","severity":"breaking","affected_versions":">=2.0.1"},{"fix":"Review calls to `basename()` and remove redundant `terms` arguments. For custom terms, switch to `custom_basename()`.","message":"From version 2.2 onwards, terms no longer need to be explicitly passed to `basename()`, simplifying its usage. If you need custom terms, use `custom_basename()` instead.","severity":"gotcha","affected_versions":">=2.2"},{"fix":"Consider applying `basename()` in a loop or twice on names where multiple suffixes are common (e.g., 'Company, Inc. Ltd.').","message":"For company names with multiple suffixes, you might need to run `basename()` more than once to ensure all suffixes are stripped, as the internal term data might cover these iteratively.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}