Metadata-Version: 2.4
Name: acorn-py
Version: 0.1.37
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering
License-File: LICENSE
Summary: Python bindings for acorn-lib crate
Keywords: research,automation
Author-email: Jason Wohlgemuth <wohlgemuthjh@ornl.gov>
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://code.ornl.gov/research-enablement/acorn-py/-/blob/main/CHANGELOG.md
Project-URL: Documentation, https://code.ornl.gov/research-enablement/acorn-py/-/blob/main/README.md
Project-URL: Issues, https://code.ornl.gov/research-enablement/acorn-py/-/issues
Project-URL: Source, https://code.ornl.gov/research-enablement/acorn-py

# acorn-py 🌱
[<img alt="gitlab" src="https://img.shields.io/badge/code.ornl.gov-research_enablement-00662C?style=for-the-badge&logo=gitlab&color=%2300662C" height="20">](https://research.ornl.gov)
[<img alt="PyPI" src="https://img.shields.io/pypi/v/acorn-py?style=for-the-badge&logo=python" height="20">](https://pypi.org/project/acorn-py/)
> Python bindings for the [acorn-lib](https://crates.io/crates/acorn-lib) crate

## So what? Big deal...who cares?
`acorn-py` provides Python bindings for selected APIs from ACORN's [acorn-lib](https://crates.io/crates/acorn-lib) and [acorn-schema](https://code.ornl.gov/research-enablement/acorn/-/tree/main/crates/acorn-schema) Rust crates. The Python package is independently versioned from ACORN.

## Installation
### Pixi
> ⭐ Recommended
```shell
pixi add acorn-py --pypi
```

### Poetry
```shell
poetry add acorn-py
```

### Pip
```shell
pip install acorn-py
```

## Example Usage
```python
from acorn.schema.validate import is_ark, is_arxiv, is_doi, is_orcid, is_ror

# Archival Resource Keys
assert is_ark("https://n2t.net/ark:12148/btv1b8449691v/f29")

# arXiv identifiers
assert is_arxiv("arXiv:2106.09685")

# Digital Object Identifiers
assert is_doi("10.11578/dc.20250604.1")

# Open Researcher and Contributor Identifiers
assert is_orcid("https://orcid.org/0000-0002-2057-9115")

# Research Organization Registry identifiers
assert is_ror("01qz5mb56")
```

## Compatibility

The distribution requires Python 3.10 or newer and uses a CPython stable-ABI wheel built with [Maturin](https://www.maturin.rs/). The initial standalone release pins `acorn-lib` and `acorn-schema` 0.1.76 to a public ACORN commit because `acorn-schema` is not yet available from crates.io. Binding versions do not track Rust crate versions.

`acorn-py` exposes a selected API rather than the entire ACORN library. See [the binding source](https://code.ornl.gov/research-enablement/acorn-py/-/blob/main/src/lib.rs) for the registered classes and functions.

## Development

Install [Pixi](https://pixi.sh), then run:

```shell
make check
make test
make wheel-smoke
```

The test matrix covers Python 3.10 and 3.13. `make wheel-smoke` builds the ABI3 wheel, installs it into a clean environment, imports `acorn`, and verifies package metadata.

## Publishing

See the [maintainer release checklist](CONTRIBUTING.md#releases) for the complete versioning, validation, tagging, and approval procedure.

GitLab CI always builds a source distribution and a manylinux2014 x86-64 wheel. With matching project runners, enable `ACORN_PY_ENABLE_LINUX_ARM64`, `ACORN_PY_ENABLE_MACOS_X86_64`, `ACORN_PY_ENABLE_MACOS_ARM64`, and `ACORN_PY_ENABLE_WINDOWS_X86_64` to add Linux ARM64, both macOS architectures, and Windows x86-64 wheels. Native macOS and Windows runners must provide Pixi; Linux uses the pinned official Maturin image.

Linux wheel builds use vendored OpenSSL so both manylinux architectures have the same supported cryptographic dependency instead of relying on the build image's system OpenSSL.

Issues in Python wrappers, packaging, or wheels belong in the [acorn-py issue tracker](https://code.ornl.gov/research-enablement/acorn-py/-/issues). Issues in the underlying Rust behavior belong in the [ACORN issue tracker](https://code.ornl.gov/research-enablement/acorn/-/issues).

## Linux note

On Linux, you may need to augment your `pixi.toml` with:
```toml
[system-requirements]
libc = { family = "glibc", version = "2.34" }
```

