HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/uszipcode/__pycache__/db.cpython-310.pyc
o

+weB�@s�dZddlZddlmZddlmZddlmZddlZ	dZ
dZee��d�Z
ee
d	�Zee
d
�Zdeded
edefdd�ZdS)av
The dataset for ``uszipcode`` is from multiple source, and integrated by Sanhe Hu.

- 2012-01-22 federal governmanet zipcode data from
  http://federalgovernmentzipcodes.us/
- 2010 zcta2010 population, wage, houseunit, land, water area data from
  from http://proximityone.com/cen2010_zcta_dp.htm
- 2015-10-01 geometry google map geocoding data from http://maps.google.com
�N)�Path)�repr_data_size)�atomic_writezZhttps://github.com/MacHu-GWU/uszipcode-project/releases/download/1.0.1.db/simple_db.sqlitezahttps://github.com/MacHu-GWU/uszipcode-project/releases/download/1.0.1.db/comprehensive_db.sqlitez
.uszipcodezsimple_db.sqlitezcomprehensive_db.sqlite�db_file_path�download_url�
chunk_size�
progress_sizec	Cs�t|�jjddd�td|�d|�d��tj|dd�}d}|}t|ddd	��.}|�|�D] }|s3n|�|�||7}||krMtd
�	t
|���||7}q-Wd�n1sXwYtd�dS)NT)�parents�exist_okz	Download z from z ...)�streamr�wb)�mode�	overwritez  {} downloaded ...z  Complete!)r�parent�mkdir�print�requests�getr�iter_content�write�formatr)	rrrr�response�downloaded_size�next_log_threshold�f�chunk�r�E/home/arjun/projects/env/lib/python3.10/site-packages/uszipcode/db.py�download_db_files"
��	r)�__doc__r�pathlib_mater�pathlib_mate.helperr�atomicwritesr�sqlalchemy_mate�sam�SIMPLE_DB_FILE_DOWNLOAD_URL�"COMPREHENSIVE_DB_FILE_DOWNLOAD_URL�home�USZIPCODE_HOME�DEFAULT_SIMPLE_DB_FILE_PATH�"DEFAULT_COMPREHENSIVE_DB_FILE_PATH�str�intrrrrr�<module>s(


����