PHL Budget Data
Project description
Installation
To get the latest version of the code, clone the repository, and use poetry install
to install the dependencies.
You can also install the package into a conda environment using the following command
conda activate py38
pip install .
This will install the package into the py38
environment.
Examples
The subsections below list examples for loading various kinds of budget-related data sets for the City of Philadelphia.
Revenue Reports
Data is available from the City of Philadelphia's Revenue reports, as published to the City's website.
City Collections
Monthly 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:
from phl_budget_data.clean import load_city_collections
data = load_city_collections()
data.head()
Output:
name fiscal_year total month_name month fiscal_month year date kind
0 sales 2021 14228731.0 jan 1 7 2021 2021-01-01 Tax
1 wage_earnings_net_profits 2021 182689530.0 jan 1 7 2021 2021-01-01 Tax
2 soda 2021 5149478.0 jan 1 7 2021 2021-01-01 Tax
3 outdoor_ads 2021 179166.0 jan 1 7 2021 2021-01-01 Tax
4 real_estate_transfer 2021 27222198.0 jan 1 7 2021 2021-01-01 Tax
School District Collections
Monthly 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:
from phl_budget_data.clean import load_school_collections
data = load_school_collections()
data.head()
Output:
name fiscal_year total month_name month fiscal_month year date
0 real_estate 2021 50817991 jan 1 7 2021 2021-01-01
1 school_income 2021 436599 jan 1 7 2021 2021-01-01
2 use_and_occupancy 2021 19395530 jan 1 7 2021 2021-01-01
3 liquor 2021 1874302 jan 1 7 2021 2021-01-01
4 other_nontax 2021 2000 jan 1 7 2021 2021-01-01
Monthly Wage Tax Collections by Industry
Monthly 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:
from phl_budget_data.clean import load_wage_collections_by_sector
data = load_wage_collections_by_sector()
data.head()
Output:
sector parent_sector total month_name month fiscal_month year fiscal_year date
0 Unclassified Accounts NaN 494978.0 jan 1 7 2021 2021 2021-01-01
1 Wholesale Trade NaN 4497890.0 jan 1 7 2021 2021 2021-01-01
2 Nursing & Personal Care Facilities Health and Social Services 3634459.0 jan 1 7 2021 2021 2021-01-01
3 Outpatient Care Centers and Other Health Services Health and Social Services 6267932.0 jan 1 7 2021 2021 2021-01-01
4 Doctors, Dentists, and Other Health Practitioners Health and Social Services 5392573.0 jan 1 7 2021 2021 2021-01-01
Quarterly City Manager's Report
PDF reports are available on the City of Philadelphia's website here.
Cash Report
Load the data using Python:
from phl_budget_data.clean import load_qcmr_cash_reports
revenue = load_qcmr_cash_reports(kind="revenue")
revenue.head()
Output:
category fiscal_month amount fiscal_year quarter month
0 Real Estate Tax 1 9.1 2021 4 7
1 Wage, Earnings, Net Profits 1 134.1 2021 4 7
2 Realty Transfer Tax 1 36.4 2021 4 7
3 Sales Tax 1 24.4 2021 4 7
4 BIRT 1 266.4 2021 4 7
Data can be load by specifying kind
as "revenue", "spending", "fund-balances", or "net-cash-flow".
Adding the Latest Data
This section describes how to add the latest processed data files to the repository.
QCMR Cash Reports
- Add the two-page PDF for the cash report to the
src/phl_budget_data/data/raw/qcmr/cash
folder - Run the following command to convert the PDF to a processed CSV:
For example, for FY21 Q4:
poetry shell
phl-budget-etl qcmr cash --fiscal-year 2021 --quarter 4
- Now, add the new CSV files to git, and push the changes to GitHub:
From the root folder:
git add .
git commit -m "Add new QCMR cash report"
git push origin main
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file phl-budget-data-0.2.1.tar.gz
.
File metadata
- Download URL: phl-budget-data-0.2.1.tar.gz
- Upload date:
- Size: 566.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.7 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79a2e9c93206b48d7d5251b337446f1bb5688756d3ebcf7d981764c809a912bc |
|
MD5 | f059ae7e4ccc4b7f0b05e35530a8455d |
|
BLAKE2b-256 | fd16adf0696149dc09fdcbbce6412c2f2b361e59f570f017e305f9612fc32fcf |
File details
Details for the file phl_budget_data-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: phl_budget_data-0.2.1-py3-none-any.whl
- Upload date:
- Size: 600.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.7 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 545dd03974da42935620d5386e6ed31b4fe384ed359aad8d4494b13648fed34e |
|
MD5 | 3912f49b22954c165d05bdfb4f326c8d |
|
BLAKE2b-256 | a5ebf15d713830a1ef5fb1f82fc8369d82b560411aaf990399ed5c5a83efd997 |