summaryrefslogtreecommitdiff
path: root/python-safegraphql.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-safegraphql.spec')
-rw-r--r--python-safegraphql.spec235
1 files changed, 235 insertions, 0 deletions
diff --git a/python-safegraphql.spec b/python-safegraphql.spec
new file mode 100644
index 0000000..dc98315
--- /dev/null
+++ b/python-safegraphql.spec
@@ -0,0 +1,235 @@
+%global _empty_manifest_terminate_build 0
+Name: python-safegraphQL
+Version: 0.5.23
+Release: 1
+Summary: graphQL API of safegraph.com using Python functions
+License: MIT
+URL: https://github.com/echong-SG/API-python-client-MKilic
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/5f/6e/08367fd2134ce163d2cbbf8320e19ea394cbffa077ea12c2b3ad13697c8c/safegraphQL-0.5.23.tar.gz
+BuildArch: noarch
+
+Requires: python3-pandas
+Requires: python3-gql
+Requires: python3-aiohttp
+Requires: python3-nest-asyncio
+
+%description
+[{'placekey': 'zzw-222@8fy-fjg-b8v',
+ 'parent_placekey': None,
+ 'location_name': 'Walt Disney World Resort',
+ 'safegraph_brand_ids': [],
+ 'brands': [],
+ 'top_category': 'Amusement Parks and Arcades',
+ 'sub_category': 'Amusement and Theme Parks',
+ 'naics_code': 713110,
+ 'latitude': 28.388228,
+ 'longitude': -81.567304,
+ 'street_address': 'Walt Disney World Resort',
+ 'city': 'Orlando',
+ 'region': 'FL',
+ 'postal_code': '32830',
+ 'iso_country_code': 'US',
+ 'phone_number': None,
+ 'open_hours': '{ "Mon": [["8:00", "23:00"]], "Tue": [["8:00", "23:00"]], "Wed": [["8:00", "23:00"]], "Thu": [["8:00", "23:00"]], "Fri": [["8:00", "23:00"]], "Sat": [["8:00", "23:00"]], "Sun": [["8:00", "23:00"]] }',
+ 'category_tags': [],
+ 'opened_on': None,
+ 'closed_on': None,
+ 'tracking_closed_since': '2019-07-01',
+ 'geometry_type': 'POLYGON'}]
+```
+### `save()`
+Export the most recently queried result. If the previous result had been a pandas DataFrame, the saved file will be a .csv. If the result had been the JSON response object, the saved file will be a .json. The default path for the exported file will be `results.{csv/json}`.
+```python
+# saved file will be results.csv
+sgql_client.lookup(product = 'core', placekeys = pk, columns = '*')
+sgql_client.save()
+# saved file will be results.json
+sgql_client.lookup(product = 'core', placekeys = pk, columns = '*', return_type = 'list')
+sgql_client.save()
+# saved file will be safegraph_data.csv
+sgql_client.lookup(product = 'core', placekeys = pk, columns = '*')
+sgql_client.save(path = 'safegraph_data.csv')
+```
+## `sg_merge()`
+Merge safegraphQL query results with `sg_merge()`.
+```python
+core = sgql_client.lookup(product = 'core', placekeys = pks, columns = ['placekey', 'location_name', 'naics_code', 'top_category', 'sub_category'])
+geo = sgql_client.lookup(product = 'geometry', placekeys = pks, columns = ['placekey', 'polygon_class', 'enclosed'])
+merge_set = [core, geo]
+merged = sgql_client.sg_merge(datasets = merge_set)
+```
+| | placekey | location_name | top_category | sub_category | naics_code | polygon_class | enclosed |
+|---:|:--------------------|:----------------------------------|:------------------------------------------|:--------------------------|-------------:|:----------------|:-----------|
+| 0 | zzw-222@5z6-3h9-tsq | Los Angeles International Airport | Support Activities for Air Transportation | Other Airport Operations | 488119 | OWNED_POLYGON | False |
+| 1 | zzw-222@8fy-fjg-b8v | Walt Disney World Resort | Amusement Parks and Arcades | Amusement and Theme Parks | 713110 | OWNED_POLYGON | False |
+!! ADD SECTION ON INNER JOIN HERE ONCE ISSUE FOR NO LONGER SHOWING NULL PATTERNS ROWS HAS BEEN RESOLVED !!
+`sg_merge()` works for JSON response objects as well.
+```python
+core = sgql_client.lookup(product = 'core', placekeys = pks, columns = ['placekey', 'location_name', 'naics_code', 'top_category', 'sub_category'], return_type = 'list')
+geo = sgql_client.lookup(product = 'geometry', placekeys = pks, columns = ['placekey', 'polygon_class', 'enclosed'], return_type = 'list')
+merge_set = [core, geo]
+
+%package -n python3-safegraphQL
+Summary: graphQL API of safegraph.com using Python functions
+Provides: python-safegraphQL
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-safegraphQL
+[{'placekey': 'zzw-222@8fy-fjg-b8v',
+ 'parent_placekey': None,
+ 'location_name': 'Walt Disney World Resort',
+ 'safegraph_brand_ids': [],
+ 'brands': [],
+ 'top_category': 'Amusement Parks and Arcades',
+ 'sub_category': 'Amusement and Theme Parks',
+ 'naics_code': 713110,
+ 'latitude': 28.388228,
+ 'longitude': -81.567304,
+ 'street_address': 'Walt Disney World Resort',
+ 'city': 'Orlando',
+ 'region': 'FL',
+ 'postal_code': '32830',
+ 'iso_country_code': 'US',
+ 'phone_number': None,
+ 'open_hours': '{ "Mon": [["8:00", "23:00"]], "Tue": [["8:00", "23:00"]], "Wed": [["8:00", "23:00"]], "Thu": [["8:00", "23:00"]], "Fri": [["8:00", "23:00"]], "Sat": [["8:00", "23:00"]], "Sun": [["8:00", "23:00"]] }',
+ 'category_tags': [],
+ 'opened_on': None,
+ 'closed_on': None,
+ 'tracking_closed_since': '2019-07-01',
+ 'geometry_type': 'POLYGON'}]
+```
+### `save()`
+Export the most recently queried result. If the previous result had been a pandas DataFrame, the saved file will be a .csv. If the result had been the JSON response object, the saved file will be a .json. The default path for the exported file will be `results.{csv/json}`.
+```python
+# saved file will be results.csv
+sgql_client.lookup(product = 'core', placekeys = pk, columns = '*')
+sgql_client.save()
+# saved file will be results.json
+sgql_client.lookup(product = 'core', placekeys = pk, columns = '*', return_type = 'list')
+sgql_client.save()
+# saved file will be safegraph_data.csv
+sgql_client.lookup(product = 'core', placekeys = pk, columns = '*')
+sgql_client.save(path = 'safegraph_data.csv')
+```
+## `sg_merge()`
+Merge safegraphQL query results with `sg_merge()`.
+```python
+core = sgql_client.lookup(product = 'core', placekeys = pks, columns = ['placekey', 'location_name', 'naics_code', 'top_category', 'sub_category'])
+geo = sgql_client.lookup(product = 'geometry', placekeys = pks, columns = ['placekey', 'polygon_class', 'enclosed'])
+merge_set = [core, geo]
+merged = sgql_client.sg_merge(datasets = merge_set)
+```
+| | placekey | location_name | top_category | sub_category | naics_code | polygon_class | enclosed |
+|---:|:--------------------|:----------------------------------|:------------------------------------------|:--------------------------|-------------:|:----------------|:-----------|
+| 0 | zzw-222@5z6-3h9-tsq | Los Angeles International Airport | Support Activities for Air Transportation | Other Airport Operations | 488119 | OWNED_POLYGON | False |
+| 1 | zzw-222@8fy-fjg-b8v | Walt Disney World Resort | Amusement Parks and Arcades | Amusement and Theme Parks | 713110 | OWNED_POLYGON | False |
+!! ADD SECTION ON INNER JOIN HERE ONCE ISSUE FOR NO LONGER SHOWING NULL PATTERNS ROWS HAS BEEN RESOLVED !!
+`sg_merge()` works for JSON response objects as well.
+```python
+core = sgql_client.lookup(product = 'core', placekeys = pks, columns = ['placekey', 'location_name', 'naics_code', 'top_category', 'sub_category'], return_type = 'list')
+geo = sgql_client.lookup(product = 'geometry', placekeys = pks, columns = ['placekey', 'polygon_class', 'enclosed'], return_type = 'list')
+merge_set = [core, geo]
+
+%package help
+Summary: Development documents and examples for safegraphQL
+Provides: python3-safegraphQL-doc
+%description help
+[{'placekey': 'zzw-222@8fy-fjg-b8v',
+ 'parent_placekey': None,
+ 'location_name': 'Walt Disney World Resort',
+ 'safegraph_brand_ids': [],
+ 'brands': [],
+ 'top_category': 'Amusement Parks and Arcades',
+ 'sub_category': 'Amusement and Theme Parks',
+ 'naics_code': 713110,
+ 'latitude': 28.388228,
+ 'longitude': -81.567304,
+ 'street_address': 'Walt Disney World Resort',
+ 'city': 'Orlando',
+ 'region': 'FL',
+ 'postal_code': '32830',
+ 'iso_country_code': 'US',
+ 'phone_number': None,
+ 'open_hours': '{ "Mon": [["8:00", "23:00"]], "Tue": [["8:00", "23:00"]], "Wed": [["8:00", "23:00"]], "Thu": [["8:00", "23:00"]], "Fri": [["8:00", "23:00"]], "Sat": [["8:00", "23:00"]], "Sun": [["8:00", "23:00"]] }',
+ 'category_tags': [],
+ 'opened_on': None,
+ 'closed_on': None,
+ 'tracking_closed_since': '2019-07-01',
+ 'geometry_type': 'POLYGON'}]
+```
+### `save()`
+Export the most recently queried result. If the previous result had been a pandas DataFrame, the saved file will be a .csv. If the result had been the JSON response object, the saved file will be a .json. The default path for the exported file will be `results.{csv/json}`.
+```python
+# saved file will be results.csv
+sgql_client.lookup(product = 'core', placekeys = pk, columns = '*')
+sgql_client.save()
+# saved file will be results.json
+sgql_client.lookup(product = 'core', placekeys = pk, columns = '*', return_type = 'list')
+sgql_client.save()
+# saved file will be safegraph_data.csv
+sgql_client.lookup(product = 'core', placekeys = pk, columns = '*')
+sgql_client.save(path = 'safegraph_data.csv')
+```
+## `sg_merge()`
+Merge safegraphQL query results with `sg_merge()`.
+```python
+core = sgql_client.lookup(product = 'core', placekeys = pks, columns = ['placekey', 'location_name', 'naics_code', 'top_category', 'sub_category'])
+geo = sgql_client.lookup(product = 'geometry', placekeys = pks, columns = ['placekey', 'polygon_class', 'enclosed'])
+merge_set = [core, geo]
+merged = sgql_client.sg_merge(datasets = merge_set)
+```
+| | placekey | location_name | top_category | sub_category | naics_code | polygon_class | enclosed |
+|---:|:--------------------|:----------------------------------|:------------------------------------------|:--------------------------|-------------:|:----------------|:-----------|
+| 0 | zzw-222@5z6-3h9-tsq | Los Angeles International Airport | Support Activities for Air Transportation | Other Airport Operations | 488119 | OWNED_POLYGON | False |
+| 1 | zzw-222@8fy-fjg-b8v | Walt Disney World Resort | Amusement Parks and Arcades | Amusement and Theme Parks | 713110 | OWNED_POLYGON | False |
+!! ADD SECTION ON INNER JOIN HERE ONCE ISSUE FOR NO LONGER SHOWING NULL PATTERNS ROWS HAS BEEN RESOLVED !!
+`sg_merge()` works for JSON response objects as well.
+```python
+core = sgql_client.lookup(product = 'core', placekeys = pks, columns = ['placekey', 'location_name', 'naics_code', 'top_category', 'sub_category'], return_type = 'list')
+geo = sgql_client.lookup(product = 'geometry', placekeys = pks, columns = ['placekey', 'polygon_class', 'enclosed'], return_type = 'list')
+merge_set = [core, geo]
+
+%prep
+%autosetup -n safegraphQL-0.5.23
+
+%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-safegraphQL -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 0.5.23-1
+- Package Spec generated