Metadata-Version: 2.1
Name: update-netrc
Version: 0.1.1
Summary: A simple command line utility to update netrc credentials
Author-email: Maerteijn <maerteijn@gmail.com>
License: MIT
Project-URL: Repository, https://github.com/maerteijn/update-netrc
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Provides-Extra: dev
Requires-Dist: pip-tools~=7.3; extra == "dev"
Requires-Dist: ruff~=0.0.291; extra == "dev"
Requires-Dist: black~=23.9; extra == "dev"
Requires-Dist: pytest~=7.4; extra == "dev"
Requires-Dist: pytest-cov~=4.0; extra == "dev"
Requires-Dist: mypy~=1.5; extra == "dev"
Requires-Dist: twine~=4.0; extra == "dev"
Provides-Extra: dist
Requires-Dist: build~=1.0; extra == "dist"

# update-netrc
[![CI](https://github.com/maerteijn/update-netrc/actions/workflows/ci.yml/badge.svg)](https://github.com/maerteijn/update-netrc/actions/workflows/ci.yml)
![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)
![PyPI version](https://badge.fury.io/py/update-netrc.svg?dummy=unused)
![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)
![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)
![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)
![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)
![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
![No Dependencies](https://img.shields.io/badge/no%20dependencies-orange)

A simple command line utility to update netrc credentials.

## Usage
```bash

$  update-netrc --help
usage: update-netrc [-h] [--netrc-path NETRC_PATH] {update} ...

Default .netrc path: /Users/martijn/.netrc

positional arguments:
  {update}

options:
  -h, --help            show this help message and exit
  --netrc-path NETRC_PATH
                        Specify an alternative location for the used netrc file
```

```bash
$ update-netrc update --help
usage: update-netrc update [-h] [--login LOGIN] [--account ACCOUNT] [--password PASSWORD] host

positional arguments:
  host                 Selects the host (machine) you want to update

options:
  -h, --help           show this help message and exit
  --login LOGIN        Update the login of specified host
  --account ACCOUNT    Update the account of the specified host
  --password PASSWORD  Update the password of the specified host
```

## Examples

To update the password of the `localhost` machine:

```sh
$ update-netrc update localhost --password my-secret-password
```

To update the login of the `default` machine
```sh
$ update-netrc update default --login my-login
```

You can also add new entries, `--login` and `--password` are then required:
```sh
$ update-netrc update my-new-host --login my-login --password my-password
```

## Installation

```sh
pip install update-netrc
```

## Development setup

### First clone this repository
```
git clone https://github.com/maerteijn/update-netrc.git
```

### Install the python project
```bash
pyenv virtualenv update-netrc  # or your alternative to create a venv
pyenv activate update-netrc
make install
```

### Linting
`black`, `ruff` and `mypy` are installed and configured
```bash
make lint
```

### Formatting

`black` and `ruff` are configured
```bash
make format
```

### Test

Pytest with coverage is default enabled
```bash
make cov
```
