Skip to main content

A collection of utility modules to aid in the creation of Circuit Maker 2 builds.

Project description

cm2util

cm2util is a collection of utility modules to aid in the creation of Circuit Maker 2 builds. New modules and features are still being added.

Installation

Use the package manager pip to install cm2util.

pip install cm2util

Documentation

Image

from cm2util import Image

image = Image("path/to/image", size=50)

print(image.raw) #savecode
print(image.link) #dpaste link containing savecode

Memory

from cm2util import Memory

Circuit

from cm2util import Circuit

circuits = Circuit()

@circuits.build
def Mux(D0, D1, s):

    not1 = circuits.NOT(s)
    and1 = circuits.AND(D0, not1)
    and2 = circuits.AND(D1, s)
    or1 = circuits.OR(and1, and2)

    output = or1
    return output

saveCode = circuits.export(Mux)
print(saveCode)

Compress

from cm2util import Compress

dpaste_link = Compress(saveCode)
print(dpaste_link)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

cm2util-0.0.1.tar.gz (13.6 kB view hashes)

Uploaded Source

Built Distribution

cm2util-0.0.1-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

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