From 5166cdb2608cd6836b68122d3372e3a77143d17b Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 9 Mar 2023 07:25:17 +0000 Subject: automatic import of python-enturclient --- .gitignore | 1 + python-enturclient.spec | 251 ++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 253 insertions(+) create mode 100644 python-enturclient.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..79a2aae 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/enturclient-0.2.4.tar.gz diff --git a/python-enturclient.spec b/python-enturclient.spec new file mode 100644 index 0000000..b95b0c3 --- /dev/null +++ b/python-enturclient.spec @@ -0,0 +1,251 @@ +%global _empty_manifest_terminate_build 0 +Name: python-enturclient +Version: 0.2.4 +Release: 1 +Summary: An API client for public transport data from Entur. +License: MIT +URL: https://github.com/hfurubotten/enturclient +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0a/a0/66dfd159a753f8ce845974dbe8998a33844f5b0a6d1790aa3d296df3ac6e/enturclient-0.2.4.tar.gz +BuildArch: noarch + +Requires: python3-aiohttp +Requires: python3-async_timeout + +%description +# Entur API client + +Python client for fetching estimated departures from stop places in Norway from [`entur.org`](https://developer.entur.org) API. Information about stop places, platforms and real-time departures. + +[![PyPI version fury.io][pypi-version-badge]][pypi-enturclient] +[![PyPI pyversions][py-versions-badge]][pypi-enturclient] + +[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee] + +## Usage + +```python +import aiohttp +import asyncio +from enturclient import EnturPublicTransportData + +API_CLIENT_ID = 'awesome_company - my_application' + +async def print_bergen_train_delay(): + async with aiohttp.ClientSession() as client: + stops = ['NSR:StopPlace:548'] + quays = ['NSR:Quay:48550'] + + data = EnturPublicTransportData( + client_name=API_CLIENT_ID, # Required + stops=stops, + quays=quays, + omit_non_boarding=True, + number_of_departures=5, + web_session=client) # recommended argument + + await data.update() + + bergen_train = data.get_stop_info('NSR:StopPlace:548') + bergen_train_delay = bergen_train.estimated_calls[0].delay_in_min + + print(bergen_train_delay) + +asyncio.run(print_bergen_train_delay()) +``` + +## Obtaining a stop id + +[Entur's travel planer](https://en-tur.no) has a map of all stops used in Norway. Use the map to find the stops you're interested in. When you have found one of your stops, click on it, and hit "Se alle avganger". + +Now the web browser should contain an URL with the id in it. Such as this: +`https://en-tur.no/nearby-stop-place-detail?id=NSR:StopPlace:32376` + +The stop id is the content after `id=` parameter in the url. Copy paste this into the configuration. + +It's also possible to use the [National Stop Register (NSR)](https://stoppested.entur.org). +Find your stop in the map, click on it and then again at the name. You have to zoom quite a bit in before the stops shows in the map. Information about the stop place, including the stop and quay ids will pop up on the side. + +[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg +[buymeacoffee]: https://www.buymeacoffee.com/heine +[pypi-enturclient]: https://pypi.org/project/enturclient/ +[pypi-version-badge]: https://badge.fury.io/py/enturclient.svg +[py-versions-badge]: https://img.shields.io/pypi/pyversions/enturclient.svg + + + +%package -n python3-enturclient +Summary: An API client for public transport data from Entur. +Provides: python-enturclient +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-enturclient +# Entur API client + +Python client for fetching estimated departures from stop places in Norway from [`entur.org`](https://developer.entur.org) API. Information about stop places, platforms and real-time departures. + +[![PyPI version fury.io][pypi-version-badge]][pypi-enturclient] +[![PyPI pyversions][py-versions-badge]][pypi-enturclient] + +[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee] + +## Usage + +```python +import aiohttp +import asyncio +from enturclient import EnturPublicTransportData + +API_CLIENT_ID = 'awesome_company - my_application' + +async def print_bergen_train_delay(): + async with aiohttp.ClientSession() as client: + stops = ['NSR:StopPlace:548'] + quays = ['NSR:Quay:48550'] + + data = EnturPublicTransportData( + client_name=API_CLIENT_ID, # Required + stops=stops, + quays=quays, + omit_non_boarding=True, + number_of_departures=5, + web_session=client) # recommended argument + + await data.update() + + bergen_train = data.get_stop_info('NSR:StopPlace:548') + bergen_train_delay = bergen_train.estimated_calls[0].delay_in_min + + print(bergen_train_delay) + +asyncio.run(print_bergen_train_delay()) +``` + +## Obtaining a stop id + +[Entur's travel planer](https://en-tur.no) has a map of all stops used in Norway. Use the map to find the stops you're interested in. When you have found one of your stops, click on it, and hit "Se alle avganger". + +Now the web browser should contain an URL with the id in it. Such as this: +`https://en-tur.no/nearby-stop-place-detail?id=NSR:StopPlace:32376` + +The stop id is the content after `id=` parameter in the url. Copy paste this into the configuration. + +It's also possible to use the [National Stop Register (NSR)](https://stoppested.entur.org). +Find your stop in the map, click on it and then again at the name. You have to zoom quite a bit in before the stops shows in the map. Information about the stop place, including the stop and quay ids will pop up on the side. + +[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg +[buymeacoffee]: https://www.buymeacoffee.com/heine +[pypi-enturclient]: https://pypi.org/project/enturclient/ +[pypi-version-badge]: https://badge.fury.io/py/enturclient.svg +[py-versions-badge]: https://img.shields.io/pypi/pyversions/enturclient.svg + + + +%package help +Summary: Development documents and examples for enturclient +Provides: python3-enturclient-doc +%description help +# Entur API client + +Python client for fetching estimated departures from stop places in Norway from [`entur.org`](https://developer.entur.org) API. Information about stop places, platforms and real-time departures. + +[![PyPI version fury.io][pypi-version-badge]][pypi-enturclient] +[![PyPI pyversions][py-versions-badge]][pypi-enturclient] + +[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee] + +## Usage + +```python +import aiohttp +import asyncio +from enturclient import EnturPublicTransportData + +API_CLIENT_ID = 'awesome_company - my_application' + +async def print_bergen_train_delay(): + async with aiohttp.ClientSession() as client: + stops = ['NSR:StopPlace:548'] + quays = ['NSR:Quay:48550'] + + data = EnturPublicTransportData( + client_name=API_CLIENT_ID, # Required + stops=stops, + quays=quays, + omit_non_boarding=True, + number_of_departures=5, + web_session=client) # recommended argument + + await data.update() + + bergen_train = data.get_stop_info('NSR:StopPlace:548') + bergen_train_delay = bergen_train.estimated_calls[0].delay_in_min + + print(bergen_train_delay) + +asyncio.run(print_bergen_train_delay()) +``` + +## Obtaining a stop id + +[Entur's travel planer](https://en-tur.no) has a map of all stops used in Norway. Use the map to find the stops you're interested in. When you have found one of your stops, click on it, and hit "Se alle avganger". + +Now the web browser should contain an URL with the id in it. Such as this: +`https://en-tur.no/nearby-stop-place-detail?id=NSR:StopPlace:32376` + +The stop id is the content after `id=` parameter in the url. Copy paste this into the configuration. + +It's also possible to use the [National Stop Register (NSR)](https://stoppested.entur.org). +Find your stop in the map, click on it and then again at the name. You have to zoom quite a bit in before the stops shows in the map. Information about the stop place, including the stop and quay ids will pop up on the side. + +[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg +[buymeacoffee]: https://www.buymeacoffee.com/heine +[pypi-enturclient]: https://pypi.org/project/enturclient/ +[pypi-version-badge]: https://badge.fury.io/py/enturclient.svg +[py-versions-badge]: https://img.shields.io/pypi/pyversions/enturclient.svg + + + +%prep +%autosetup -n enturclient-0.2.4 + +%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-enturclient -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Thu Mar 09 2023 Python_Bot - 0.2.4-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..f0ccc63 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +ae20d604383efb3442df38ee4182ab1e enturclient-0.2.4.tar.gz -- cgit v1.2.3