An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# ndcpy

[![PyPI version](https://badge.fury.io/py/ndcpy.svg)](https://badge.fury.io/py/ndcpy)
[![Build Status](https://travis-ci.org/meunierd/ndcpy.svg?branch=master)](https://travis-ci.org/meunierd/ndcpy)
[![Build status](https://ci.appveyor.com/api/projects/status/57hqdm1va6ew33ti/branch/master?svg=true)](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')
```