Metadata-Version: 2.4
Name: inventree-electronic-symbols
Version: 1.0.0
Summary: Electronic schematic symbol icon pack for InvenTree
License-Expression: MIT
Project-URL: Repository, https://github.com/alangibson/inventree-electronic-symbols
Project-URL: Issues, https://github.com/alangibson/inventree-electronic-symbols/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE.symbols
License-File: LICENSE.tabler
License-File: NOTICE
Provides-Extra: test
Requires-Dist: Django>=4.2; extra == "test"
Requires-Dist: fonttools[woff]>=4.0; extra == "test"
Dynamic: license-file

# InvenTree Electronic Symbols

A self-contained InvenTree icon plugin containing **116 electronic schematic symbols**
from the Electronic Symbols pack by Chris Pikul, including common, IEC and IEEE
symbols. Fonts and metadata are bundled; no CDN or Node.js is needed to install.

## Features

- Common, IEC and IEEE symbols with searchable names and standards.
- Components including resistors, capacitors, diodes, transistors, switches and ICs.
- Native InvenTree icon picker integration using the `es` icon-pack prefix.
- Bundled WOFF2, WOFF and TTF fonts, served by your InvenTree instance.
- No plugin settings or database migrations.

## Requirements

- InvenTree 1.0 or newer with plugins enabled.
- Python 3.10 or newer, or the newer Python version required by your InvenTree release.
- Access to install Python packages in your InvenTree deployment.

## Install

Install into the **same Python environment as the InvenTree server and worker**.
You can install directly from this GitHub repository now. Git must be installed
on the server for this command:

```sh
python -m pip install 'git+https://github.com/alangibson/inventree-electronic-symbols.git@main'
```

In InvenTree's plugin installation form, use `inventree-electronic-symbols` as the
package name and the `git+https://github.com/alangibson/inventree-electronic-symbols.git@main`
URL as its source. This installs the current development branch; use a versioned
release for a fixed version when one is available.

### From a public GitHub release (once published)

Download the `.whl` file attached to release `v1.0.0` and install it:

```sh
python -m pip install ./inventree_electronic_symbols-1.0.0-py3-none-any.whl
```

Or install directly from its public download URL:

```sh
python -m pip install 'https://github.com/alangibson/inventree-electronic-symbols/releases/download/v1.0.0/inventree_electronic_symbols-1.0.0-py3-none-any.whl'
```

### From PyPI (once published)

After the maintainer publishes the package to PyPI, install it by name:

```sh
python -m pip install inventree-electronic-symbols==1.0.0
```

In InvenTree's plugin installation form, use package name
`inventree-electronic-symbols` and version `1.0.0`. Before PyPI publication, use
the public wheel URL as the package source instead.

### Docker persistence

Add the Git source URL above (or a published release's wheel URL) to the
deployment's persistent `plugins.txt`, one entry per line. Once published to
PyPI, you can instead use:

```text
inventree-electronic-symbols==1.0.0
```

Enable **Check Plugins on Startup** for deployments that support automatic
installation. Custom images or add-ons that do not process `plugins.txt` should
install the wheel or requirement in their Dockerfile. Both the web server and
worker need the package. Installing only inside a running container will not
survive its replacement. See [InvenTree's plugin installation guide](https://docs.inventree.org/en/stable/plugins/install/).

Restart InvenTree, open **Settings → Plugins**, and activate **Electronic Symbols**.

## Usage

1. Reload the browser after activating the plugin.
2. Edit an icon field, such as the icon for a part category or stock location.
3. Choose **Electronic Symbols** in the icon picker.
4. Search by component name or standard, such as `resistor`, `IEC`, or `IEEE`.
5. Select a symbol and save the record.

The plugin uses InvenTree's native
[IconPackMixin](https://docs.inventree.org/en/stable/plugins/mixins/icon/).
It requires no settings or database migrations. Stored icon identifiers look like
`es:resistor-iec-standard:outline`. Keep the plugin enabled while records use these
icons; removing it makes those icons unavailable.

## Troubleshooting

- **Plugin is missing:** confirm the package is installed in the Python environment
  used by InvenTree, plugins are enabled, and the server has been restarted.
- **Pack is missing from the picker:** activate the plugin and reload the browser.
- **Symbols appear blank:** plugin activation collects the bundled static assets.
  Check that `/static/plugins/electronic-symbols/fonts/` is served by your deployment
  (with your configured static URL prefix), then reload the plugin/static assets
  using your normal InvenTree process.

## Update the bundled artwork

Build the source pack first, then run from this repository:

```sh
python scripts/sync_assets.py ../electronic-symbols
```

Commit the metadata, fonts and attribution files together. Preserve upstream IDs
and Unicode assignments when updating so existing selections remain valid.

## Develop and package

```sh
python -m venv .venv
.venv/bin/pip install -e '.[test]' build
.venv/bin/python -m unittest discover -s tests -v
.venv/bin/python -m build
```

Tests check the plugin contract, static URLs, metadata and actual glyph coverage
in all three fonts. They use a small InvenTree host shim; deployment activation
and the live picker still require verification in an InvenTree instance.

## Publish a release

1. Push this project, including the bundled fonts and `.github/workflows/release.yml`,
   to a public GitHub repository named `inventree-electronic-symbols`.
2. Confirm the build workflow passes on the commit being released.
3. Keep the versions in `pyproject.toml` and
   `inventree_electronic_symbols/__init__.py` in sync.
4. Create and publish a GitHub release with tag `v1.0.0` (or `v` plus the new
   package version). The release workflow builds and checks the package, tests the
   installed wheel, and attaches the wheel and source archive to the release.
5. Share the release URL. Users do not need the source icon repository or Node.js.

For installation by package name, configure PyPI once:

1. In your PyPI account, register a pending Trusted Publisher for project
   `inventree-electronic-symbols` with your GitHub owner, repository name,
   workflow filename `release.yml`, and environment `pypi`. The package name must
   be available or already belong to you.
2. Create the `pypi` environment in the GitHub repository settings and set the
   repository Actions variable `PUBLISH_TO_PYPI` to `true`.
3. Publish a new GitHub release. The same validated distributions will also be
   uploaded to PyPI. This needs no stored PyPI API token. Manual workflow runs
   only build and test; they do not publish.

See [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/using-a-publisher/).
After the first successful publication, update this README's publication status
and make the package-name installation instructions the primary path.

## License

Plugin code: MIT (`LICENSE`). Artwork: copyright Chris Pikul, MIT
(`LICENSE.symbols`). The upstream font pipeline adapts Tabler Icons; see
`NOTICE` and `LICENSE.tabler` for attribution.
