Skip to main content

PHP compact for Python

Project description

Compact

PHP compact() ported to Python
(Please use this for development only!)

from compact import compact

a = 1
b = 2
c = compact(a, 'b')
# -> {'a': 1, 'b': 2}

compact(c, 
        d, 
        dirty=True)
# -> {c: {'a': 1, 'b': 2}, d: None}

Only works in scripts, not interactive use (the program needs to be able to read the source files)

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

compact-0.1.2.tar.gz (2.2 kB view hashes)

Uploaded Source

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