https://github.com/meunierd/ndcpy
A Python wrapper for NDC
https://github.com/meunierd/ndcpy
disk-image
Last synced: 2 months ago
JSON representation
A Python wrapper for NDC
- Host: GitHub
- URL: https://github.com/meunierd/ndcpy
- Owner: meunierd
- License: mit
- Created: 2017-11-05T23:55:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-07-05T01:20:29.000Z (almost 4 years ago)
- Last Synced: 2025-11-29T12:18:43.738Z (7 months ago)
- Topics: disk-image
- Language: Python
- Size: 588 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ndcpy
[](https://badge.fury.io/py/ndcpy)
[](https://travis-ci.org/meunierd/ndcpy)
[](https://ci.appveyor.com/project/meunierd/ndcpy/branch/master)
A Python wrapper for [ndc](http://euee.web.fc2.com/tool/nd.html#ndc)
leveraging native Python types.
## Supported Version
Currently the only supported version is `Ver.0 alpha06`.
## Installation
```bash
pip install ndcpy
```
## Usage
Assuming ndc is on your PATH you can simply:
```python
from ndc import NDC
ndc = NDC()
```
If ndc isn't on your PATH, you can provide a path to the client object:
```python
ndc = NDC('~/path/to/ndc')
```
You can list the files in an image:
```python
ndc.list('image.hdi')
ndc.list('image.hdi', 'SOME/PATH')
```
You can search for a file by a pattern:
```python
ndc.find('image.hdi', '*.EXE')
ndc.find('image.hdi', '*.EXE', 'SOME/PATH')
```
...which will return a single result or `None`.
Alternatively, you can use `find_all` which will return a (potentially empty)
list of results.
Extract a file from an image with the `get` method:
```python
ndc.get('image.hdi', 'path/to/file')
```
Or you can insert with `put`:
```python
ndc.put('image.hdi', 'local/path', 'image/path')
```
To create a directory, use `put_directory`:
```python
ndc.put_directory('image.hdi', 'DIRECTORYNAME', 'image/path')
```
and lastly to delete a file:
```python
ndc.delete('image.hdi', 'image/path/to/file')
```