diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-31 03:37:19 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-31 03:37:19 +0000 |
| commit | 07b38bb9573695d570964a16c79fe669169b0956 (patch) | |
| tree | 9177596f701c8a472e78a2e27549576ff0ac666d | |
| parent | b16ae854eafb97eea25d64694eb09d33684b3d10 (diff) | |
automatic import of python-cities
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-cities.spec | 194 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 196 insertions, 0 deletions
@@ -0,0 +1 @@ +/Cities-1.1.tar.gz diff --git a/python-cities.spec b/python-cities.spec new file mode 100644 index 0000000..26d66c2 --- /dev/null +++ b/python-cities.spec @@ -0,0 +1,194 @@ +%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 <Python_Bot@openeuler.org> - 1.1-1 +- Package Spec generated @@ -0,0 +1 @@ +11c657f8f2014c44d066ce96b30a3f49 Cities-1.1.tar.gz |
