semvec/pypi-packages huggingface dataset:
pydantic-consul-settings 1.1.1
Add Consul as source of env variable to settings
License: MIT
Requires Python: >=3.11,<4.0

# Pydantic Consul settings

[![PyPI version](https://img.shields.io/pypi/v/pydantic-consul-settings?logo=pypi&label=pydantic-consul-settings)](https://pypi.org/project/pydantic-consul-settings/)

**Add Consul as source of env variable to settings**

This package provides a way to use [pydantic](https://docs.pydantic.dev/) settings with [consul](https://consul.io) as source of environment variables.


## Installation

```shell
pip install pydantic-consul-settings
```

## Usage

```python
from pydantic_consul_settings import BaseSettingsWithConsul, ConsulClientSettings, SettingsConfigDict


class ConsulSettings(ConsulClientSettings):
    """Add additional settings for key generation"""

    stage: str = 'dev'
    service: str = 'my-service'


    @property
    def key_prefix(self) -> str:
        """Get the key prefix."""
        return f"{self.stage}/{self.service}"


class BaseSettings(BaseSettingsWithConsul):
  model_config = SettingsConfigDict(
    env_prefix='APP_',
    consul_model=ConsulSettings(),
  )


class Settings(BaseSettings):
    """App settings"""

    model_config = SettingsConfigDict(
      env_prefix='APP_',
    )

    # Get from env APP_NAME
    # and `dev/my-service/APP_NAME` from consul
    name: str = 'my-app'
    # Get from env APP_VERSION
    # and `dev/my-service/APP_VERSION` from consul
    version: str = '0.1.0'
    # Get from env APP_DESCRIPTION
    # and `dev/my-service/APP_DESCRIPTION` from consul
    description: str = 'My app description'


settings = Settings()

print(settings.dict())
```
pycategory 0.1.2
Python implementation of the Scala standard library.
License: MIT
Requires Python: >=3.10,<4.0
Keywords: Functional,Scala

# pycategory

# Installation

pip install works for this library.

```console
pip install pycategory
```

# Usage

Here is an example of how to use the `pycategory` package:

## curry

```python
from pycategory import curry

@curry
def function(arg1: int, /, arg2: int, arg3: int = 3, *, arg4: int = 4) -> int:
    return arg1 + arg2 + arg3 + arg4

function2 = function        # (int) -> ((int) -> int)
function1 = function2(1)    # (int) -> int
result = function1(2)       # int
```

## Pipeline

```python
from pycategory import Pipeline, curry

def squared(value: int) -> int:
    return value**2

assert 42**2**2 == ~(Pipeline(42) >> squared >> squared)

@Pipeline
@curry
def cubed(arg1: int, arg2: int, arg3: int) -> int:
    return arg1 * arg2 * arg3

assert 42**3 == ~(cubed << 42 << 42 << 42)
```

## Either

```python
from pycategory import Either, EitherDo, Frame, Left, Right

class Error(Frame):
    ...

@Either.do
def context(value: int) -> EitherDo[Error, int]:
    one = yield from Left[Error, int](Error(unmask=("value",)))
    two = 2
    three = yield from Right[Error, int](3)
    return one + two + three

match context(42).pattern:
    case Left(value):
        print(f"Left case {value}")
    case Right(value):
        print(f"Right case {value}")
```

## Option

```python
from pycategory import VOID, Option, OptionDo, Some, Void

@Option.do
def context() -> OptionDo[int]:
    one = yield from VOID
    two = 2
    three = yield from Some[int](3)
    return one + two + three

match context().pattern:
    case Void():
        print("Void case")
    case Some(value):
        print(f"Some case {value}")
```

## Try

```python
from pycategory import Failure, Success, Try, TryDo

@Try.hold(unmask=("value",))
def hold_context(value: int, /) -> int:
    if not value:
        raise Exception("error")
    return value

@Try.do
def context() -> TryDo[int]:
    one = yield from hold_context(0)
    two = 2
    three = yield from Success[int](3)
    return one + two + three

match context().pattern:
    case Failure() as failure:
        print(f"Failure case {failure.exception}")
    case Success(value):
        print(f"Success case {value}")

```
async-truckersmp 0.2.5
An asynchronous Python API wrapper for TruckersMP.
License: MIT
Keywords: truckersmp

Async-TruckersMP
============================================

An asynchronous Python API wrapper for `TruckersMP`_.

.. warning::
    This library is in alpha and bugs may still be present.

Features
------------------

* **Rate limiting** - Pre-emptive rate limiting so you'll never hit a 429.
* **Caching** - Automatic caching of responses so you don't have to.
* **Configurable** - Several configuration options on initialisation.
* **Documented** - Full docs with examples included for reference.
* **Data models** - API responses are parsed into objects (Python classes).

Usage
------------------

Install
^^^^^^^^^^^^^

Install via pip using either of these methods:

.. code-block::

   pip install async-truckersmp


.. code-block::

   pip install git+https://github.com/SamNuttall/Async-TruckersMP.git

Quickstart
^^^^^^^^^^^^^

Let's write a script to print all the server names.

.. code-block:: python

   from truckersmp import TruckersMP  # Import the library

   loop = asyncio.get_event_loop()  # Get the asyncio event loop

   async def main():
       truckersmp = TruckersMP()  # Initalise the TruckersMP class
       servers = await truckersmp.get_servers()  # Call the get_servers method
       for server in servers:  # Loop through each server
           print(server.name)  # Get the name of the server and print it

   loop.run_until_complete(main())  # Run the main function


Resources & Support
---------------------

* `Documentation`_.
* `Github Repository`_.
* If you need further help, feel free to contact Sam#9210 on Discord or open a new issue.

Licence
------------------
Released under the `MIT License`_.

.. _TruckersMP: https://truckersmp.com/
.. _Documentation: https://async-truckersmp.readthedocs.io/
.. _Github Repository: https://github.com/SamNuttall/Async-TruckersMP
.. _MIT License: https://github.com/SamNuttall/Async-TruckersMP/blob/main/LICENSE