Metadata-Version: 2.4
Name: crate-ingredients
Version: 0.3.0
License-File: LICENSE
License-File: LICENSE.dependencies
Summary: Check ingredients of published Rust crates
Author-email: Fabio Valentini <decathorpe@gmail.com>
License: MIT
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: homepage, https://codeberg.org/decathorpe/ingredients
Project-URL: repository, https://codeberg.org/decathorpe/ingredients

# crate-ingredients

This package contains Python bindings for the [`ingredients`] crate, which implements checks for the
contents ("ingredients") of published Rust crates.

Both comparing contents of published crates to the state of the upstream project repository at a
specific point in time ("report" mode) and comparing two different, published versions of the same
crate with each other ("diff" mode) are implemented.

The Python API provided by `crate-ingredients` is intended to match the Rust API provided by the
`ingredients` crate, wherever possible and reasonable.

## `report` mode

Example using the Python API:

```python
from crate_ingredients import RegistryClient

registry = RegistryClient.crates_io(user_agent = "crate_ingredients")
crate = registry.download("syn", "2.0.111")

report = crate.report()
print(report)
```

## `diff` mode

Example using the Python API:

```python
from crate_ingredients import RegistryClient

registry = RegistryClient.crates_io(user_agent = "crate_ingredients")

old = registry.download("syn", "2.0.110")
new = registry.download("syn", "2.0.111")

diff = old.diff(new)
print(diff)
```

## Installation

From [PyPI]: `pip install crate-ingredients`

## External dependencies

**Building**:

* `cargo` (refer to `package.rust-version` in `Cargo.toml` for the minimum supported Rust version)
* `openssl` development headers must be available (for `reqwest/native-tls`)

**Runtime**:

* `cargo` must be available in `$PATH`
* `git` must be available in `$PATH` when calling `Crate.report`

## Funding

This project is funded through [NGI Zero Core](https://nlnet.nl/core), a fund established by
[NLnet](https://nlnet.nl) with financial support from the European Commission's
[Next Generation Internet](https://ngi.eu) program. Learn more at the
[NLnet project page](https://nlnet.nl/project/Rust-auditinfo).

[<img src="https://nlnet.nl/logo/banner.png" alt="NLnet foundation logo" width="20%" />](https://nlnet.nl)
[<img src="https://nlnet.nl/image/logos/NGI0_tag.svg" alt="NGI Zero Logo" width="20%" />](https://nlnet.nl/core)

[`ingredients`]: https://crates.io/crates/ingredients
[PyPI]: https://pypi.org/project/crate-ingredients/

