Update to 1.3.0 to work in 2025 #4
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and updates to the
brawlpylibrary, focusing on improving usability, code readability, and functionality. The most significant changes include the addition of an asynchronous context manager for theClientclass, refactoring of code for consistency and clarity, and updates to theREADME.mddocumentation.Enhancements to
Clientfunctionality:__aenter__and__aexit__) to theClientclass, allowing the use ofasync withfor managing the client session lifecycle. ([brawlpy/main.pyL4-R66](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L4-R66))requestmethod in theClientclass to handle session initialization errors and improve error handling. ([brawlpy/main.pyL4-R66](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L4-R66))Clientmethods (get_player,get_club,brawlers,events, etc.) to use consistent string formatting and improved object creation for better readability. ([[1]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L40-R142),[[2]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L113-R206),[[3]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L143-R246),[[4]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L179-R284),[[5]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L211-R334),[[6]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L249-R377))Documentation updates:
README.mdto reflect the addition of the context manager for theClientclass and corrected the installation command to point to the new repository URL. ([[1]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L12-R16),[[2]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L25-R25),[[3]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R37),[[4]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R55))Codebase cleanup and consistency:
[[1]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-e5556f1147ae675e7061baebb2e7cddb9cc1d9006f03a765720373d6c3a2ab39L1-R3),[[2]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-2bf9fd80d007a3cb5d23139ad5bc9470436f2600e5389ca46ad74ac8cb11a833R20-R85),[[3]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L40-R142))brawlpy/__init__.pyandbrawlpy/main.pyto explicitly list imported classes and objects, improving clarity and reducing wildcard imports. ([[1]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-d41c6849699852c678513a728c4873b8775605d8bdc527a3023671d786dad7fcL11-R47),[[2]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L4-R66))brawlpy/errors.pyand other files. ([[1]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-2bf9fd80d007a3cb5d23139ad5bc9470436f2600e5389ca46ad74ac8cb11a833R10),[[2]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L4-R66))Bug fixes and minor improvements:
brawlpy/icons.pyto adhere to JSON formatting standards. ([brawlpy/icons.pyL55-R55](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-fa51c3a021755e8ac61ec64529779176eb6aeb90b07ba5e2457167d09d129362L55-R55))[[1]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-2bf9fd80d007a3cb5d23139ad5bc9470436f2600e5389ca46ad74ac8cb11a833R20-R85),[[2]](https://github.com/PyStarr/BrawlPy/pull/4/files#diff-7cc0a1ecc2a1c7abbc754e5233bba68d768b7c92bacaa599c40be70f85c52b13L40-R142))