semvec/pypi-packages huggingface dataset:
neutron-web 0.5.1
Create modern cross-platform apps in Python using HTML and CSS
Keywords: python, HTML, CSS, GUI, desktop apps


![](https://i.ibb.co/wC9LxYw/Neutron-nobg.png)

Neutron is ment to be an intuative way of creating GUI applications using HTML, CSS and Python. It is built on top of PyQt6 and uses the QtWebEngine.

You can get started contributing via [CONTRIBUTING.md](https://github.com/IanTerzo/Neutron/blob/main/CONTRIBUTING.md).

## Installation

```
pip install neutron-web
```

## Example
For a template project see [TEMPLATE](https://github.com/IanTerzo/Neutron/tree/main/TEMPLATE) or see the [to-do app](https://github.com/IanTerzo/Neutron/tree/main/examples/todo-app).

## Usage
The Neutron api is designed to be very similar to the JavaScript DOM api. You can imagine the `Window` class as the `document` object in JavaScript (altough it is still missing a lot of features). Ideally you should be able to use Neutron as you would use the JavaScript DOM api, altough there are some differences.

### Neutron features

```python
Neutron.event(function : Callable)) -> str
```
Use this function when passing a python function to an event listener or javascript method that requires a callable as parameter. Return the new javascript "bridge" function as str.

```python
Window(title: str, css: str, position: Tuple[int, int], size: Tuple[int, int]) -> Window
```
Create a window.

```python
Window.run_javascript(javascript: str) -> str
```
Evaluate JavaScript code.

```python
Window.display(file: str, html: str, pyfunctions: List[Callable], encoding: str) -> None
```
Used to parse your html code. You run it before showing the window. It takes a path to your htlm file or html code (if file is not provided), a list of python functions and an encoding. The encoding is the encoding of your html file. The python functions are the functions you want to able to directly call from your html file. See the to-do app example.

```python
Window.show() -> None / Window.close() -> None
```
Show and close the window.


## Building your project

To build a Neutron project you first need pyinstaller, install pyinstaller through pip: `pip install pyinstaller`. Then run the script below in your command prompt/terminal. You can also use other programs to build your project such as py2exe if you prefer.

> **Note:** If you are on linux use ":" instead of ";"
```
pyinstaller YOUR_PYTHON_FILE.py --noconsole --onefile --add-data="YOUR_HTML_FILE.html;." --add-data="YOUR_CSS_FILE.css;."
```

You don't need to use `--add-data` if your project doesn't have a CSS or HTML file
exchange-rate-api-client 0.1.1
Unofficial client to interact with the Exchange Rate API V6
Requires Python: >=3.8

# Exchange Rate API Client

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/exchange-rate-api-client)
![PyPI - License](https://img.shields.io/pypi/l/exchange-rate-api-client)
![PyPI](https://img.shields.io/pypi/v/exchange-rate-api-client)
![Downloads](https://img.shields.io/pypi/dm/exchange-rate-api-client)

Unofficial client to interact with the [Exchange Rate API](https://www.exchangerate-api.com/) V6.

- **Simple API client:** Easy-to-use interface to interact with the Exchange Rate API.
- **Open Access Support:** Fetch exchange rates without requiring an API key.

## Installation

Install package from PyPi with:

```bash
pip install exchange-rate-api-client
```

## Usage

### API Client

You can initializate a api client with your API key to access all endpoints:

```python
from exchange_rate_api_client import ExchangeRateApiV6Client

client = ExchangeRateApiV6Client(api_key="<YOUR_API_KEY>")

# Example: Convert 100 USD to EUR
conversion = client.pair_conversion(
    base_code="USD",
    target_code="EUR",
    amount=100,
)
print(conversion)
```

### Open Access

For basic access without an API key, fetch the latest exchange rates:

```python
from exchange_rate_api_client import fetch_exchange_rates

# Example: Fetch exchange rates for USD
data = fetch_exchange_rates(base_code="USD")
print(data)
```

### Additional Examples

#### Fetch enriched data:

```python
data = client.fetch_enriched_data(
    base_code="USD",
    target_code="JPY",
)
print(data)
```

#### Fetch historical data:

```python
from datetime import date

data = client.fetch_historical_data(
    base_code="USD",
    date_obj=date(2023, 1, 1),
    amount=100,
)
print(data)
```

## Requirements

- Python 3.7 or higher
- An API key from [Exchange Rate API](https://www.exchangerate-api.com/) for full access.

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.

## Contributing

Contributions are welcome! Feel free to submit issues or pull requests to improve the client.

## Links

- [API Documentation](https://www.exchangerate-api.com/docs/overview)
- [Project Page](https://pypi.org/project/exchange-rate-api-client/)