Save the latest database of businesses in Los Angeles as CSV and KML.
This script downloads and processes the listing of all active businesses currently registered with the City of Los Angeles Office of Finance. An 'active' business is defined as a registered business whose owner has not notified the Office of Finance of a cease of business operations. Update Interval: Monthly.
This script fetches the data and saves it locally as a CSV file. It also selects a subset of businesses with operation starting date within the last NDAYS days (default 30) and saves this as a separate CSV file. Finally, it creates and saves a KML file from the subset, useful for importing into Google Maps or similar software to visualize the distribution of recent businesses opened in the Los Angeles area.
Install with pip. The package installs as a command-line script.
pip install la-businesses
Run from the command line (it installs as as script). All downloaded and
generated files will be stored in a directory
files inside the current
usage: la-businesses [-h] [-u] [-d NDAYS] optional arguments: -h, --help show this help message and exit -u, --update update data (default: False) -d NDAYS, --days NDAYS started since NDAYS days ago (default: 30)
Locations with missing coordinates are omitted from KML file
The script relies on coordinate data already provided in the downloaded dataset. Some businesses contain addresses but no coordinates; in these cases, the business is ignored when creating the KML (but is included in any saved CSV file). Future implementations should include a function to look up location coordinates from a given address (e.g., using the Open Street Maps API).
Locations with no DBA name simply show NaN in the KML file
The script could use better handling of business name / DBA combinations to omit NaN from KML when it does not have a business name.
No phone numbers
The data does not include any phone or email contact information; merging this dataset with one that includes contact information would be more useful for market research.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size la_businesses-0.1.1-py3-none-any.whl (14.4 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size la-businesses-0.1.1.tar.gz (7.4 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for la_businesses-0.1.1-py3-none-any.whl