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
This Package is contributed as part of the [Content Authenticity Initiative](https://contentauthenticity.org) and [released it to open source](https://contentauthenticity.org/blog/cai-releases-suite-of-open-source-tools-to-advance-digital-content-provenance) in Sept, 2023.
3
+
Python bindings for the C2PA Content Authenticity Initiative (CAI) library
4
4
5
-
## Key features
5
+
This library allows you to read and validate c2pa data in supported media files
6
+
And to add signed manifests to supported media files.
6
7
7
-
The SDK enables Python applications to:
8
-
* Create and sign C2PA manifests.
9
-
* Embed manifests in certain file formats.
10
-
* Parse and validate manifests found in certain file formats.
8
+
## Installation
11
9
12
-
## State of the project
10
+
```pip install c2pa-python```
13
11
14
-
This is a beta release (version 0.x.x) of the project. The minor version number (0.x.0) is incremented when there are breaking API changes, which may happen frequently.
12
+
## Usage
15
13
16
-
### Contributions and feedback
14
+
### Import
17
15
18
-
We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see [Contributing](https://github.com/contentauth/c2pa-js/blob/main/CONTRIBUTING.md).
This will examine any supported media file for c2pa data and generate
25
+
a JSON report of any data it finds. The report will include a validation_status field if any validation errors were found.
26
+
27
+
A media file may contain many manifests in a manifest store. The most recent manifest can be accessed by looking up the active_manifest field value in the manifests map.
28
+
29
+
If the optional data_dir is provided, any binary resources, such as thumbnails, icons and c2pa_data will be extracted into that directory.
30
+
These files will be referenced by the identifier fields in the manifest store report.
31
+
32
+
33
+
### Adding a Signed Manifest to a media file
34
+
The source is the media file which should receive new c2pa data.
35
+
The destination will have a copy of the source with the data added.
36
+
The manifest Json is a a JSON formatted string containing the data you want to add.
37
+
(see: [Generating SignerInfo](#generating-signerinfo) for how to construct SignerInfo)
38
+
The optional data_dir allows you to load resource files referenced from manifest_json identifiers.
39
+
When building your manifest, any files referenced by identifier fields will be loaded relative to this path.
40
+
This allows you to load thumbnails, icons and manifest data for ingredients
We use maturin for packaging Rust in Python. It can can be installed with pip
85
+
86
+
```pip install maturin```
87
+
88
+
You will also need to install uniffi bindgen and pytest for testing
19
89
20
-
## Requirements
90
+
``pip install uniffi_bindgen``
21
91
22
-
The SDK requires **Python version ???** or newer.
92
+
``pip install -U pytest``
23
93
24
-
### Supported platforms
94
+
``pip install <path to.whl> --force-reinstall``
25
95
26
-
The SDK has been tested on the following operating systems:
96
+
### Testing
97
+
98
+
```pytest```
27
99
28
-
* Windows (Intel only)
29
-
* MacOS (Intel and Apple silicon)
30
-
* Ubuntu Linux (64-bit Intel and ARM v8)
31
100
32
101
## Supported file formats
33
102
@@ -49,29 +118,14 @@ The SDK has been tested on the following operating systems:
49
118
|`wav`|`audio/x-wav`|
50
119
|`webp`|`image/webp`|
51
120
52
-
## Distribution
53
-
54
-
This package can be installed with :
55
-
56
-
```pip install c2pa-python```
57
-
58
-
## Building
59
-
60
-
This uses maturin for packaging Rust in Python. It can can be installed with pip
61
-
62
-
```pip install maturin```
63
-
64
-
You will also need to install uniffi bindgen and pytest for testing
65
-
66
-
``pip install uniffi_bindgen``
67
-
68
-
``pip install -U pytest``
69
-
70
-
``pip install <path to.whl> --force-reinstall``
71
-
72
121
## License
73
122
74
123
This package is distributed under the terms of both the [MIT license](https://github.com/contentauth/c2pa-rs/blob/main/LICENSE-MIT) and the [Apache License (Version 2.0)](https://github.com/contentauth/c2pa-rs/blob/main/LICENSE-APACHE).
75
124
76
125
Note that some components and dependent crates are licensed under different terms; please check the license terms for each crate and component for details.
77
126
127
+
### Contributions and feedback
128
+
129
+
We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see [Contributing](https://github.com/contentauth/c2pa-js/blob/main/CONTRIBUTING.md).
0 commit comments