-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from PPeitsch/revert-12-docs
Revert "improved docs"
- Loading branch information
Showing
12 changed files
with
323 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Contributing to BCRA API Connector | ||
|
||
We welcome contributions to the BCRA API Connector project! This document provides guidelines for contributing to the project. | ||
|
||
## Getting Started | ||
|
||
1. Fork the repository on GitHub. | ||
2. Clone your fork locally. | ||
3. Create a new branch for your feature or bug fix. | ||
4. Make your changes and commit them with clear, descriptive commit messages. | ||
5. Push your changes to your fork on GitHub. | ||
6. Submit a pull request to the main repository. | ||
|
||
## Code Style | ||
|
||
- Follow PEP 8 guidelines for Python code. | ||
- Use meaningful variable and function names. | ||
- Write clear comments and docstrings. | ||
|
||
## Testing | ||
|
||
- Add tests for new features or bug fixes. | ||
- Ensure all tests pass before submitting a pull request. | ||
|
||
## Reporting Issues | ||
|
||
- Use the GitHub issue tracker to report bugs or suggest features. | ||
- Provide as much detail as possible, including steps to reproduce for bugs. | ||
|
||
## Pull Requests | ||
|
||
- Clearly describe the problem and solution in the PR description. | ||
- Include any relevant issue numbers. | ||
- Keep PRs focused on a single change rather than multiple unrelated changes. | ||
|
||
Thank you for contributing to BCRA API Connector! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,73 @@ | ||
# Configuring the BCRA API Connector | ||
Configuration | ||
============= | ||
|
||
The BCRA API Connector offers various configuration options to tailor its behavior to your specific needs. This guide explains each option in detail and provides examples of when and how to use them. | ||
The BCRA API Connector offers several configuration options to customize its behavior. This guide explains each option and how to use it. | ||
|
||
## Initialization Options | ||
Initialization Options | ||
---------------------- | ||
|
||
When creating a new instance of `BCRAConnector`, you can customize its behavior using the following parameters: | ||
When creating a new instance of the `BCRAConnector`, you can pass the following parameters: | ||
|
||
```python | ||
from bcra_connector import BCRAConnector | ||
.. code-block:: python | ||
connector = BCRAConnector( | ||
language="es-AR", | ||
verify_ssl=True, | ||
debug=False | ||
) | ||
``` | ||
connector = BCRAConnector( | ||
language="es-AR", | ||
verify_ssl=True, | ||
debug=False | ||
) | ||
### Language Setting | ||
Language | ||
~~~~~~~~ | ||
|
||
The `language` parameter determines the language for API responses. | ||
The `language` parameter sets the language for API responses. Available options are: | ||
|
||
- **Options**: | ||
- `"es-AR"` (default): Spanish (Argentina) | ||
- `"en-US"`: English (United States) | ||
- `"es-AR"` (default): Spanish (Argentina) | ||
- `"en-US"`: English (United States) | ||
|
||
**Example:** | ||
```python | ||
connector = BCRAConnector(language="en-US") | ||
``` | ||
Example: | ||
|
||
**Use case:** Set to "en-US" if you prefer English responses or are building an English-language application. | ||
.. code-block:: python | ||
### SSL Verification | ||
connector = BCRAConnector(language="en-US") | ||
The `verify_ssl` parameter controls whether SSL certificates are verified during API requests. | ||
SSL Verification | ||
~~~~~~~~~~~~~~~~ | ||
|
||
- **Options**: | ||
- `True` (default): Verify SSL certificates | ||
- `False`: Disable SSL verification | ||
The `verify_ssl` parameter determines whether SSL certificates should be verified during API requests. By default, it's set to `True`. | ||
|
||
**Example:** | ||
```python | ||
connector = BCRAConnector(verify_ssl=False) | ||
``` | ||
To disable SSL verification (not recommended for production): | ||
|
||
**Warning:** Disabling SSL verification is not recommended for production use as it may expose you to security risks. | ||
.. code-block:: python | ||
**Use case:** Temporarily disable during development if encountering SSL-related issues, or when working in environments with self-signed certificates. | ||
connector = BCRAConnector(verify_ssl=False) | ||
### Debug Mode | ||
Debug Mode | ||
~~~~~~~~~~ | ||
|
||
The `debug` parameter enables detailed logging for troubleshooting. | ||
The `debug` parameter enables detailed logging when set to `True`. This is useful for troubleshooting. | ||
|
||
- **Options**: | ||
- `False` (default): Normal logging | ||
- `True`: Verbose debug logging | ||
Example: | ||
|
||
**Example:** | ||
```python | ||
connector = BCRAConnector(debug=True) | ||
``` | ||
.. code-block:: python | ||
**Use case:** Enable when you need to diagnose issues or want to understand the connector's internal operations. | ||
connector = BCRAConnector(debug=True) | ||
## Advanced Configuration | ||
Retry Behavior | ||
-------------- | ||
|
||
For more advanced use cases, you can modify the connector's retry behavior by subclassing `BCRAConnector`: | ||
|
||
```python | ||
class CustomBCRAConnector(BCRAConnector): | ||
MAX_RETRIES = 5 | ||
RETRY_DELAY = 2 | ||
connector = CustomBCRAConnector() | ||
``` | ||
|
||
### Retry Mechanism | ||
The connector implements a retry mechanism with exponential backoff. You can modify this behavior by changing the following class variables: | ||
|
||
- `MAX_RETRIES`: Maximum number of retry attempts (default: 3) | ||
- `RETRY_DELAY`: Initial delay between retries in seconds (default: 1) | ||
|
||
**Use case:** Increase `MAX_RETRIES` and `RETRY_DELAY` when working with unstable network connections or during high-traffic periods. | ||
To change these values, subclass `BCRAConnector`: | ||
|
||
.. code-block:: python | ||
## Best Practices | ||
class CustomBCRAConnector(BCRAConnector): | ||
MAX_RETRIES = 5 | ||
RETRY_DELAY = 2 | ||
1. **Production Settings:** Always use SSL verification in production environments. | ||
2. **Localization:** Choose the appropriate language setting based on your target audience. | ||
3. **Debugging:** Use debug mode sparingly, as it can generate large log files. | ||
4. **Retry Tuning:** Adjust retry settings based on your specific use case and the API's behavior. | ||
connector = CustomBCRAConnector() | ||
By leveraging these configuration options, you can optimize the BCRA API Connector's performance and reliability for your specific use case. | ||
This configuration provides more flexibility and control over the connector's behavior. |
Oops, something went wrong.