semvec/pypi-packages huggingface dataset:
fs.onedrivefs 1.2.3
Pyfilesystem2 implementation for OneDrive using Microsoft Graph API
Requires Python: >=3.8
Keywords: Pyfilesystem2, filesystem, onedrive

# fs.onedrivefs

Implementation of pyfilesystem2 file system using OneDrive

![image](https://github.com/rkhwaja/fs.onedrivefs/workflows/ci/badge.svg) [![codecov](https://codecov.io/gh/rkhwaja/fs.onedrivefs/branch/master/graph/badge.svg)](https://codecov.io/gh/rkhwaja/fs.onedrivefs) [![PyPI version](https://badge.fury.io/py/fs.onedrivefs.svg)](https://badge.fury.io/py/fs.onedrivefs)

# Usage

`fs.onedrivefs` can create a [`requests_oauthlib.OAuth2Session`](https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#) for you. This way the `OAuth2Session` is going to refresh the tokens for you.

``` python
onedriveFS = OneDriveFS(
  clientId=<your client id>,
  clientSecret=<your client secret>,
  token=<token JSON saved by oauth2lib>,
  SaveToken=<function which saves a new token string after refresh>)

# onedriveFS is now a standard pyfilesystem2 file system
```

You can handle the tokens outside of the library by passing a [`requests.Session`](https://requests.readthedocs.io/en/latest/user/advanced/#session-objects).
Here is an example of a custom session using [MSAL Python](https://learn.microsoft.com/en-us/entra/msal/python/)

``` python
class MSALSession(OAuth2Session):
  def __init__(self, client: msal.ClientApplication):
    super().__init__()
    self.client = client

  def request(self, *args, **kwargs):
    account = self.client.get_accounts()[0]
    self.token = self.client.acquire_token_silent_with_error(
      scopes=["Files.ReadWrite"], account=account
    )

    return super().request(*args, **kwargs)

client = msal.ConfidentialClientApplication(
  client_id=<your client id>,
  client_credential=<your client secret>,
  authority=f"https://login.microsoftonline.com/<your tenant>",
  token_cache=<your token cache>,
)

# Authentication flow to populate the token cache
# YOUR AUTHENTICATION FLOW

session = MSALSession(client=client)
onedriveFS = OneDriveFS(session=session)

# onedriveFS is now a standard pyfilesystem2 file system
```

Register your app [here](https://docs.microsoft.com/en-us/graph/auth-register-app-v2) to get a client ID and secret
unsatisfiable 1.0.0
An unsatisfiable dependency to support flagging unsupported environments.
Requires Python: >6.28
Keywords: dependencies, fail, error, impossible

# unsatisfiable 

A project that can be used as a purposefully unsatisfiable dependency to force installation failure
for certain environments.

Generally you'll want to depend on this project via an environment marker. For example, if you
publish a Python library that does not support Windows you could add
`unsatisfiable; platform_system == "Windows"` to its dependencies.
tsknn 0.1.0
tsknn is a Python implementation of the k-nearest neighbors (KNN) algorithm aimed at time series forecasting
Requires Python: >=3.8

# tsknn

[![PyPI version](https://badge.fury.io/py/tsknn.svg)](https://badge.fury.io/py/tsknn)

*TSKNN* (Time Series K-Nearest Neighbors) is a Python implementation of the k-nearest neighbors (KNN) algorithm designed specifically for time series forecasting.

It is a pure Python and NumPy reimplementation of the [tsfknn](https://github.com/franciscomartinezdelrio/tsfknn) package from R—completely rewritten from scratch without relying on C extensions. By leveraging optimized NumPy operations, TSKNN achieves high performance while remaining lightweight and easy to install.


## Installation

```bash
pip install tsknn
```

Or clone the repository and install locally:

```bash
git clone https://github.com/ricardozago/tsknn.git
cd tsknn
pip install .
```

## Usage example

```python
import numpy as np

from tsknn import tsknn

X = np.random.rand(1000)

model = tsknn(
    cf="mean",  # also median or weighted
    h=24,  # forecast horizon
    transform="multiplicative",  # also additive or None
    msas="recursive",  # also mimo
    lags=[1, 2, 3, 4, 5, 6], # lags to consider as features
    k=[5, 7, 9], # number of neighbors to consider
)
model.fit(X)
tsknn_resp = model.predict()
print(tsknn_resp)
```

## Tests

To run the tests and check coverage:

```bash
python -m pytest --cov=tsknn --cov-report term-missing
```

To run all tests, you’ll need R installed, since the results are compared against the original tsfknn package. You’ll also need the rpy2 library to interface between Python and R.

## Contributing

Contributions are welcome! Open issues or pull requests.

1. Fork the project
2. Create your branch (`git checkout -b feature/feature-name`)
3. Commit your changes (`git commit -am 'feat: new feature'`)
4. Push to the branch (`git push origin feature/feature-name`)
5. Open a Pull Request

## License

This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more details.
textual-ascii-image-magicmaana 0.0.1
A small, single file, package to convert a PIL image into a Rich / Textual compatible ascii image.
Requires Python: >=3.9

# Textual ASCII image

A small, single file, package to convert a PIL image into a Rich / Textual compatible ascii image.

### Why not another ascii library like ascii-magic?

Textual / rich don't use ANSI colours or codes. instead using `[]` to define colours.

`[red]hello[/red]` -> <code style="color: red">hello</code>

## Installation

```bash
pip install textual-ascii-image
```

## Requirements

- Pillow - an image library

## Usage

```python
	from ascii_image import to_ascii
	from PIL import Image


	image = Image.Image("path/to/image.png")
	ascii_image = to_ascii(image)

	#Textual
	from textual.app import App
	from textual.widgets import Label
	class App(App):
		def compose(self):
			yield Label(ascii_image)

	#######################################

	#Rich
	from rich import print
	print(ascii_image)
```

![img](./example/output.png)

## Docs

```python
	def to_ascii(img: PIL.Image.Image, character: str = "▀", size: Optional[tuple[int,int]] = None, doubled: bool = True) -> str:
```

- img: A Pillow image
- size (Optional): used to resize image. (would recommend below 64x64)
- character (Optional): The ASCII character.
  - defaults to `▀` if in doubled mode, or `█` if not
- doubled (Optional): decides if should sample two rows per column, or one

when in doubled mode, each character represents a top and bottom pixel

When not in doubled mode, each pixel takes up 2 characters horizontally.

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
schem 0.35.0
Clean Room implementation of the backend of SpaceChem (https://www.zachtronics.com/spacechem).
Requires Python: >=3.7

# SChem

https://pypi.org/project/schem/. Install with `pip install schem`

Clean Room implementation of the backend of SpaceChem (https://www.zachtronics.com/spacechem).

## Usage (CLI)

```
python -m schem [-h] [--version] [-l LEVEL_FILE] [--max-cycles MAX_CYCLES]
                [--check-precog] [--max-precog-check-cycles MAX_PRECOG_CHECK_CYCLES]
                [--seed SEED] [--hash-states HASH_STATES]
                [--export] [--no-run] [--strict]
                [--json | --verbose] [--debug [DEBUG]]
                [solution_files ...]
```

E.g. `python -m schem` will validate the cycles-reactors-symbols score of any solution export(s) in the user's clipboard. See `python -m schem --help` for details.

## Usage (python)

Supposing `level_export`, `solution_export` are strings as exported by SpaceChem CE:
```python
from schem import Level, Solution

# Load a solution
solution = Solution(solution_export)  # Auto-use appropriate official level
solution = Solution(solution_export, level=level_export)  # Custom level
solution = Solution(solution_export, level=Level(level_export))  # Alternative

# Run a solution
solution.run()
# => Score(cycles=45, reactors=1, symbols=14)

# Check the expected score that was in the export's metadata
solution.expected_score
# => Score(cycles=44, reactors=1, symbols=14)

# Reset the run state of a solution
solution.reset()

# Validate that a solution matched its expected score
solution.validate()
# =/> ScoreError("[Of Pancakes and Spaceships] 44-1-14 "Cycles" by Zig: Expected 44 cycles but got 45.")

# Check if a solution uses precognition
solution.is_precognitive()  # slow
# => False

# Bundle method for calling validate() if expected score is present, else run(), optionally checking precog,
# and returning a dict of all this info and any error
solution.evaluate()
# => {"level_name": "Tunnels III",
#     "resnet_id": (1, 1, 3),  # Volume, Issue, Puzzle
#     "author": "Zig",
#     "cycles": 244,
#     "reactors": 1,
#     "symbols": 14,
#     "solution_name": "symbols",
#     "error": ScoreError("[Tunnels III] 243-1-14 \"symbols\" by Zig: Expected 243 cycles but got 244.")
#}

solution.evaluate(check_precog=True)
# => {"level_name": "Challenge: Going Green",
#     "author": "Zig",
#     "cycles: 3578,
#     "reactors": 1,
#     "symbols": 103,
#     "solution_name": "assumes 2nd input",
#     "precog": true,
#     "precog_explanation": "Solution is precognitive; failed whenever molecule 2 was Hydrogen Sulfide, for 9 such
#                            appearances (whereas solution success rate was otherwise 100%)."
#}

# Re-export the solution. Sorts export lines to ensure uniqueness
solution.export_str()
# => "SOLUTION:..."
```
django-cloudrun-iap 0.0.1
A Django middleware for Google Cloud RUN IAP authentication.
Requires Python: >=3.8

# Django Cloud Run IAP Authentication Middleware

This package provides a simple Django middleware to authenticate users via
Google Cloud's Identity-Aware Proxy (IAP), specifically tailored for
Cloud Run deployments.

## Installation

```bash
pip install -e git+[https://github.com/boot-sandre/django-cloudrun-iap.git](https://github.com/boot-sandre/django-cloudrun-iap.git#egg=django-cloudrun-iap)
```

Or after publishing to python pypi registry:

```bash
pip install django-cloudrun-iap
```

## Configuration

To integrate `django_cloudrun_iap` into your Django project, follow these steps to modify your `settings.py` file.

### 1. Add to INSTALLED_APPS

First, add `django_cloudrun_iap` to your **`INSTALLED_APPS`** list to register the application with your project.

```python
# settings.py
INSTALLED_APPS = [
    # ... other apps
    'django_cloudrun_iap',
]
```

### 2. Add Middleware

Next, insert the IAP middleware into your MIDDLEWARE list. It is crucial to place it immediately after Django's built-in AuthenticationMiddleware.

```python
# settings.py
MIDDLEWARE = [
    # ... other middlewares
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django_cloudrun_iap.middlewares.IAPAuthenticationMiddleware',
    # ... other middlewares
]
```

### 3. Configure IAP Settings

Finally, add the following configuration variables to your settings.py file.

```python
# settings.py

# Toggle the IAP middleware. Set to False to disable IAP authentication.
IAP_ENABLED = True

# The audience claim for your IAP-secured resource. This value can be found
# in your Google Cloud Console under the IAP settings for your resource.
# Format: /projects/$PROJECT_NUMBER/locations/$REGION/services/$SERVICE
IAP_EXPECTED_AUDIENCE = '/projects/123456789123/locations/europe-west1/services/myawesomedjango'

# (Optional) Restrict logins to a specific Google Workspace or Cloud Identity domain.
# Can use a string, a list of domain, or a tuple
IAP_EMAIL_DOMAIN = ["emencia.com", "velops.eu"]

IAP_EXEMPT_URLS = [
    "/api/healthcheck/",
    "/status/"
]
```

## Usage

The middleware checks for the presence of specific headers provided by
Google Cloud IAP. It then validates the JWT to ensure the request is legitimate
and comes from a trusted source. Finally, it matches the user's email to a
Django user account and logs them in.