semvec/pypi-packages huggingface dataset:
zksnake 0.1.0
zkSNARKs in Python
Requires Python: >=3.9
Keywords: cryptography, zksnark, zkp, r1cs, zk-snarks

# zksnake

Python implementation of zk-SNARKs (Zero Knowledge Succint Non-interactive ARgument of Knowledge) using simple symbolic expression.

<!-- prettier-ignore-start -->
> [!WARNING] 
**This library is intended to be used as proof of concept, prototyping, and educational purpose only. It is still unstable and not fully tested!**
<!-- prettier-ignore-end -->

## Proving schemes and curves

zksnake currently only supports [**Groth16**](https://eprint.iacr.org/2016/260.pdf) and [**PlonK**](https://eprint.iacr.org/2019/953.pdf) (original version) along with `BN254` and `BLS12-381` as supported curves. More proving schemes will be implemented in the future (hopefully).

## Usage

### Build constraints

```python
from zksnake.arithmetization import Var, ConstraintSystem, R1CS
from zksnake.constant import BN254_SCALAR_FIELD

x = Var('x')
y = Var('y')
v1 = Var('v1')

# prove the solution of y == x**3 + x + 5
# with x as input and y as output
cs = ConstraintSystem(['x'], ['y'], BN254_SCALAR_FIELD)
cs.add_constraint(v1 == x * x)
cs.add_constraint(y - 5 - x == v1 * x)
cs.set_public(y)

r1cs = R1CS(cs)
r1cs.compile()
```

Alternatively, you can import the constraints from [Circom](https://github.com/iden3/circom):

```python
from zksnake.arithmetization import R1CS

r1cs = R1CS.from_file("circuit.r1cs", "circuit.sym")
r1cs.compile()
```

Note that some constraints that are complex or expensive (require off-circuit computation) cannot be imported directly and require you to add "hint" function to pre-define the variable value (see [Example](./examples/example_bitify_circom.py)).

### Prove and verify proof

```python
from zksnake.groth16 import Groth16

# trusted setup
proof_system = Groth16(r1cs)
proof_system.setup()

# solve the constraint system
solution = r1cs.solve({'x': 3})
public_witness, private_witness = r1cs.generate_witness(solution)

# proving
proof = proof_system.prove(public_witness, private_witness)

# verification
assert proof_system.verify(proof, public_witness)
```

## Development

Requirements:

- python3 >= 3.9
- rust >= 1.77

Install maturin:

```
pip install maturin
```

Setup virtual environment:

```
python3 -m venv .venv
source .venv/bin/activate
```

Compile and install the editable module into venv:

```
maturin develop -r -E dev
```

Test the script:

```
python3 -m pytest tests
```
asynclogger 0.1.0
A lightweight and efficient asynchronous logging package for Python
Requires Python: >=3.6

# asynclogger

A lightweight and efficient asynchronous logging package for logging messages to the console and files. Supports colored output, dynamic log paths, and customizable log levels.

## Features

- **Asynchronous Logging**: Non-blocking logging for improved performance.
- **Console and File Logging**: Supports simultaneous logging to console and files.
- **Colored Output**: Differentiates log levels using colors for better readability.
- **Dynamic Log Paths**: Change log file paths dynamically without restarting.
- **Custom Log Levels**: Define and configure custom logging levels.

## Installation

```sh
pip install asynclogger
```

## Usage

### Basic Example

```python
from asynclogger import logger

logger.config('./logs/test.log', log_to_console=True)

async def main():
    await logger.info('Hello, world!')

if __name__ == '__main__':
    asyncio.run(main())
```

### Configuration Options

| Option         | Type    | Default         | Description |
|----------------|--------|---------------|-------------|
| `log_format`  | String | `{isoformat} {group} {level} {message}` | Format used for logging messages. |
| `output` | List | `["console"]` | Specifies outputs. |
| `colorize`  | Boolean or Dict | `True` | Takes either a boolean or a dict specifying a color for each log level. |
| `wrapper`     | Dict | `{}` | Contains a dict of wrapper functions for each format variable (isoformat, group, level ...). |

### Dynamic Log Path Change

```python
logger.config('./logs/%Y/%B/{safedate}.log', log_to_console=True)
```

### Custom Log Levels

```python
await logger.log('custom', 'This is a custom log level message')
```

### Coloring Output

```python
from colorist import Color

logger.config('./logs/test.log', log_to_console=True, colorize={
    'ERROR': Color.GREEN
})
```

### Wrapping Variables

```python
logger.config('./logs/test.log', log_to_console=True, wrapper={'group': lambda x: f'({x})'})
```

## License

MIT
grafanarmadillo 0.9.0
Simplify interacting with Grafana, with a focus on templating dashboards and alerts
Requires Python: <4,>=3.8

===============
Grafanarmadillo
===============

.. image:: https://github.com/lilatomic/grafanarmadillo/workflows/Tests/badge.svg?branch=main
    :target: https://github.com/lilatomic/grafanarmadillo/actions?workflow=Tests
    :alt: Test Status

.. image:: https://codecov.io/gh/lilatomic/grafanarmadillo/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/lilatomic/grafanarmadillo
    :alt: Codecov

.. image:: https://api.codeclimate.com/v1/badges/d96cc9a1841a819cd4f5/maintainability
   :target: https://codeclimate.com/github/lilatomic/grafanarmadillo/maintainability
   :alt: Maintainability

.. image:: https://img.shields.io/readthedocs/grafanarmadillo/latest?label=Read%20the%20Docs
    :target: https://grafanarmadillo.readthedocs.io/en/latest/index.html
    :alt: Read the Docs

Summary
=======

Grafanarmadillo simplifies interacting with Grafana, with a focus on templating dashboards.

Library
-------

Grafanarmadillo is a library that navigates the Grafana API. It has helpers to find dashboards and alerts; make and fill templates; and provision those filled templates. See `usage <https://github.com/lilatomic/grafanarmadillo/tree/main/docs/rst/usage.rst>`_ for samples.

Tools
-----

Grafanarmadillo is a tool that helps turn dashboards and alerts into templates and to turn templates into dashboards and alerts. See `cli <https://github.com/lilatomic/grafanarmadillo/tree/main/docs/rst/cli.rst>`_

Acknowledgments
===============

This repository was built from the `skeleton <https://github.com/joaomcteixeira/python-project-skeleton>`_ developed by Joao M. C. Teixeira (`webpage <https://bit.ly/joaomcteixeira>`_, `github <https://github.com/joaomcteixeira>`_)

Version
=======

v0.9.0