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
Project details
Release history Release notifications | RSS feed
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.2.tar.gz
(13.7 kB
view hashes)