# py23

> py23 is a cli tool program that reads Python 2.x source code and applies a series of conversions to transform it into valid Python 3.x code.

Latest version **0.0.2** (published 2020-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install py23
pnpm add py23
yarn add py23
bun add py23
```

Provides the command `py23`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-11-27 |
| First published | 2020-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Igwaneza Bruce |
| Maintainers | knowbee |
| Keywords | python2 to python3, python2.x to python3.x, convert python2 to python3, convert python 2 to python 3, python 2, python 3 |

## Links

- npm: https://www.npmjs.com/package/py23
- Repository: https://github.com/knowbee/py23
- Homepage: https://github.com/knowbee/py23#readme
- Issues: https://github.com/knowbee/py23/issues
- npm.io page: https://npm.io/package/py23

## Dependencies (5)

- [ora](https://npm.io/package/ora.md) ^5.1.0
- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [clear](https://npm.io/package/clear.md) ^0.1.0
- [figlet](https://npm.io/package/figlet.md) ^1.5.0
- [commander](https://npm.io/package/commander.md) ^6.2.0

## Recent versions

- 0.0.2 (latest) — 2020-11-27
- 0.0.1 — 2020-11-27

## README

# py23

    Convert your Python 2.x source code into valid Python 3.x code.

## Installation

```
yarn global add py23
```

```
npm install -g py23
```

## Usage

```
  py23 --path ./

  // recursively convert all python 2.x source code files into python 3 valid code
```

```
  py23 --path ./app.py

  // converts all code in app.py file
```

## Supported conversions:

### print

`Converts the print statement to the print() function.`

### getcwdu

`Renames os.getcwdu() to os.getcwd().`

### raw_input

`Converts raw_input() to input().`

### raise

`Converts raise E, V to raise E(V)`

### has_key

`Changes dict.has_key(key) to key indict.`

### except

` Converts except X, T to except X as T.`

### unittest methods

| Python 2.x (From)           | Python 3.x (To)            |
| --------------------------- | -------------------------- |
| failUnlessEqual(a, b)       | assertEqual(a, b)          |
| assertEquals(a, b)          | assertEqual(a, b)          |
| failIfEqual(a, b)           | assertNotEqual(a, b)       |
| assertNotEquals(a, b)       | assertNotEqual(a, b)       |
| failUnless(a)               | assertTrue(a)              |
| assert\_(a)                 | assertTrue(a)              |
| failIf(a)                   | assertFalse(a)             |
| failUnlessRaises(exc, cal)  | assertRaises(exc, cal)     |
| failUnlessAlmostEqual(a, b) | assertAlmostEqual(a, b)    |
| assertAlmostEquals(a, b)    | assertAlmostEqual(a, b)    |
| failIfAlmostEqual(a, b)     | assertNotAlmostEqual(a, b) |
| assertNotAlmostEquals(a, b) | assertNotAlmostEqual(a, b) |

---
_Source: https://npm.io/package/py23 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
