Skip to content

Feat/python index scripts#121

Closed
PedroDnT wants to merge 5 commits into
ropensci:mainfrom
PedroDnT:feat/python-index-scripts
Closed

Feat/python index scripts#121
PedroDnT wants to merge 5 commits into
ropensci:mainfrom
PedroDnT:feat/python-index-scripts

Conversation

@PedroDnT
Copy link
Copy Markdown

No description provided.

google-labs-jules Bot and others added 5 commits August 11, 2025 18:00
…ython package, which is the Python migration of the `rb3` R package.

This initial setup includes:
- A new Poetry project with a `src` layout.
- All necessary main and development dependencies added to `pyproject.toml`.
- Tooling configuration for `ruff` (linting/formatting), `mypy` (strict type checking), and `pytest`.
- A GitHub Actions CI workflow to automate checks (lint, type check, test) on every push and pull request.

This provides us with a solid foundation for the subsequent phases of the migration, including the implementation of the core engine, data loaders, and parsers.
…Phase 2 of the migration plan.

This includes:
- Porting all YAML template files from the original R package.
- A new `Template` class (`src/pyrb3/template.py`) responsible for loading, parsing, and providing access to the YAML template definitions.
- A new `Metadata` dataclass (`src/pyrb3/metadata.py`) that represents the state of a download operation and generates a unique, stable checksum for each operation.
- A suite of unit tests for both the `Template` and `Metadata` components, ensuring they are robust and function correctly.

This core engine provides the foundation for the next phase of development, where I will focus on implementing the data downloaders and parsers.
…tions, porting the logic from the original R package's `R/downloaders.R` file. This completes a major milestone.

Here is a summary of the changes:
- A new `downloaders.py` module was created containing Python equivalents for all R downloader functions (e.g., `simple_download`, `sprintf_download`, `settlement_prices_download`).
- I implemented the custom B3 URL encoding scheme (JSON to base64) used by the index data endpoints.
- I wrote a comprehensive test suite (`tests/test_downloaders.py`) with 11 tests using `requests-mock` to verify the behavior of each downloader without making real network calls.
- The `requests-mock` library was added to the development dependencies.

The downloader module is now feature-complete and robustly tested, ready to be used by the main application logic.
feat: Set up Python project scaffolding for pyrb3
This commit adds a new directory `pyrb3-standalone` which contains a clean, Python-only version of the `pyrb3` library and its related scripts.

This standalone project includes:
- The `pyrb3` library source code.
- The example scripts `list_indexes.py` and `download_index.py`.
- A `requirements.txt` file for easy dependency installation.
- A `README.md` with setup and usage instructions.
- A `.gitignore` file to exclude generated files.
@PedroDnT PedroDnT closed this Aug 15, 2025
@PedroDnT PedroDnT deleted the feat/python-index-scripts branch August 15, 2025 01:18
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.

1 participant