# python-resource-container
A utility for managing Door43 Resource Containers. This follows the specification at http://resource-container.readthedocs.io/en/v0.2/.
## What is an RC?
A Resource Container (RC) is a modular/portable package of translation data.
## Installation
```
pip install resource_container
```
## Requirements
python 2.7+
## Usage
To get started you must first load an RC. Then you can read/write as needed.
```python
from resource_container import factory
rc = factory.load('/path/to/resource/container/dir')
# some attributes have dedicated properties
print(rc.type)
# other attributes are accessible from the manifest
print(rc.manifest['dublin_core']['rights'])
# read
chapter = rc.read_chunk('01', 'title')
# write
rc.write_chunk('front', 'title', 'Some book title')
```
### Multiple Projects
It is possible for an RC to contain multiple projects.
In such cases methods like writing and reading chunks will
throw an error telling you to specify the project.
```python
# assume rc contains the projects: gen, exo.
# this throws an error
rc.read_chunk('01', 'title')
# you can check how many projects are in an rc
rc.project_count
# this works as expected
chapter01title = rc.read_chunk('gen', '01', 'title')
```
### Strict Mode
By default the tool will operate in strict mode when loading an RC.
This will perform some checks to ensure the RC is valid.
If you need to look at an RC regardless of it's validity
you can disable strict mode by passing in `False`.
```python
rc = factory.load('/invalid/rc/dir', False)
# do stuff with the invalid rc
```
### Creating an RC
This tool also allows you to create a brand new RC.
> NOTE: currently you must specify the complete manifest manually.
> This might change a little in the future.
```python
manifest = {
...
}
rc = factory.create('/my/rc/dir/', manifest)
# do stuff with your new rc
```
Metadata
Release files for resource_container 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| resource_container-1.0.tar.gz | 6.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| resource_container-1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 16.2 kB
Release files / resource_container-1.0.tar.gz
| Download URL | resource_container-1.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7edb21248d0a65904ea5b433f2a86cd2e0c27757bf1e98186e720d60c30861a0
|
|
BLAKE2b-256 checksum How to use checksums |
13c1c716ac343ae02c1ecced1f1b8e7be1e3d9a6ca2d19406247fda8d3d1680a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / resource_container-1.0-py2.py3-none-any.whl
| Download URL | resource_container-1.0-py2.py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
26624b5d099873ba4c971131c4941872bb7b5e65e0bc26abcb3a853744c698e3
|
|
BLAKE2b-256 checksum How to use checksums |
e889fb83e5b4be7ef24f07b0772e3b0d8032c11552b55e37e6d28a63117e088c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for resource_container 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.