Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding #2888 mpo krakow pl #3393

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dawidborek
Copy link

Added support for MPO Kraków in Poland https://harmonogram.mpo.krakow.pl/ .
The provider API returns schedule data only in IMG and PDF formats; therefore, PyPDF2 has been added to the requirements.txt .

new file:   custom_components/waste_collection_schedule/waste_collection_schedule/source/mpo_krakow_pl.py
new file:   doc/source/mpo_krakow_pl.md
modified:   requirements.txt
modified:   custom_components/waste_collection_schedule/sources.json
modified:   custom_components/waste_collection_schedule/translations/de.json
modified:   custom_components/waste_collection_schedule/translations/en.json
modified:   custom_components/waste_collection_schedule/translations/it.json
modified:   info.md
modified:   README.md

test_sources.py output

Testing source mpo_krakow_pl ...
found 102 entries for Romanowicza 1 DM
found 13 entries for Na Wrzosach 43 DJ
found 14 entries for Świtezianki 7 DB
found 28 entries for Przewóz 40d DW

pytest output:

============================= test session starts ==============================
platform darwin -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0
rootdir: /Users/dawidborek/Documents/project/hacs_waste_collection_schedule
configfile: pytest.ini
collected 6 items

tests/test_source_components.py ...... [100%]

============================== 6 passed in 0.72s ===============================

…rce mpo_krakow_pl

	new file:   custom_components/waste_collection_schedule/waste_collection_schedule/source/mpo_krakow_pl.py
	new file:   doc/source/mpo_krakow_pl.md
	modified:   requirements.txt
@5ila5
Copy link
Collaborator

5ila5 commented Jan 6, 2025

The requirements.txt is just for development corpuses the dependencies resolved by HA are located in manifest.json
We generally avoided PDF parsing and had some problems of adding dependencies in the past. But it looks like PyPDF does not contain any other dependencies and is written in pure python so I guess it's fine.

Any reason you used PyPDF2 (latest update Dec 31, 2022) and not PyPDF?

https://pypi.org/project/PyPDF2/

NOTE: The PyPDF2 project is going back to its roots. PyPDF2==3.0.X will be the last version of PyPDF2. Development will continue with pypdf==3.1.0.

@dawidborek
Copy link
Author

I used PyPDF2 out of habit from previous project, as it has served well in the past. However, for the updated version, I’ve switched to PyPDF to ensure compatibility with the latest features and improvements.

@dawidborek dawidborek marked this pull request as draft January 7, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants