Pyrail

Latest version: v0.4.1

Safety actively analyzes 722491 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.4.1

🚀 What's Changed

🔧 Improvements
- 🕒 **Datetime Handling:** Updated to use Unix timestamps in UTC (https://github.com/tjorim/pyrail/pull/47 by silamon)

📦 Dependency Updates
- ⬆️ Bumped `ruff` from `0.9.3` → `0.9.6` (https://github.com/tjorim/pyrail/pull/48 & https://github.com/tjorim/pyrail/pull/52 by dependabot)
- ⬆️ Bumped `pytest-asyncio` from `0.25.2` → `0.25.3` (https://github.com/tjorim/pyrail/pull/49 by dependabot)
- ⬆️ Bumped `aiohttp` from `3.11.11` → `3.11.12` (https://github.com/tjorim/pyrail/pull/50 by dependabot)
- ⬆️ Bumped `mypy` from `1.14.1` → `1.15.0` (https://github.com/tjorim/pyrail/pull/51 by dependabot)

📜 **Full Changelog:** [v0.4.0...v0.4.1](https://github.com/tjorim/pyrail/compare/v0.4.0...v0.4.1)

0.4.0

✨ What's New
- **Improved Documentation & Code Clarity**:
Enhanced the `iRail` class documentation and refactored code for better readability and maintainability. [45](https://github.com/tjorim/pyrail/pull/45)
- **README Updates**:
Improved language selection and session management sections for a better user experience. [42](https://github.com/tjorim/pyrail/pull/42)
- **Dependency Updates**:
Bumped `ruff` from 0.9.2 to 0.9.3 for the latest fixes and improvements. [44](https://github.com/tjorim/pyrail/pull/44)

⚠️ Breaking Changes
1. **Data Models**:
- Introduced `OccupancyName` enum, replacing string types for occupancy names.
- Updated data structures to replace wrapper classes with direct lists:
- `LiveboardDepartures` → `list[LiveboardDeparture]`
- `LiveboardArrivals` → `list[LiveboardArrival]`
- `ConnectionStops` → `list[ConnectionStop]`
- `CompositionSegments` → `list[Segment]`
- `CompositionUnits` → `list[Unit]`
- `DescriptionLinks` → `list[DescriptionLink]`

2. **Response Structure**:
- Simplified nested responses for easier access:
- `LiveboardApiResponse.departures` and `arrivals` are now optional (`None`).
- Removed nested access for lists (e.g., `.departure` and `.arrival`).

3. **Type Hint Changes**:
- Modernized type hints throughout the codebase:
- `Dict` → `dict`
- `List` → `list`

**Full Changelog**: [v0.3.0...v0.4.0](https://github.com/tjorim/pyrail/compare/v0.3.0...v0.4.0)

0.3.0

✨ Key Updates
- **🌐 Support for External aiohttp Session**: Added support for using an external `aiohttp` session to improve flexibility in HTTP requests. ([41](https://github.com/tjorim/pyrail/pull/41) by tjorim)
- **🛠️ Improved Boolean Handling**: Utilized previously implemented boolean handling in data models. ([39](https://github.com/tjorim/pyrail/pull/39) by silamon and tjorim)
- **📅 Timestamp Handling Improvements**:
- Renamed `timestamp_to_datetime` to `_timestamp_to_datetime` to indicate it is a private function for internal use.
- Added tests for timestamp and boolean field deserialization in models.
- Skipped timestamp tests due to timezone discrepancies and cleaned up test functions.
- **🚉 Liveboard Model Update**: Enhanced the liveboard to support arrivals instead of the default departures, with the introduction of `LiveboardArrival` and `LiveboardArrivals` models.
- **🔔 Alert Model Updates**:
- Added a description field to the `Alert` model.
- Made the existing link in the `Alert` model optional, allowing for cases where it may not be present. ([38](https://github.com/tjorim/pyrail/pull/38) by silamon and coderabbit)

🌟 Contributors
- 🎉 Thanks to silamon and tjorim for their contributions to this release!

**🔗 Full Changelog**: [Compare v0.2.5...v0.3.0](https://github.com/tjorim/pyrail/compare/v0.2.5...v0.3.0)

0.2.5

✨ Key Updates
- **🔧 Typed Data Classes for iRail Station Endpoint**: Added typed data classes for improved structure and readability. ([22](https://github.com/tjorim/pyrail/pull/22) by silamon)
- **📊 Expanded Data Models**: Introduced additional data models to enhance response handling. ([23](https://github.com/tjorim/pyrail/pull/23))
- **🛠️ Development Environment**: Updated devcontainer to prevent Python overrides. ([31](https://github.com/tjorim/pyrail/pull/31) by silamon)
- **📦 Dependency Updates**:
- 🔄 Bumped `pytest-asyncio` to v0.25.2. ([34](https://github.com/tjorim/pyrail/pull/34) by dependabot)
- 🔄 Bumped `ruff` from v0.8.6 to v0.9.2 over two incremental updates. ([35](https://github.com/tjorim/pyrail/pull/35) and [#36](https://github.com/tjorim/pyrail/pull/36) by dependabot)

🌟 New Contributors
- 🎉 silamon contributed to the iRail Station Endpoint enhancements. ([22](https://github.com/tjorim/pyrail/pull/22)), thanks!

**🔗 Full Changelog**: [Compare v0.1.0...v0.2.4](https://github.com/tjorim/pyrail/compare/0.1.0...v0.2.5)

🚑 Version 0.2.1-0.2.5 were published to fix an issue in the publishing workflow.

0.1.1

Trying out publish action

0.1.0

Special Thanks
- jcoetsie for adding rate limiting functionality
- lgnap for implementing async/await support

Features
- Added intelligent rate limiting and request throttling (6)
- Modernized codebase with async/await support (15)
- Added Docker development environment with VS Code integration

Dependencies & CI
- Updated requests package to 2.32.3
- Upgraded GitHub Actions (checkout v4, setup-python v5)
- Added automated dependency management

[Full Changelog](https://github.com/tjorim/pyrail/compare/0.0.3...0.1.0)

Links

Releases

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.