{ "info": { "author": "David Craven", "author_email": "david@craven.ch", "bugtrack_url": null, "classifiers": [], "description": "# Circuit Description Library\n\n## Getting started\n\n`joule_thief.py`\n```python\nfrom pycircuit.circuit import *\nfrom pycircuit.library import *\n\n\nDevice('BAT0805', 'BAT', '0805',\n Map('1', '+'),\n Map('2', '-'))\n\nPackage('TDK ACT45B', RectCrtyd(5.9, 3.4), DualPads(4, 2.5, radius=2.275),\n package_size=(5.9, 3.4), pad_size=(0.9, 1.35))\n\nDevice('TDK ACT45B', 'Transformer_1P_1S', 'TDK ACT45B',\n Map('1', 'L1.1'), Map('2', 'L2.1'), Map('3', 'L2.2'), Map('4', 'L1.2'))\n\n\n@circuit('TOP')\ndef top():\n vcc, gnd, n1, n2, n3 = nets('VCC GND n1 n2 n3')\n\n with Inst('TR1', 'Transformer_1P_1S') as tr1:\n tr1['L1', 'L1'] = n1, n2\n tr1['L2', 'L2'] = vcc, n3\n\n Inst('BAT1', 'BAT')['+', '-'] = vcc, gnd\n Inst('R1', 'R', '10k 0805')['~', '~'] = vcc, n1\n Inst('Q1', 'Q', 'npn sot23')['B', 'C', 'E'] = n2, n3, gnd\n Inst('LED1', 'D', 'led red 0805')['A', 'C'] = n3, gnd\n```\n\n`build.py`\n```python\nimport joule_thief\nfrom pycircuit.build import Builder\nfrom pycircuit.compiler import Compiler\nfrom pycircuit.library.design_rules import oshpark_4layer\nfrom placer import Placer\nfrom router import Router\nfrom pykicad.pcb import Zone\n\n\ndef compile(filein, fileout):\n compiler = Compiler()\n compiler.compile(filein, fileout)\n\n\ndef place(filein, fileout):\n placer = Placer()\n placer.place(filein, fileout)\n\n\ndef route(filein, fileout):\n router = Router()\n router.route(filein, fileout)\n\n\ndef post_process(pcb, kpcb):\n xmin, ymin, xmax, ymax = pcb.boundary()\n coords = [(xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)]\n\n zone = Zone(net_name='GND', layer='F.Cu',\n polygon=coords, clearance=0.3)\n\n kpcb.zones.append(zone)\n return kpcb\n\n\nif __name__ == '__main__':\n Builder('joule_thief', joule_thief.top, oshpark_4layer,\n compile, place, route, post_process).build()\n```\n\n`Makefile`\n```make\nPYCIRCUIT = ../..\n\nbuild:\n\tpython3 build.py\n\nview:\n\tnode $(PYCIRCUIT)/viewer/app.js 3000 net.dot.svg pcb.svg\n\nkicad:\n\tpcbnew *.kicad_pcb &>/dev/null &\n\nclean:\n\trm -f *.net *.hash *.dot *.svg *.place *.route *.pro *.kicad_pcb\n\n.PHONY: build view kicad clean\n```\n\n![Viewer](https://user-images.githubusercontent.com/741807/34364054-39b1362e-ea82-11e7-94b7-baf712e1aeab.png)\n![KiCad](https://user-images.githubusercontent.com/741807/34364057-43e7ee62-ea82-11e7-9787-84fefaecbc49.png)\n\n# License\nISC License\n\nCopyright (c) 2017, David Craven\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE\nOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dvc94ch/pycircuit", "keywords": "eda,cad,hdl,kicad", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "pycircuit", "package_url": "https://pypi.org/project/pycircuit/", "platform": "", "project_url": "https://pypi.org/project/pycircuit/", "project_urls": { "Homepage": "https://github.com/dvc94ch/pycircuit" }, "release_url": "https://pypi.org/project/pycircuit/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "Library for composing circuits and pcb layouts", "version": "0.0.2" }, "last_serial": 3443943, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "58df9400f65d0fcd0a6632ee47e5e1b9", "sha256": "e4ace2ceb27073893ba78050edfc1d2a325400b7c5d270da5a36bf4b481f30bf" }, "downloads": -1, "filename": "pycircuit-0.0.1.tar.gz", "has_sig": false, "md5_digest": "58df9400f65d0fcd0a6632ee47e5e1b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18980, "upload_time": "2017-07-10T22:03:06", "url": "https://files.pythonhosted.org/packages/58/b3/2820f2ab9b684814c286a24f63f0f3028f115baef71575beacab5254ec3f/pycircuit-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "789466c7d133c900079d2225b891d1f8", "sha256": "854eb499dd3dcb7e73d7114d8b4d03453c328d6f49b78b77047bc0a88c51f2c7" }, "downloads": -1, "filename": "pycircuit-0.0.2.tar.gz", "has_sig": false, "md5_digest": "789466c7d133c900079d2225b891d1f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20685, "upload_time": "2017-12-26T20:26:11", "url": "https://files.pythonhosted.org/packages/b6/b8/f91697a4ae53e9461df48b926466f36d424c4101c69b7ac865f1cb903374/pycircuit-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "789466c7d133c900079d2225b891d1f8", "sha256": "854eb499dd3dcb7e73d7114d8b4d03453c328d6f49b78b77047bc0a88c51f2c7" }, "downloads": -1, "filename": "pycircuit-0.0.2.tar.gz", "has_sig": false, "md5_digest": "789466c7d133c900079d2225b891d1f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20685, "upload_time": "2017-12-26T20:26:11", "url": "https://files.pythonhosted.org/packages/b6/b8/f91697a4ae53e9461df48b926466f36d424c4101c69b7ac865f1cb903374/pycircuit-0.0.2.tar.gz" } ] }