semvec/pypi-packages huggingface dataset:
django-simple-list-editable 1.0.1
Provides a simple list_editable attribute control in Django Admin, based on http request and self context
Requires Python: >=3.12

# Django. Simple list editable

> [!IMPORTANT]
> This project is intended only for the management of routine work with django admin,
> often wanted to manage list_editable attribute based on a request or self context,
> I hope this project can help you

## Content

- [Django. Simple list editable](#django-simple-list-editable)
  - [Content](#content)
  - [Install](#install)
  - [Using](#using)
    - [Using mixin](#using-mixin)
    - [Using admin instance](#using-admin-instance)

## Install

```bash
pip install django-simple-list-editable
```

## Using

### Using mixin

```python
from typing import Self, Sequence

from django.contrib.admin import ModelAdmin as StandaloneModelAdmin
from django.http.request import HttpRequest

from simple_list_editable.admin import ModelAdminMixin


class ModelAdmin(ModelAdminMixin, StandaloneModelAdmin):

    list_editable = ('some_field',)

    def get_list_editable(self: Self, request: HttpRequest) -> Sequence[str]:
        if not request.user.is_superuser:
            return ()
        return self.list_editable
```

### Using admin instance

```python
from typing import Self, Sequence

from django.http.request import HttpRequest

from simple_list_editable.admin import ModelAdmin as StandaloneModelAdmin


class ModelAdmin(StandaloneModelAdmin):

    list_editable = ('some_field',)

    def get_list_editable(self: Self, request: HttpRequest) -> Sequence[str]:
        if not request.user.is_superuser:
            return ()
        return self.list_editable
```
trash-manager 0.0.3
A manager for the trash system of the OS
Requires Python: >=3.9
Keywords: delete, directory, file, folder, manager, remove, trash, trash-manager

# trash-manager

[![PyPI - Version](https://img.shields.io/pypi/v/trash-manager.svg)](https://pypi.org/project/trash-manager)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/trash-manager.svg)](https://pypi.org/project/trash-manager)

-----

## Table of Contents

- [Installation](#installation)
- [License](#license)

## Installation

```console
pip install trash-manager
```

## License

`trash-manager` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
usyd-colors 0.1.0
A package containing various palettes inspired by the colors of The University of Sydney.
Requires Python: <4.0,>=3.10

# usyd_colors

A Python version of the University of Sydney's brand color palettes. Inspired by the wonderful package for R: https://github.com/Sydney-Informatics-Hub/usydColours/tree/master

## Installation

```bash
pip install usyd-colors
```

or

```bash
poetry add usyd-colors
```

## Usage

### 1. Get a palette
```python
from usyd_colors import get_palette

# Get the "primary" palette
primary_palette = get_palette("primary")

# Access and print the HEX colors
hex_colors = primary_palette.hex_colors()
print("HEX Colors in Primary Palette:", hex_colors)

# Access and print the RGB colors
rgb_colors = primary_palette.rgb_colors()
print("RGB Colors in Primary Palette:", rgb_colors)
```

outputs:
```
HEX Colors in Primary Palette: ['#424242', '#E64626', '#0148A4', '#FFB800', '#F1F1F1']

RGB Colors in Primary Palette: [(0.25882352941176473, 0.25882352941176473, 0.25882352941176473), (0.9019607843137255, 0.27450980392156865, 0.14901960784313725), (0.00392156862745098, 0.2823529411764706, 0.6431372549019608), (1.0, 0.7215686274509804, 0.0), (0.9450980392156862, 0.9450980392156862, 0.9450980392156862)]
```

### 2. Use with matplotlib

```python
import numpy as np
import matplotlib.pyplot as plt
from usyd_colors import get_palette

# Get the "primary" palette
primary_palette = get_palette('primary')

# Generate some random data for a heatmap
data = np.random.rand(10, 10)

# Use the palette to create a Matplotlib colormap
colormap = primary_palette.matplotlib_colormap()

# Plot the heatmap using the colormap
plt.figure(figsize=(6, 6))
plt.imshow(data, cmap=colormap)
plt.colorbar()
plt.title('Heatmap with USYD Primary Palette Colormap', fontsize=16)
plt.show()
```

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
tic-tac-toe-engine 0.1.0
An implementation of the Tic Tac Toe game rules
Keywords: python, tic-tac-toe, tictactoe, game, engine


# Tic Tac Toe Engine


Implementation of the rules of the game "Tic tac toe".

This project can be use as:
- An engine for a game (Both CLI and paired with a game library like Pygame).
- A tool for AI training.

This project implements all the logic needed to play the tic tac toe game.

Example usage (a CLI implementation):

```python
from tic_tac_toe_engine import Engine
from typing import Union



def print_board(board: list[Union[str, None]]) -> None:
	""" Print the board """	

	print("") # Some space

	for i in range(0, 9, 3):
		row = " | ".join(board[j] if board[j] is not None else str(j) for j in range(i, i + 3))
		print(row)
		if i < 6:  # Add a line between rows, but not after the last row
			print("-" * 9)


engine = Engine()

while True:
	print_board(engine.board)
	print(f"\n{engine.current_player} moves.")
	move = int(input("Enter your move (0 - 8): "))

	engine.play_move(move)

	if engine.is_over():
		print_board(engine.board) # Print again to reflect the ending
		
		if engine.is_tie():
			print("It's a tie")

		else:
			print(f"{engine.winner} wins!")

		break
```
telegraph-uploader 1.0
A Python library for interacting with the Telegraph API
Requires Python: >=3.6


# Telegraph API Python Library

This Python library provides easy-to-use functions to interact with the [Telegraph API](https://telegra.ph/api), 
which allows you to create, edit, and manage Telegraph posts and accounts.

## Features
- Create and manage Telegraph accounts.
- Create, edit, and retrieve pages.
- Fetch page view statistics.
- Revoke access tokens.
- Easily integrate with any Python project.

## Installation
You can install the required dependencies using `pip`. Make sure you have Python installed.

```bash
pip install Telegraph-Uploader
```

## Usage

Below is an example of how you can use the Telegraph API with this library.

```python
from telegraph import TelegraphAPI

# Initialize API
telegraph_api = TelegraphAPI()

# Create a new account
account = telegraph_api.create_account(short_name="TestUser", author_name="Anonymous", author_url="https://example.com")
print(f"Account created: {account}")

# Access token for future requests
access_token = account['access_token']

# Initialize API with access token
telegraph_api = TelegraphAPI(access_token)

# Create a new page
content = [{"tag": "p", "children": ["This is a sample Telegraph page created via API."]}]
page = telegraph_api.create_page(title="Sample Page", content=content, author_name="Anonymous", return_content=True)
print(f"Page created: {page}")

# Fetch the page details
fetched_page = telegraph_api.get_page(page['path'], return_content=True)
print(f"Fetched page: {fetched_page}")
```

## Methods

### Account Management
- `create_account(short_name, author_name=None, author_url=None)`: Creates a new Telegraph account.
- `edit_account_info(short_name=None, author_name=None, author_url=None)`: Updates account information.
- `get_account_info(fields=None)`: Retrieves account information.
- `revoke_access_token()`: Revokes the current access token and generates a new one.

### Page Management
- `create_page(title, content, author_name=None, author_url=None, return_content=False)`: Creates a new Telegraph page.
- `edit_page(path, title, content, author_name=None, author_url=None, return_content=False)`: Edits an existing page.
- `get_page(path, return_content=False)`: Fetches details of a specific page.
- `get_page_list(offset=0, limit=50)`: Retrieves a list of pages belonging to the account.

### Page Statistics
- `get_views(path, year=None, month=None, day=None, hour=None)`: Gets the number of views for a Telegraph page.

## Error Handling
All errors returned by the Telegraph API are handled by raising `TelegraphException`. For example:

```python
from telegraph.exceptions import TelegraphException

try:
    account = telegraph_api.create_account(short_name="TestUser")
except TelegraphException as e:
    print(f"An error occurred: {e}")
```

## License
This project is licensed under the MIT License.