- Fixed issues with the WorldEconomicOutlook importer. Switches to using imf-reader, a new package we have developed to read the WEO data using the SDMX standard, rather than the excel files.
- Updated pyarrow dependency (more flexible)
- Switched the backend of the WorldEconomicOutlook importer to remove the weo-reader dependency.
- Fixed a bug with DSA data extraction from the IMF.
- Updated dependencies.
- Updated dependencies.
- Updated pypdf2 dependency to pypdf.
- A custom function 'convert_to_datetime' that replaces the usage of native
pd.to_datetime
. This function handles various date formats, especially when the date presents only a year. This is to handle pandas >2.0 which deprecatedinfer_datetime_format
.
- Upgraded the versions of various dependencies in
poetry.lock
, including 'anyio', 'astroid', 'asttokens', 'bumpversion', 'pandas' etc. - Minor code changes to improve structure and readability. This includes reducing explicit regex flag usage in
str.replace
and reordering some assignments.
- Added a new feature:
imf_weo
module inimport_tools
with an object to extract data from the World Economic Outlook (WEO).
- Updated requirements
- Added a new feature:
ilo
module inimport_tools
with an object to extract data from the ILO. - Added a new feature:
DebtIDS
module inimport_tools
with an object to extract data from the World Bank International Debt Statistics database. - Fixed a bug in the
ilo
importer object that did not map names correctly.
Improved documentation
Fix a bug with parsing food security dates
-
First major release of bblocks. This introduces changes to the importer classes API in order to make things more coherent. As a result, backwards compatibility is not guaranteed.
-
This release introduces changes to how files are stored. No data is distributed with the package anymore. Instead, users are expected to set the working directory to a folder where they want to store the data.
- Updated requirements
- Fixed bugs in
unaids
module preventing instantiation of the parent classImportData
and handling json responses for regional data. - Updated the requirements
- Fixed the
GHED
importer given changes in the underlying data structure
- Added a new feature:
who
module inimport_tools
with an object to extract data from GHED dataset.
- Improved the pink_sheets and sdr scripts.
- Added a new feature: can now import data from UNAIDS.
The module is called
unaids
and is located inimport_tools
.
- Added a new feature: can now import data from the World Bank IDS
database. The new module is called
ids
and it is part ofimport_tools.debt
.
- Fix bug in how years added variables are named in DataFrame add
- Fix bug in how years are matched under DataFrame add
- Change how dates are handled when adding to a dataframe
- Update WFP data handling to append new data instead of replacing.
- WEO update file path bug fix.
- Minor bug with file management resolved.
- Added an optional parameter to importers in order to specify where the data should be stored.
- Fixed how the
WorldEconomicOutlook
object handles moving to the latest data - Added new optional parameters to
WorldEconomicOutlook
to allow for specifying the data version. WorldEconomicOutlook
now has an instance attributeversion
that stores the version of the data used to create the object.
- Added a new feature:
date_to_str()
, which formats a date as an english string. - Added a new feature:
format_number
, which formats a numeric series as a formatted string (e.g. 1,234,567.89 instead of 1234567.89). Optionally can specify to format as percentage, millions, or billions. - Added a new feature:
latest_sdr_exchange
, which extracts the latest SDR exchange rate information in a dictionary - Fixed bug on SDR object - when
update_data = True
indicators are loaded in the object whenload_indicator
is called.
- Fixed a bug with adding WEO columns to dataframes
- Added a new feature:
period_avg()
, which calculates the average of a time series/DataFrame for a given period. - Added a new module:
imf
, which contains functions and objects to extract IMF data (SDR holdings and allocations). - Added a new feature:
get_dsa()
, which extracts DSA data from the IMF. - Added a new feature:
change_from_date()
, which calculates the nominal or percentage change for a column (by a grouper) from/to a given date. - Added a new feature:
append_new_data()
, to read a previously-saved DataFrame and append new data to it (removing duplicates by date). - Added a new feature:
WFPData
, class, which is used to download headline and food inflation data, plus people with insufficient food consumption data, from WFP. - Added a new feature:
get_fao_index()
, which downloads the FAO food index data. - Added a new feature:
convert_id()
, which converts a Pandas Series containing country IDs (like names or ISO3 codes) to another format (like ISO3 codes). - Added a new feature:
dac_codes
, which is a dictionary with DAC codes for DAC donor countries. A future version will add recipient codes. - Added a new feature:
get_population_id()
, which returns a Pandas DataFrame with population data for all countries with available World Bank Data. A future version will add the option to choose a source for this data. - Added a new feature:
add_population_column()
, which adds a new column containing population data to a DataFrame. - Added a new feature:
add_short_names_column()
, which adds a new column containing short country names to a DataFrame. - Added a new feature:
add_iso_codes_column()
, which adds a new column containing ISO3 codes to a DataFrame. - Added a new feature:
filter_latest_by()
which returns the latest value given a series of columns to group by. - Added a new feature:
to_date_column()
which converts a column to a date column. - Added a new feature:
add_poverty_ratio_column()
which adds a new column containing the poverty ratio to a DataFrame, using World Bank data. Note that yearly population data is missing for many countries in many years. - Added a new feature:
add_population_density()
which adds a new column containing the population density to a DataFrame, using World Bank data. - Added a new feature:
add_population_share_column()
, which adds a new column transforming a column with numeric values into a new column which shows those values as a share of population. - Added a new feature:
add_median_observation()
to add the median observation for a given group, either as a new column or appended to the end of the dataframe. - Added a new feature:
add_income_level_column()
to add the World Bank income level for countries as a new column. - Added a new feature:
add_gdp_column()
andadd_gdp_share_column()
to add the GDP information from the IMF World Economic Outlook to a DataFrame. - Added a new feature:
add_gov_expenditure_column()
andadd_gov_exp_share_column()
to add government expenditure data from IMF World Economic Outlook to a DataFrame. - Added a new feature:
add_flourish_geometries()
to map the geometries used by Flourish maps to countries, added to a DataFrame as a new column. - Added a new feature:
add_value_as_share()
to add a new column with a value as a share of another column. - Added new features: A
_filter_by()
helper function to filter a DataFrame based on membership to a specific grouping. Additionallyfilter_african_countries()
to filter a DataFrame to keep only African countries,filter_eu_countries()
to filter to keep ony EU members,filter_by_un_region()
to filter by UN regions, andfilter_by_continent()
to filter countries based on their continent.
- Added a new feature:
clean_number()
which cleans a string and returns a float or int. - Added a new feature:
clean_numeric_series()
which cleans the numbers in a pd.Series (or list of series) - improved documentation
- First release on PyPI.
- Preparation for first release
- First release on test PyPI.