semvec/pypi-packages huggingface dataset:
astro-chronpy 0.0.0
A comprehensive toolkit for astronomical time series analysis.
Requires Python: >=3.10

# chronpy

[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/astro-chronpy?color=blue&logo=Python&logoColor=white&style=for-the-badge)](https://pypi.org/project/astro-chronpy)
[![PyPI - Version](https://img.shields.io/pypi/v/astro-chronpy?color=blue&logo=PyPI&logoColor=white&style=for-the-badge)](https://pypi.org/project/astro-chronpy)
[![License: GPL v3](https://img.shields.io/github/license/wcxve/chronpy?color=blue&logo=open-source-initiative&logoColor=white&style=for-the-badge)](https://www.gnu.org/licenses/gpl-3.0)<br>
[![Coverage Status](https://img.shields.io/coverallsCoverage/github/wcxve/chronpy?logo=Coveralls&logoColor=white&style=for-the-badge)](https://coveralls.io/github/wcxve/chronpy)
[![Documentation Status](https://img.shields.io/readthedocs/chronpy?logo=Read-the-Docs&logoColor=white&style=for-the-badge)](https://chronpy.readthedocs.io/en/latest/?badge=latest)

-----

## Table of Contents

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

## Installation

```console
pip install astro-chronpy
```

## License

`chronpy` is distributed under the terms of the [GPL-3.0](https://www.gnu.org/licenses/gpl-3.0-standalone.html) license.
marshmallow-meta 1.0.0a1
Decorator syntax for marshmallow meta attributes (with inheritance)
Requires Python: >=3.6

# marshmallow-meta

*decorator syntax for marshmallow meta attributes (with inheritance)*

Decorators communicate that the behavior of a class is being modified and are more concise when only a few meta attributes are needed. Making inheritance the default further reduces the boilerplate needed to make minor changes to a subclass.

## Install

```sh
pip install marshmallow-meta
```

```py
from marshmallow_meta import meta
```

## API

### `@meta(*kwargs)`

Build a meta class that inherits attributes from the base schema's meta class.

```py
@meta(unknown=INCLUDE)
class Test(Schema):
    foo = fields.String()
```

### `@meta(*bases, **kwargs)`

Inherit and extend specific meta classes.

```py
@meta(Test.Meta, many=True)
class CopyCats(Schema):
   bar = fields.String()
```

Or clear the inherited meta class.

```py
@meta(Schema.Meta)
class Fresh(CopyCats):
   buzz = fields.String()
```
exceptlib 2025.1
Exception handling mechanisms
Requires Python: >=3.10

# `exceptlib` - exception handling mechanisms

<hr>

## Summary
Exceptions occur in Python when something goes wrong. For example, `"abcd"[63]` raises `IndexError`. What to do with an exception is context dependent-- in any langauge, context informs a spectrum of handling mechanisms. At one end, certain exceptions must be fatal, while at the other end a given exception acts as control of flow and is suppressed. A process to arrive somewhere on this spectrum is summarized by [Joe Armstrong's *let it crash* principal](https://softwareengineering.stackexchange.com/a/421837), which is also covered in Python's [exception documentation](https://docs.python.org/3/tutorial/errors.html#handling-exceptions):

> \[...\] it is good practice to be as specific as possible with the types of exceptions that we intend to handle, and to allow any unexpected exceptions to propagate on.

This experimental library extends Python's exception handling mechanism with two additional functionalities:

 - handling exceptions by module;
 - and exception class scraping from modules.

This library is under active development; it may require additional tuning and there are plans to add additional features.

## Usage notes
The main feature of `exceptlib` is handling exceptions by module with `ExceptionFrom`. For example:

```python
import re

from exceptlib import ExceptionFrom


try:
    re_obj = re.compile(7)
except ExceptionFrom(re) as e:
    print(f"re raised {e[0]}")
```

The malformed call to `re.compile` raises `TypeError`. The interpreter calls `ExceptionFrom` when trying to enter the `except` block. When called, `ExceptionFrom` compares its module arguments to those in the current exception's traceback to determine if any are involved. Since `re` raised, `ExceptionFrom` returns the tuple `(TypeError)` and causes that `except` block to enter.

Handling exceptions by module enables a wider degree of abstraction for exception handling. Specific advantages include:

 - enable certain retries and fallbacks for exceptions in production with less boilerplate;
 - enhance or simplify RCAs in test;
 - and generally widen the scope of `except` clauses.

In addition to its functionality as the predicate of the `except` statment, `exceptlib.ExceptionFrom` provides additional introspective functionality:

```python
...

# a tuple of distinct exceptions raised by the input modules
excs_raised_from: tuple = ExceptionFrom(re, urllib)
```

Calling `ExceptionFrom` when there is no current exception will direct it to scrape distinct exceptions from `raise` statements in the specified modules.

## Installation notes
This library is available through [GitHub](https://github.com/wfatherley/exceptlib).
django-migration-resolver 0.1.1
A Django package to track and resolve migration conflicts automatically.

# Django Migration Resolver

A Django package to automatically track and resolve migration conflicts between different branches.

## Installation
```sh
pip install django-migration-resolver
```

Add 'django_migration_resolver' to your INSTALLED_APPS

```python
INSTALLED_APPS = [
    ...
    'django_migration_resolver',
    ...
]
```

You must ensure that `django_migration_resolver` is placed before `django.contrib.auth` in the `INSTALLED_APPS` list.

## Usage

For each app in your project, create a file named `latest_migration.txt` in the app's directory. This file should contain the name of the latest migration that has been applied to the database.
**If this file is not created, this package will have no effect on the app.**

After it is created, it will automatically updated by the `makemigrations` command.

```sh
python manage.py makemigrations
```

To aid in resolving the conflicts, a new command `resolvemigrations` has been added. This command will automatically resolve the conflicts by updating dependencies of your new migrations to depend on the latest migrations of the other branches.

When you encounter git conflicts with the `latest_migration.txt` file, accept changes from the branch that has the latest migration applied to the database.
After that run the following command to resolve the multiple leaf nodes that are left.

```sh
python manage.py resolvemigrations
```
crl-datacube 0.1.140.dev12
Utilities for scaling geospatial analyses

# Create a Datacube for scaling geospatial analyses

See the examples directory and DataCube class for more information on the API.  

Modified from a [tutorial](https://earthmover.io/blog/serverless-datacube-pipeline) by Ryan Abernathy and the Earthmover team.

## Running
This package is intended to be distributed via pip, or with the attached Dockerfile.  It may need some updating to handle volume mounts for data, which can be done in the Makefile.  And I had some trouble publishing to PyPI from my local Mac M1, but it has been running fine on Linux.
tenint 1.0.4
Add your description here
Requires Python: >=3.12

# Tenable Integrations Framework Connector SDK (Tenint)

The goal of the tenint SDK is to provide a simple and reliable way to build the
common framework needed to build the connector so that the framework can load & run
the connector code.

Currently the code connector code is in a working state, however the commandline
interface is still being actively developed.  Currently supported with the `tenint`
command is the following commands:

```bash
# To initialize a project with an example connector.py & pyproject.toml file.
tenint init 

# To build the connector image for local launching within docker
tenint build
```

## Basics of a connector

Connectors require at a minimum a `Settings` object, the `Connector` object loaded
and pointed to you're main handler, and the app launcher in order to load the
interface.

At the absolute minimum, you would need the following:

```python
from tenint import Connector, Settings


class AppSettings(Settings):
	value: str


connector = Connector(settings=AppSettings)


@connector.job
def run_me(config: AppSettings):
	print(f"Hello World!  Launched with {config.value}")


if __name__ == '__main__':
	connector.app()
```

### Settings

The Settings class is a pydantic model that you can setup with the settings that you
wish to expose to the user within the TIF interface.  It will use the model to
generate a JSONSchema defintion that is used to paint that page.

## Running you code locally (no docker)

To run the code above, there are two commands exposed, `config` and `run`

```bash
python connector.py config

python connector.py run -j "{"value": "some string"}"
```
jaddek_tillo_sdk 0.1.5
The package for developers to interact with the Tillo APIv2
Requires Python: >=3.9

# Project Name

Library proving tools to access Tillo API.

## Table of Contents

1. [Installation](#installation)
2. [Usage](#usage)
3. [License](#license)

---

## Installation

Provide step-by-step instructions on how to install your project. Example for a Python project:

1. Clone the repository:
    ```bash
    git clone https://github.com/jaddek/tillo-sdk-python.git
    ```

2. Navigate to the project directory:
    ```bash
    cd tillo-sdk-python
    ```

3. Install dependencies:
    ```bash
    pip install -r requirements.txt
    ```
---

## Usage

### Example Usage:

```Examples in ./examples```

---

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
airscrapy 1.0.1
Scrapy contrib for Airflow
Requires Python: >=3.8

# Scrapy contrib for Airflow

## Installation

```shell
pip install airscrapy
```


## Airflow Operator

This operator runs Scrapy directly within the worker process
by invoking the Scrapy engine directly, eliminating the need for a separate process.


### Example

If the spider is structured as follows:

```python
import scrapy

class ExampleSpider(scrapy.Spider):
    name = "example"
    start_urls = [ "http://example.com" ]

    def parse(self, response):
        yield {
            'text': response.css('.info').extract_first()
        }
```

Here’s how you can create a DAG using the operator:

```python
from airflow import DAG
from airscrapy import ScrapyOperator
from myscrapers.spiders.example import ExampleSpider
import os

with DAG(
    dag_id="scrapers",
        # Add extra settings like credentials or token
        params={
            "extra_settings": {
                "CONCURRENT_REQUESTS": 2,
            }
        },
) as dag:
    # Import the shared settings file
    os.environ["SCRAPY_SETTINGS_MODULE"] = "myscrapers.settings"

    task = ScrapyOperator(spider=ExampleSpider)

if __name__ == "__main__":
    dag.test()
```

The `extra_settings` parameter is used to dynamically include elements
such as credentials or tokens, complementing the settings.py file.

Additionally, ensure you set the `SCRAPY_SETTINGS_MODULE` environment variable. 
Without it, Scrapy won't be able to locate the settings.

The DAG directory is organized as follows:

```
dags
|- myscrapers
   |- spiders
      |- __init__.py
      |- example.py
   |- __init__.py
   |- items.py
   |- middlewares.py
   |- pipelines.py
   |- settings.py
|- mydag.py
|- scrapy.cfg
```

This structure enables us to run the DAG in local debugging mode:

```python
python mydag.py
```


## Build for publish

Install dependencies:

```shell
pip install build twine
```

Build the package:

```shell
python -m build --outdir dist
```

And publish to PyPi:

```shell
python -m twine upload dist/*
```
padim-ad 0.0.3
Padim Anomaly Detection package for image anomaly detection and localization
Requires Python: >=3.9

## Introduction

This is an unofficial implementation of the paper: https://arxiv.org/abs/2011.08785
The aim of this project is to provide a good entry point of retraining the algorithm on a different
dataset with different needs.

## Get Started

install all the requirements
````commandline
pip install -r requirements.txt
````

For using the padim anomaly detector you should separate your dataset
into 3 chunks:
- Training
- Calibration
- Test

While training and calibration contain no anomalies, so are only "good" data
the testing dataset should contain some anomalies to check whether the algorithm
is properly working.

The training dataset is used to create the features that are used to setup the system. The
calibration dataset is for setting a threshold to compare against real anomalies.

First we need to instantiate an anomaly detector with:
```python
import numpy as np
from PIL import Image

from anomaly_detection_padim.PadimAD import PadimAnomalyDetector
from anomaly_detection_padim.config.DTO import PadimADConfig
from anomaly_detection_padim.data.transform import DataTransform
from anomaly_detection_padim.data.dataset import PadimDataset



path_train_data = r'<insert_train_path>'
path_calibration_data = r'<insert_calibration_path>'
anomaly_im_path = r'<path_to_anomalous_image>'

config = PadimADConfig(
        model_name='wide_resnet50_2',
        device='cuda',
        batch_size=8
    )
padim_ad = PadimAnomalyDetector(config=config)
train_dataset = PadimDataset(data_path=path_train_data, transform=DataTransform.get_train_transform())
padim_ad.train_anomaly_detection(dataset=train_dataset)
calibration_dataset = PadimDataset(data_path=path_calibration_data, transform=DataTransform.get_test_transform())

src_im = Image.open(anomaly_im_path).convert('RGB')
anom_score = padim_ad.detect_anomaly(
    im=src_im, 
    transform=DataTransform.get_test_transform(),
    normalize=True,
)
anomaly_im = Image.fromarray(anom_score.astype(np.uint8))
```

## How to use the GUI
this repository provides

## Roadmap

- [ ] Add Variable Image Sizes to the Padim Anomaly Detector
- [ ] Forward the variable image size to the GUI
- [ ] Add status message for training and calibration part
- [ ] rework home frame
- [ ] create api to serve the anomaly detection results
- [ ] add storing anomaly detectors (serializing to disk)