%global _empty_manifest_terminate_build 0 Name: python-Cities Version: 1.1 Release: 1 Summary: Cities is a simple tool for searching cities located at a given longitude and latitude range. License: MIT URL: https://github.com/131250208/Cities Source0: https://mirrors.nju.edu.cn/pypi/web/packages/dd/1a/ba1b720771c22ea6f20023c5e244978d5c1d8b832fab3005a490350a39b5/Cities-1.1.tar.gz BuildArch: noarch Requires: python3-pyprind Requires: python3-numpy %description Cities is a simple tool for searching cities located at a given longitude and latitude range or a given region(country, state, province). All the cities returned are sorted by the importance of a city and the population density. # Install ```commandline pip install Cities ``` # Features 1. fast(less than 0.01s for each retrieving), simple and convenient. 2. cover all the cities around the world. 3. the author is cute. # Required File Download the [city data](https://pan.baidu.com/s/10qjtq9jl7tLxXeypfJCrEg) and put it at any directory you want. Remember to set the path up when you initiate an instance. # Example ```python from Cities import cities_retriever cr = cities_retriever.CitiesRetrieverByRect("Sources/dict_all_cities_rect2cities.json") cities = cr.retrieve_cities(lon_start=-124.71, lon_end=-77.21, lat_start=25.24, lat_end=44.75, num=500) # num is optional, default: 999999 print(cities) print(len(cities)) cr = cities_retriever.CitiesRetrieverByRegionName("Sources/dict_all_cities_region2cities.json") cities = cr.retrieve_cities(country="United States", region="Washington", num=500) # region and num are optional print(cities) print(len(cities)) ``` # Note the bigger the dict file is, the longer the loading time is. ## 4million cities --- 12s 1. dict_all_cities_region2cities.json 2. dict_all_cities_rect2cities.json ## 8000 cities --- < 1s 1. dict_cities_8000_region2cities.json 2. dict_cities_8000_rect2cities.json %package -n python3-Cities Summary: Cities is a simple tool for searching cities located at a given longitude and latitude range. Provides: python-Cities BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-Cities Cities is a simple tool for searching cities located at a given longitude and latitude range or a given region(country, state, province). All the cities returned are sorted by the importance of a city and the population density. # Install ```commandline pip install Cities ``` # Features 1. fast(less than 0.01s for each retrieving), simple and convenient. 2. cover all the cities around the world. 3. the author is cute. # Required File Download the [city data](https://pan.baidu.com/s/10qjtq9jl7tLxXeypfJCrEg) and put it at any directory you want. Remember to set the path up when you initiate an instance. # Example ```python from Cities import cities_retriever cr = cities_retriever.CitiesRetrieverByRect("Sources/dict_all_cities_rect2cities.json") cities = cr.retrieve_cities(lon_start=-124.71, lon_end=-77.21, lat_start=25.24, lat_end=44.75, num=500) # num is optional, default: 999999 print(cities) print(len(cities)) cr = cities_retriever.CitiesRetrieverByRegionName("Sources/dict_all_cities_region2cities.json") cities = cr.retrieve_cities(country="United States", region="Washington", num=500) # region and num are optional print(cities) print(len(cities)) ``` # Note the bigger the dict file is, the longer the loading time is. ## 4million cities --- 12s 1. dict_all_cities_region2cities.json 2. dict_all_cities_rect2cities.json ## 8000 cities --- < 1s 1. dict_cities_8000_region2cities.json 2. dict_cities_8000_rect2cities.json %package help Summary: Development documents and examples for Cities Provides: python3-Cities-doc %description help Cities is a simple tool for searching cities located at a given longitude and latitude range or a given region(country, state, province). All the cities returned are sorted by the importance of a city and the population density. # Install ```commandline pip install Cities ``` # Features 1. fast(less than 0.01s for each retrieving), simple and convenient. 2. cover all the cities around the world. 3. the author is cute. # Required File Download the [city data](https://pan.baidu.com/s/10qjtq9jl7tLxXeypfJCrEg) and put it at any directory you want. Remember to set the path up when you initiate an instance. # Example ```python from Cities import cities_retriever cr = cities_retriever.CitiesRetrieverByRect("Sources/dict_all_cities_rect2cities.json") cities = cr.retrieve_cities(lon_start=-124.71, lon_end=-77.21, lat_start=25.24, lat_end=44.75, num=500) # num is optional, default: 999999 print(cities) print(len(cities)) cr = cities_retriever.CitiesRetrieverByRegionName("Sources/dict_all_cities_region2cities.json") cities = cr.retrieve_cities(country="United States", region="Washington", num=500) # region and num are optional print(cities) print(len(cities)) ``` # Note the bigger the dict file is, the longer the loading time is. ## 4million cities --- 12s 1. dict_all_cities_region2cities.json 2. dict_all_cities_rect2cities.json ## 8000 cities --- < 1s 1. dict_cities_8000_region2cities.json 2. dict_cities_8000_rect2cities.json %prep %autosetup -n Cities-1.1 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-Cities -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Wed May 31 2023 Python_Bot - 1.1-1 - Package Spec generated