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__/model.cpython-310.pyc
o

+we��@s�ddlZddlZddlZddlmZddlmZddlZddl	m
Z
ddlZddl
mZddlmZmZe
��ZGdd�dej�ZeGd	d
�d
eej��ZGdd�de�ZGd
d�de�ZGdd�de�ZdS)�N)�total_ordering)�Path�)�MAPPER_STATE_ABBR_SHORT_TO_LONG)�	haversine�Unitc@s eZdZdZdZdZdZdZdS)�ZipcodeTypeEnumz%
    zipcode type visitor class.
    �STANDARDzPO BOX�UNIQUE�MILITARYN)�__name__�
__module__�__qualname__�__doc__�Standard�PO_Box�Unique�Military�rr�H/home/arjun/projects/env/lib/python3.10/site-packages/uszipcode/model.pyrsrc@s�eZdZdZdZejejdd�Ze�ej�Z	e�ej�Z
e�ej�Ze�ej
j�Ze�ej�Ze�ej�Zejejdd�Zejejdd�Ze�ej�Ze�ej�Ze�ej
j�Ze�ej�Ze�ej�Ze�ej�Ze�ej�Ze�ej�Ze�ej�Ze�ej�Ze�ej�Z e�ej�Z!e�ej�Z"e�ej�Z#e�ej�Z$d�%d�Z&e'dd��Z(e'd	e)fd
d��Z*e'd	e+fdd
��Z,e'd	e+fdd��Z-dd�Z.d"dd�Z/d"dd�Z0dd�Z1e2j3fde4de4de2fdd�Z5d#de6fdd �Z7d!S)$�AbstractSimpleZipcodez!
    Base class for Zipcode.
    T)�primary_key)�indexz7zipcode,zipcode_type,city,county,state,lat,lng,timezone�,cCs|jS)z+
        Alias of ``.major_city``.
        )�
major_city��selfrrr�cityGszAbstractSimpleZipcode.city�returncCs|j|j|j|jd�S)z"
        Border boundary.
        )�west�east�north�south)�bounds_west�bounds_east�bounds_north�bounds_southrrrr�boundsNs
�zAbstractSimpleZipcode.boundscCs
|j��S)zH
        Return state abbreviation, two letters, all uppercase.
        )�state�upperrrrr�
state_abbrZs
z AbstractSimpleZipcode.state_abbrcCst�|j���S)z)
        Return state full name.
        )r�getr(r)rrrr�
state_longasz AbstractSimpleZipcode.state_longcCs
|jduS)z,
        For Python3 bool() method.
        N��zipcoderrrr�__bool__h�
zAbstractSimpleZipcode.__bool__�othercCs(|jdus
|jdurtd��|j|jkS)z0
        For ``>`` comparison operator.
        Nz2Empty Zipcode instance doesn't support comparison.)r.�
ValueError�rr1rrr�__lt__ns
�zAbstractSimpleZipcode.__lt__cCs|j|jkS)z1
        For ``==`` comparison operator.
        r-r3rrr�__eq__xszAbstractSimpleZipcode.__eq__cCs
t|j�S)z#
        For hash() method
        )�hashr.rrrr�__hash__~r0zAbstractSimpleZipcode.__hash__�lat�lng�unitcCst|j|jf||f|d�S)z�
        Calculate the distance of the center of this zipcode from a coordinator.

        :param lat: latitude.
        :param lng: longitude.
        )r:)rr8r9)rr8r9r:rrr�	dist_from�szAbstractSimpleZipcode.dist_from�include_nullcCs|j|d�}tj|dd�S)z"
        Convert to json.
        )r<�)�indent)�to_OrderedDict�json�dumps)rr<�datarrr�to_json�szAbstractSimpleZipcode.to_jsonN)r1r)T)8rr
rr�__abstract__�sa�Column�Stringr.�zipcode_typer�post_office_city�sam�types�CompressedJSONType�common_city_list�countyr(�Floatr8r9�timezone�radius_in_miles�area_code_list�Integer�
population�population_density�land_area_in_sqmi�water_area_in_sqmi�
housing_units�occupied_housing_units�median_home_value�median_household_incomer#r$r%r&�split�_settings_major_attrs�propertyr�dictr'�strr*r,r/r4r5r7r�MILES�floatr;�boolrCrrrrrsX�



	rc@s�eZdZdZe�ejj�Z	e�ejj�Z
e�ejj�Ze�ejj�Ze�ejj�Z
e�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Ze�ejj�Z e�ejj�Z!e�ejj�Z"e�ejj�Z#e�ejj�Z$e�ejj�Z%e�ejj�Z&e�ejj�Z'e�ejj�Z(e�ejj�Z)e�ejj�Z*dS)�AbstractComprehensiveZipcodeTN)+rr
rrDrErFrJrKrL�polygon�population_by_year�population_by_age�population_by_gender�population_by_race�head_of_household_by_age�families_vs_singles�households_with_kids�children_by_age�housing_type�year_housing_was_built�housing_occupancy�vacancy_reason�owner_occupied_home_values�$rental_properties_by_number_of_rooms�+monthly_rent_including_utilities_studio_apt�$monthly_rent_including_utilities_1_b�$monthly_rent_including_utilities_2_b�(monthly_rent_including_utilities_3plus_b�employment_status�"average_household_income_over_time�household_income�annual_individual_earnings�Esources_of_household_income____percent_of_households_receiving_income�Lsources_of_household_income____average_income_per_household_by_income_source�Phousehold_investment_income____percent_of_households_receiving_investment_income�Lhousehold_investment_income____average_income_per_household_by_income_source�Ohousehold_retirement_income____percent_of_households_receiving_retirement_incom�Lhousehold_retirement_income____average_income_per_household_by_income_source�source_of_earnings�7means_of_transportation_to_work_for_workers_16_and_over�travel_time_to_work_in_minutes�1educational_attainment_for_population_25_and_over�school_enrollment_age_3_to_17rrrrrd�sh��������rdc@�eZdZdZdS)�
SimpleZipcode�simple_zipcodeN�rr
r�
__tablename__rrrrr���r�c@r�)�ComprehensiveZipcode�comprehensive_zipcodeNr�rrrrr��r�r�)r@�enum�typing�	functoolsr�pathlib_mater�
sqlalchemyrE�sqlalchemy.orm�orm�sqlalchemy_materJr*rrr�declarative_base�Base�Enumr�ExtendedBaserrdr�r�rrrr�<module>s"
w<