semvec/pypi-packages huggingface dataset:
django-referer-csrf 0.2.0
TODO
Requires Python: >=3.7

# django_referer_csrf

This project has 2 goals:

1. Simplifiy django's CSRF protection so that developers don't need to worry about the token
2. Make it easier for view code to invoke CSRF protection dynamically

## The token isn't needed

https://security.stackexchange.com/a/197269

On https sites, django's csrf protection requires that the request's referer header matches the request's host header. This check makes the entire CSRF token redundant. The token check provides no extra security on top of the referer check.

Django skips the referer check on non-https sites, which is somewhat advantageous (it means that users who configure their web browsers not submit a referer header can still submit forms). 

Our validator actually looks for a valid origin header or referer header. Modern browsers follow the (newish) spec, which is to send an origin header with every request other than head/get. This means that if users have the referer header disabled, they can still pass our CSRF check.

## Usage

- `pip install django_referer_csrf`
- in your `MIDDLEWARE` setting, replace `django.middleware.csrf.CsrfViewMiddleware` with `django_referer_csrf.Middleware`

With this middleware, you can still use Djangos's csrf_exempt decorators.

If you want to apply the CSRF protection based on dynamic conditions in view code, just check to see what the Middleware.process_view() does and replicate that.
atlas-hfdatasets 1.3.9
Manage your datasets on the Hugging Face Hub
Requires Python: >=3.7

# Atlas_HFDatasets

A command-line tool to manage your datasets on the Hugging Face Hub - upload, download, list, check and remove datasets with ease.


## Prerequisites

- Python 3.7 or higher

## Installation

Install the package via pip:

```bash
pip install atlas_hfdatasets
```

## Usage

Before using the tool, initialise your Hugging Face credentials:

```bash
atlas_hfdatasets init
```

### Commands

- **Upload a dataset**
  ```bash
  atlas_hfdatasets upload /path/to/dataset [-n username/repo_name] [-p True/False]
  ```
  Options:
  - `-n`: Repository name (format: username/repo_name). Defaults to dataset folder name
  - `-p`: Make dataset public (default: False)

- **List your datasets**
  ```bash
  atlas_hfdatasets list [-f keyword]
  ```
  Options:
  - `-f`: Filter datasets by keyword (case-insensitive)

- **Remove a dataset**
  ```bash
  atlas_hfdatasets remove username/repo_name [-f True/False]
  ```
  Options:
  - `-f`: Force deletion without confirmation (default: False)

- **Download a dataset**
  ```bash
  atlas_hfdatasets download username/repo_name [-o output_directory]
  ```
  Options:
  - `-o`: Output directory path (default: current directory)

- **Check dataset statistics**
  ```bash
  atlas_hfdatasets check username/repo_name
  ```

## Requirements

- Python ≥ 3.7
- huggingface-hub
- datasets

## Licence

This project is licensed under the MIT Licence - see the [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
```
django-dynamic-path 0.2.0
A django path() replacement enabling truly dynamic urls
Requires Python: >=3.7

# django_dynamic_path

A django path() replacement enabling truly dynamic urls.

Rather than mapping a regular expression to a view function, you map a "resolver function" to a view function. The resolver function receives the path as an argument, and decides whether or not it wants to handle the request. If it does want to the handle the request, it should return a tuple of args and kwargs, which will be passed to the view function.

## Use Cases

TODO
propertiesNaOH 0.1.13
A package for aqueous NaOH properties calculations
Requires Python: >=3.6

# Package Description

This file contains property data for aqueous sodium hydroxide solutions.

### Installation and Unsage

```
pip install propertiesNaOH
```

```python
# Import
import propertiesNaOH as NaOH

# Example Usage
p = 100000 # [Pa]
x = 0.4    # [%]  = [kgNaOH / kgSolution]
t_sat = NaOH.saturation_temperature(p, x)
print(t_sat)
```

### Available Property-Functions

| Function                         | Parameter 1           | Parameter 2           | Parameter 3    | Return Unit   |
|----------------------------------|-----------------------|-----------------------|----------------|---------------|
| saturation_temperature(P, x1)    | P (Pa)                | x (kgNaOH/kgSolution) | -              | °C            |
| saturation_pressure(x, T)        | x (kgNaOH/kgSolution) | T (°C)                | -              | Pa            |
| saturation_concentration(x, T)   | P (Pa)                | T (°C)                | -              | kg/kg         |
| enthalpy(x, T)                   | x (kgNaOH/kgSolution) | T (°C)                | -              | kJ/kg         |
| specific_heat_capacity(x, T)     | x (kgNaOH/kgSolution) | T (°C)                | -              | kJ/kg·K       |
| density(x, T)                    | x (kgNaOH/kgSolution) | T (°C)                | -              | kg/m³         |
| dynamic_viscosity(x, T)          | x (kgNaOH/kgSolution) | T (°C)                | -              | Pa·s          |
| thermal_conductivity(x, T, p)    | x (kgNaOH/kgSolution) | T (°C)                | p (Pa)         | W/m·K         |


### Available Utilities


| Function                 | Description                  | Boolean Options + Defaults                              |
|--------------------------|------------------------------|---------------------------------------------------------|
| pTDiagram()              | shows pT-Diagram             | log=True, invT=True                                     |
|                          |                              | editablePlot=False, show_percentages=True               |
| crystallization_curve()  | shows crystallization curve  | return_data=False (if True, only data returned, no plot)|
django-tree-view 4.3.0
Organize your code and templates in a natural directory structure
Requires Python: >=3.7

# Django Tree View

Organize your view code and templates and in a directory structure, and automatically generate urls for them.

## Terminology

"Tree View" refers the actual view function we've created, which processes a request according to code you write inside your "view tree".

## Installation

1. `pip install django_tree_view`
2. In your urls.py file, add in a call to `make_tree_view`, passing in the python package name (dotted python path) of your view tree:
    ```python
    from django_tree_view import make_tree_view

    urlpatterns = [
        make_tree_view('my_view_tree'),
    ]
    ```

    Note: we're not using django's path() here, and we didn't specify a url regex. make_tree_view() returns an object which dynamically resolves urls, matching them whenever there is a corresponding directory (with a `view_tree_node.py` module) inside of your view tree.

    Note: you can use `include('some_path/', [make_tree_view()])` if you want a url prefix.

3. Optionally, add the full path to your view tree to the `DIRS` option of your `DjangoTemplates` backend:
    ```python
    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': [os.path.join(BASE_DIR, 'my_view_tree')],
            ...
        },
    ]
    ```

    This will allow you to place page-specific templates inside the same directory which holds the view code for that url.

## CSRF Protection
Our view uses Django's `csrf_exempt` decorator, and selectively applies its own CSRF protection.

Any view tree node can opt-out of CSRF protection by setting `CSRF_EXEMPT=True` at the module level.

The CSRF protection we use is not Django's default CSRF protection. We use utilities from django_referer_csrf. You may want to check out the documentation for django_referer_csrf, and use their middleware in place of Django's, but this is *not* required.

## Organizing Your View Tree

TODO

## TODO

When DEBUG and reloading, reload empty modules (not sure, but this might already be done).

### "Single View Tree" approach
Our path resolver no longer matches when the "path directory" contains no `view_tree_node.py` file. 

I think we should change how view trees are "installed". The user should define one global `VIEW_TREE_ROOT`. You can "install" reusable apps in your view tree by symlinking to them from your view tree.

This makes things easier to understand for the end user. They don't need understand `make_tree_view()`. You have a single directory containing your view tree. Period.

The challenge: if an app is distributed on pypi, symlinking to it (in a way that can be copied between server environments), is not trivial.