semvec/pypi-packages huggingface dataset:
pycbnew 0.1.2
pycbnew is a Python module for creating printed circuit boards designs compatible with KiCad's pcbnew,
License: MIT
Requires Python: >=3.10
Keywords: kicad, pcb, pcbnew, hardware, automation

# pycbnew - Python Library for KiCad PCB Creation from Scratch

pycbnew is a Python library that provides a programmatic interface for creating and manipulating KiCad PCB designs.
pycbnew works without requiring KiCad to be installed.
It allows you to generate complex PCB layouts using Python code, making it easier to create parametric designs, 
automate repetitive tasks, and integrate PCB design into your Python workflows.

## Features

- Create KiCad PCB projects programmatically
- Define, place and manipulate PCB elements:
  - Footprints and pads
  - Nets and logical connections between footprint pads
  - Traces and vias
  - Zones and keepout areas
  - Graphic elements (lines, text, polygons)
- Geometric utilities for PCB design
- Support for S-expressions (KiCad's file format)
- Integration with KiCad CLI

## Installation

```bash
pip install pycbnew
```

## Project Structure

The library is organized into three main packages:

### Primitives

Basic building blocks for KiCad PCB elements:

- `kicad.py`: Base classes and utilities
- `project.py`: Project management
- `footprint.py`: Footprint and pad handling
- `layer.py`: Layer definitions
- `net.py`: Net management
- `segment.py`: Track segments and arcs
- `via.py`: Via definitions
- `zone.py`: Copper zones
- `gr_elements.py`: Graphic elements (text, lines, arcs, rectangles)
- `sexpressions.py`: some convenient S-expression utilities

### Composites

Higher-level constructs built from primitives:

- `abstract_path.py`: Base path class
- `gr_line_path.py`: Paths with graphic lines and arcs
- `segment_path.py`: Paths with track segments and arcs

### Utils

Utility functions and geometric classes:

- `geometry.py`: Point, Vector, Arc, Rectangle, Polygon classes
- `bernstein.py`: Bernstein polynomial functions

## Usage Example

```python
from pycbnew.primitives.project import KProject
from pycbnew.primitives.footprint import KFootprint
from pycbnew.primitives.net import KNet
from pycbnew.utils.geometry import Point

# Create a new KiCadObject project
project = KProject(filename="my_project.kicad_pcb", copper_layers=2)

# Create a net
gnd_net = KNet(1, "GND")
project.add(gnd_net)

# Add a footprint
footprint = KFootprint("Resistor_SMD:R_0805_2012Metric",
                       at=Point(100, 100),
                       side=KFootprint.Side.Front,
                       default_net=gnd_net)
project.add(footprint)

# Save the project
project.save()
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
byuimage 0.5.0
Simple Image processing library, used for teaching people how to program
License: MIT
Requires Python: <4.0,>=3.10

# BYU Simple Image Library

This is a simple library for interacting with images. It is used for
instruction in an introductory programming class, *CS 110 Introduction to
Programming*, and *CS 111 Introduction to Computer Science* at Brigham Young University.

The interface for this library is based off a [similar library
developed at Stanford
University](https://web.stanford.edu/class/cs106a/handouts_w2021/reference-image.html),
but was developed independently.

## Importing the Library

```python
from byuimage import Image
```

## Creating an image

```python
image = Image(filename)
```

- creates a new image from a filename

```python
image = Image.blank(width, height)
```

- creates a new, blank, white image with the given width and height

## Image properties

```python
image.height
```

- returns image height in pixels

```python
image.width
```

- returns image width in pixels

## Iterating over pixels in an image

```python
for pixel in image:
```

- loops over all pixels, from left to right and top to bottom

```python
for y in range(image.height):
    for x in range(image.width):
```

- loops over all pixels, from left to right and top to bottom

## Getting and setting pixels

```python
pixel = image.get_pixel(x,y)
```

- gets the pixel at the given (x,y) coordinate

```python
pixel.red = value
pixel.green = value
pixel.blue = value
```

- Sets the pixel red, green, or blue value to the given value

```python
pixel.color = (10, 10, 10)

pixel.color = otherpixel.color
```

- Sets the pixel red, green, and blue values to the given tuple or pixel color

## Showing and saving images

```python
image.show()
```

- shows an image

```python
image.save(filename)
```

- saves an image


## Credits

The sample image used here is a photo from Mike Newbry, using the Unsplash
License, and is available for free at [https://unsplash.com/photos/BTE-k0V19Gw](https://unsplash.com/photos/BTE-k0V19Gw)