semvec/pypi-packages huggingface dataset:
exratepy 0.1.0
Python wrapper for fawazahmed0's exchange-api.
Requires Python: >=3.12

# exratepy

A Python library for fetching currency exchange rates and currency information from the [Fawazahmed0 Currency API](https://github.com/fawazahmed0/exchange-api).  It provides a simple and convenient way to access up-to-date exchange rate data, with a fallback mechanism to ensure reliability.

:octocat: [Github repo](https://github.com/akshpra/exratepy)


## Installation
``` bash
pip install exratepy
```


## Usage:
``` python
from exratepy.client import Client
from datetime import date

client = Client()

# Get available currencies
currencies = client.get_currencies()
print(currencies)

# Get latest exchange rates:
rates = client.get_exchange_rates(base="INR") # date defaults to latest
print(rates)
# Example: {"USD": 86.7248, "AED": 22.6574, ...}

# Get exchange rate as on a specific date:
rates = client.get_exchange_rates(base="INR", date=date(2024,12,1))
print(rates)
# Example: {'INR': 89.7248, 'USD': 1.08275, ...}

```


## Features
- **Currency Information:** Fetch a list of available currencies and their names.
- **Exchange Rates:** Retrieve exchange rates for a specific base currency and date (or "latest").
- **Fallback Mechanism:** Uses a secondary API endpoint as a fallback in case the primary endpoint is unavailable, ensuring higher reliability.
- **Data Validation:** Uses Pydantic models to validate and normalize the API responses, ensuring data consistency. Currency codes are converted to uppercase, currency names to title case, and inverse exchange rates are calculated and rounded to 6 decimal places.
- **Error Handling:** Includes robust error handling for API requests and invalid data. Custom exceptions (ApiResponseError) provide informative error messages.
- **Logging:** Integrates with the loguru library for detailed logging of API requests and any issues encountered.
- **Type Hinting:** Comprehensive type hinting enhances code readability and maintainability.

## API Endpoints

The library interacts with the following API endpoints:

Primary: `https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@<date>/v1/currencies/<base>.min.json`

Fallback: `https://<date>.currency-api.pages.dev/v1/currencies/<base>.json`

## Error Handling

The library uses a custom exception ApiResponseError to handle API-related errors.  This exception provides information about the failed request, including the URL and error message.

``` python
from exratepy.exceptions import ApiResponseError

try:
    client.get_exchange_rates(base="INVALID")
except ApiResponseError as e:
    print(f"An error occurred: {e}")
```

## Logging

The library uses the loguru library for logging.  To enable logging, you can configure loguru as needed.  By default, errors are logged.

``` python
from loguru import logger

# Configure logging (optional)
logger.add("my_log_file.log", rotation="10:00")  # Log to a file

client = Client()
# ... your code ...
```
onpolicy 0.0.1
On-policy training made easy
Requires Python: <4.0,>=3.8

# onpolicy

[![Release](https://img.shields.io/github/v/release/AlgoDistill/onpolicy)](https://img.shields.io/github/v/release/AlgoDistill/onpolicy)
[![Build status](https://img.shields.io/github/actions/workflow/status/AlgoDistill/onpolicy/main.yml?branch=main)](https://github.com/AlgoDistill/onpolicy/actions/workflows/main.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/AlgoDistill/onpolicy/branch/main/graph/badge.svg)](https://codecov.io/gh/AlgoDistill/onpolicy)
[![Commit activity](https://img.shields.io/github/commit-activity/m/AlgoDistill/onpolicy)](https://img.shields.io/github/commit-activity/m/AlgoDistill/onpolicy)
[![License](https://img.shields.io/github/license/AlgoDistill/onpolicy)](https://img.shields.io/github/license/AlgoDistill/onpolicy)

On-policy training made easy

- **Github repository**: <https://github.com/AlgoDistill/onpolicy/>
- **Documentation** <https://AlgoDistill.github.io/onpolicy/>

## Getting started with your project

First, create a repository on GitHub with the same name as this project, and then run the following commands:

```bash
git init -b main
git add .
git commit -m "init commit"
git remote add origin git@github.com:AlgoDistill/onpolicy.git
git push -u origin main
```

Finally, install the environment and the pre-commit hooks with

```bash
make install
```

You are now ready to start development on your project!
The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release.

To finalize the set-up for publishing to PyPI or Artifactory, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/publishing/#set-up-for-pypi).
For activating the automatic documentation with MkDocs, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/mkdocs/#enabling-the-documentation-on-github).
To enable the code coverage reports, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/codecov/).

## Releasing a new version

- Create an API Token on [PyPI](https://pypi.org/).
- Add the API Token to your projects secrets with the name `PYPI_TOKEN` by visiting [this page](https://github.com/AlgoDistill/onpolicy/settings/secrets/actions/new).
- Create a [new release](https://github.com/AlgoDistill/onpolicy/releases/new) on Github.
- Create a new tag in the form `*.*.*`.
- For more details, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/cicd/#how-to-trigger-a-release).

---

Repository initiated with [fpgmaas/cookiecutter-poetry](https://github.com/fpgmaas/cookiecutter-poetry).
lighter-zoo 0.1.3
Add your description here
Requires Python: >=3.10


## Installation

To install the `lighter-zoo` package, use pip:

```bash
pip install lighter-zoo
```

## Example Usage

```python
# Import the SegResNet model from lighter_zoo
from lighter_zoo import SegResNet

# Create a 3D segmentation model for whole body segmentation
model = SegResNet(
    spatial_dims=3,      # 3D input volumes
    in_channels=1,       # Single channel input (e.g. CT or MRI)
    out_channels=118,    # Number of segmentation classes
    init_filters=32,     # Initial number of filters in first conv layer
    blocks_down=[1, 2, 2, 4, 4],  # Number of residual blocks in each downsampling stage
    dsdepth=4           # Depth of deep supervision
)

# Load pretrained weights from the whole body segmentation model
model.from_pretrained("project-lighter/whole_body_segmentation")
```

This example demonstrates how to load the `SegResNet` model with pre-trained weights for whole-body segmentation.

## Available Models

The following models are currently available in the Lighter-Zoo:

- **SegResNet:** A 3D segmentation model based on the MONAI implementation.

More models will be added in the future.

## Contributing

Contributions are welcome! If you have a pre-trained model you would like to share, please submit a pull request.

## License

This project is licensed under the Apache 2.0 License.