Skip to main content

Python module to decompile AST to Python code

Project description

ast_decompiler is a module for generating Python code given an AST.

A usage example:

>> import ast
>> from ast_decompiler import decompile

>> decompile(ast.parse('(a + b) * c'))
(a + b) * c

This module supports Python 3.8 through 3.13.

Tests and formatting

To run the tests, install pytest in a virtual environment. Then, either use tox, or simply run pytest tests/.

The code is formatted with Black.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ast_decompiler-0.8.0.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

ast_decompiler-0.8.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file ast_decompiler-0.8.0.tar.gz.

File metadata

  • Download URL: ast_decompiler-0.8.0.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for ast_decompiler-0.8.0.tar.gz
Algorithm Hash digest
SHA256 daef5ca5c2bcb9ba7cf72a9308c7cd596c092d7201c0bbaf28947c721ce26441
MD5 c76918bf082db264b368faea49257244
BLAKE2b-256 90c4734659d4b1d254d3c85afbd0e47e1e3e9e95d17c5022e0a105a97e00c35c

See more details on using hashes here.

File details

Details for the file ast_decompiler-0.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ast_decompiler-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc2449883f153788d89b842967dbe871d6db14f53a178bf7ec601f393fe1e1bb
MD5 cbbeb9e2264fa17cf8abb69ea0c0c913
BLAKE2b-256 5d40d6b10d5911541867e8397ccb76a6fd9399eae78de967d1209e7ee7d1cf13

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page