Package: phl-budget-data
InstallationTo get the latest version of the code, clone the repository, and usepoetry installto install the dependencies.You can also install the package into
a conda environment using the following commandcondaactivatepy38
pipinstall.This will install the package into thepy38environment.ExamplesThe subsections below list examples for loading various kinds of budget-related data sets for the City of Philadelphia.Revenue ReportsData is available from the City of Philadelphia's Revenue reports, as published to theCity's website.City CollectionsMonthly PDF reports are available on the City of Philadelphia's website according to fiscal year (example:FY 2021).Note:Cleaned CSV files are available in the following folder:src/phl_budget_data/data/processed/collections/monthly/city/Load the data using Python:fromphl_budget_data.cleanimportload_city_collectionsdata=load_city_collections()data.head()Output:namefiscal_yeartotalmonth_namemonthfiscal_monthyeardatekind0sales202114228731.0jan1720212021-01-01Tax1wage_earnings_net_profits2021182689530.0jan1720212021-01-01Tax2soda20215149478.0jan1720212021-01-01Tax3outdoor_ads2021179166.0jan1720212021-01-01Tax4real_estate_transfer202127222198.0jan1720212021-01-01TaxSchool District CollectionsMonthly PDF reports are available on the City of Philadelphia's website according to fiscal year (example:FY 2021).Note:Cleaned CSV files are available in the following folder:src/phl_budget_data/data/processed/collections/monthly/school/Load the data using Python:fromphl_budget_data.cleanimportload_school_collectionsdata=load_school_collections()data.head()Output:namefiscal_yeartotalmonth_namemonthfiscal_monthyeardate0real_estate202150817991jan1720212021-01-011school_income2021436599jan1720212021-01-012use_and_occupancy202119395530jan1720212021-01-013liquor20211874302jan1720212021-01-014other_nontax20212000jan1720212021-01-01Monthly Wage Tax Collections by IndustryMonthly PDF reports are available on the City of Philadelphia's website according to calendar year (example:2020).Note:Cleaned CSV files are available in the following folder:src/phl_budget_data/data/processed/collections/by-sector/wage/Load the data using Python:fromphl_budget_data.cleanimportload_wage_collections_by_sectordata=load_wage_collections_by_sector()data.head()Output:sectorparent_sectortotalmonth_namemonthfiscal_monthyearfiscal_yeardate0UnclassifiedAccountsNaN494978.0jan17202120212021-01-011WholesaleTradeNaN4497890.0jan17202120212021-01-012Nursing&PersonalCareFacilitiesHealthandSocialServices3634459.0jan17202120212021-01-013OutpatientCareCentersandOtherHealthServicesHealthandSocialServices6267932.0jan17202120212021-01-014Doctors,Dentists,andOtherHealthPractitionersHealthandSocialServices5392573.0jan17202120212021-01-01Quarterly City Manager's ReportPDF reports are available on the City of Philadelphia's websitehere.Cash ReportLoad the data using Python:fromphl_budget_data.cleanimportload_qcmr_cash_reportsrevenue=load_qcmr_cash_reports(kind="revenue")revenue.head()Output:categoryfiscal_monthamountfiscal_yearquartermonth0RealEstateTax19.12021471Wage,Earnings,NetProfits1134.12021472RealtyTransferTax136.42021473SalesTax124.42021474BIRT1266.4202147Data can be load by specifyingkindas "revenue", "spending", "fund-balances", or "net-cash-flow".Adding the Latest DataThis section describes how to add the latest processed data files to the repository.QCMR Cash ReportsAdd the two-page PDF for the cash report to thesrc/phl_budget_data/data/raw/qcmr/cashfolderRun the following command to convert the PDF to a processed CSV:For example, for FY21 Q4:poetryshellphl-budget-etlqcmrcash--fiscal-year2021--quarter4Now, add the new CSV files to git, and push the changes to GitHub:From the root folder:gitadd.gitcommit-m"Add new QCMR cash report"gitpushoriginmain