You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-32Lines changed: 31 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ This library enables you to read and validate C2PA data in supported media files
12
12
13
13
Install from PyPI by entering this command:
14
14
15
-
```
15
+
```bash
16
16
pip install -U c2pa-python
17
17
```
18
18
@@ -22,17 +22,17 @@ This is a platform wheel built with Rust that works on Windows, macOS, and most
22
22
23
23
Determine what version you've got by entering this command:
24
24
25
-
```
25
+
```bash
26
26
pip list | grep c2pa-python
27
27
```
28
28
29
29
If the version shown is lower than the most recent version, then update by [reinstalling](#installation).
30
30
31
-
### Reinstalling
31
+
### Reinstalling
32
32
33
-
If you tried unsuccessfully to install this package before the [0.40 release](https://github.com/contentauth/c2pa-python/releases/tag/v0.4), then use this command to reinstall:
33
+
If you tried unsuccessfully to install this package before the [0.40 release](https://github.com/contentauth/c2pa-python/releases/tag/v0.4), then use this command to reinstall:
**Read and validate C2PA data from an asset file**
101
+
**Read and validate C2PA data from an asset file**
102
102
103
103
Use the `Reader` to read C2PA data from the specified asset file (see [supported file formats](#supported-file-formats)).
104
104
105
-
This examines the specified media file for C2PA data and generates a report of any data it finds. If there are validation errors, the report includes a `validation_status` field.
105
+
This examines the specified media file for C2PA data and generates a report of any data it finds. If there are validation errors, the report includes a `validation_status` field.
106
106
107
107
An asset file may contain many manifests in a manifest store. The most recent manifest is identified by the value of the `active_manifest` field in the manifests map. The manifests may contain binary resources such as thumbnails which can be retrieved with `resource_to_stream` or `resource_to_file` using the associated `identifier` field values and a `uri`.
It is best to [set up a virtual environment](https://virtualenv.pypa.io/en/latest/installation.html) for development and testing. To build from source on Linux, install `curl` and `rustup` then set up Python.
298
+
It is best to [set up a virtual environment](https://virtualenv.pypa.io/en/latest/installation.html) for development and testing.
299
+
300
+
To build from source on Linux, install `curl` and `rustup` then set up Python.
299
301
300
302
First update `apt` then (if needed) install `curl`:
301
303
302
-
```
304
+
```bash
303
305
apt update
304
306
apt install curl
305
307
```
306
308
307
309
Install Rust:
308
310
309
-
```
311
+
```bash
310
312
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
311
313
source"$HOME/.cargo/env"
312
314
```
313
315
314
316
Install Python, `pip`, and `venv`:
315
317
316
-
```
318
+
```bash
317
319
apt install python3
318
320
apt install pip
319
321
apt install python3.11-venv
320
322
python3 -m venv .venv
321
323
```
322
324
323
-
Build the wheel for your platform:
325
+
Build the wheel for your platform (from the root of the repository):
324
326
325
-
```
327
+
```bash
326
328
source .venv/bin/activate
327
-
pip install maturin
328
-
pip install uniffi-bindgen
329
+
pip install -r requirements.txt
329
330
python3 -m pip install build
330
331
pip install -U pytest
331
332
@@ -336,7 +337,7 @@ python3 -m build --wheel
336
337
337
338
Build using [manylinux](https://github.com/pypa/manylinux) by using a Docker image as follows:
338
339
339
-
```
340
+
```bash
340
341
docker run -it quay.io/pypa/manylinux_2_28_aarch64 bash
341
342
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
3. Setup the virtual environment with local changes: `maturin develop`
366
+
4. Run the tests: `pytest`
367
+
5. Deactivate the virtual environment: `deactivate`
368
368
369
369
For example:
370
370
371
-
```
371
+
```bash
372
372
source .venv/bin/activate
373
373
maturin develop
374
374
python3 tests/training.py
@@ -413,6 +413,7 @@ This release:
413
413
### Version 0.3.0
414
414
415
415
This release includes some breaking changes to align with future APIs:
416
+
416
417
-`C2paSignerInfo` moves the `alg` to the first parameter from the 3rd.
417
418
-`c2pa.verify_from_file_json` is now `c2pa.read_file`.
418
419
-`c2pa.ingredient_from_file_json` is now `c2pa.read_ingredient_file`.
@@ -430,5 +431,3 @@ Note that some components and dependent crates are licensed under different term
430
431
### Contributions and feedback
431
432
432
433
We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see [Contributing](https://github.com/contentauth/c2pa-python/blob/main/CONTRIBUTING.md).
0 commit comments