Package: hoopoe
HoopoeA fast and easy way to enrich your dataHoopoe is a data enrichment service that makes it easy to improve your data-centric services and increase the accuracy of your ML models.Hoopoe saves you time in scraping data and loading it to Pandas Dataframes. Instead, just specify the data you already have in your dataframe and its type, and select the desired data you would like to add.Current development statusHoopoe is in its early days and offered as a pre-alpha version. Therefore, bugs are expected. In addition, the current dataset availability is low. You can check the list below to find out which datasets and translations are already available. This list will be updated from time to time.Available datasets, enrichment options and translationsWorld dataPopulation by countryUS statesState name abbriviation (USPS abbreviation)Full state nameState populationState capital city:State capital city nameState capital city population:PopulationMSA/ÂµSA population (Metropolitan Statistical Area / Micropolitan Statistical Area)CSA population (Combined Statistical Area)State area:State total area rankState total area (km2)State land area rankState land area (km2)State water area rankState water area (km2)Country calling codes (international call prefixes)Country nameInternational calling codeUnits of measureCelsiusFarenheitKelvin* If you would like to see here another dataset, please contact me and let me know.Work in progress datasetsUS states ISO 3166 codeUS states time zoneUS states densityUS states population rankUS states income rankUS states density rankUS city populationCapital city by countryCountries time zoneCountries official languageCountries areaCountries capital cityUnit of measureDistanceAreaSpeedEnergyDay of week, day of month, day of yearHow to useCurrently, Hoopoe supports enrichments of Pandas Dataframes and single strings.
For basic usage, after installation, import Hoopoe and use the hoopoe enrich function as follows:hoopoe.enrich(data, source_data_name, source_data_type, target_data_type)data- Either a string or a Pandas dataframe.source_data_name- the dataframe column name of the column you want to enrich.source_data_type- the Hoopoe source data type. For example us_state_name_abbr for a column holding abbriviations of us state.target_data_type- the target Hoopoe data type you would like Hoopoe to return. For example, for country name, return the target date type phone_prefix for country calling code.Enrichment optionsCategorySource data type desc.Hoopoe source_data_typeTarget data type desc.Hoopoe target_data_typePlacesTwo letter abbriviations of USA states name (USPS abbreviation)us_state_name_abbrFull USA states nameus_state_name_fullPlacesFull USA states nameus_state_name_fullTwo letter abbriviations of USA states name (USPS abbreviation)us_state_name_abbrPlacesFull USA states nameus_state_name_fullState population 2019 est.us_state_populationPlacesFull USA state nameus_state_name_fullState capital city nameus_state_capital_cityPlacesCapital city nameus_capital_city_nameCity population 2019 est.us_capital_city_populationPlacesCapital city nameus_capital_city_nameCity population (Metropolitan/Micropolitan Statistical Area - MSA) 2019 est.us_capital_city_population_msaPlacesCapital city nameus_capital_city_nameCity population (Combined Statistical Area - CSA) 2019 est.us_capital_city_population_csaPlacesFull USA state nameus_state_name_fullState total area rankus_state_total_area_rankPlacesFull USA state nameus_state_name_fullState total area rankus_state_total_area (km2)PlacesFull USA state nameus_state_name_fullState land area rankus_state_land_area_rankPlacesFull USA state nameus_state_name_fullState land area rankus_state_land_area (km2)PlacesFull USA state nameus_state_name_fullState water area rankus_state_water_area_rankPlacesFull USA state nameus_state_name_fullState water area rankus_state_water_area (km2)PlacesCountry namecountry_namecountry population (2019 est.)country_populationPhone numbersCountry namecountry_nameIntenational phone prefixphone_prefixPhone numbersIntenational phone prefixphone_prefixCountry namecountry_nameUnits - TempretureCelsiuscelsiusFarenheitfarenheitUnits - TempretureCelsiuscelsiusKelvinkelvinUnits - TempretureFarenheitfarenheitCelsiuscelsiusUnits - TempretureFarenheitfarenheitKelvinkelvinUnits - TempretureKelvinkelvinCelsiuscelsiusUnits - TempretureKelvinkelvinFarenheitfarenheitUsage exampleLet's say that you have the following Pandas Dataframe that you would like to use to estimate your company's sales in each of the US states. One of the key factors of sales potential is, of course, the population of the state, so we would like to add this data to our dataframe.StateLast model sales (2018)Median household income (2018)AL1,87749861AK3,01874346AZ6,01859243NY25,08767844NJ17,98381740.........TX14,00760629We can look at the Hoopoe enrichment options and see that, indeed, the population data for each US state is available. The problem is that to get it, we need to provide the full state name, and currently we have only the two-letter code for each state. Luckily, hoopoe has another dataset that s states' two-letter abbreviation to the full state name. After getting the full state name, we will use it to get the population data.step one - getting full state namedf = hoopoe.enrich(df, source_data_name = "State", source_data_type = "us_state_name_abbr", target_data_type = "us_state_name_full")now our dataframe looks like this:StateLast model sales (2018)Median household income (2018)us_state_name_fullAL1,87749861alabamaAK3,01874346alaskaAZ6,01859243arizonaNY25,08767844new yorkNJ17,98381740new jersey............TX14,00760629texasstep two - getting state populationdf = hoopoe.enrich(df, source_data_name = "us_state_name_full", source_data_type = "us_state_name_full", target_data_type = "us_state_population")Now, our dataframe contains the data that we wanted:StateLast model sales (2018)Median household income (2018)us_state_name_fullus_state_populationAL1,87749861alabama4903185AK3,01874346alaska731545AZ6,01859243arizona7278717NY25,08767844new york19453561NJ17,98381740new jersey8882190...............TX14,00760629texas28995881InstallingTo install Hoopoe, run the following in your virtualenv:$ pip install hoopoeDeveloping HoopoeTo install Hoopoe, along with the tools you need to develop and run tests, run the following in your virtualenv:$ pip install -e .[dev]DependenciesPandasDev dependencies (only for contributers)pytestcheck-manifestLicenceMIT License