Skip to content

Commit c9d7c0c

Browse files
make it a real package
1 parent 982f5d0 commit c9d7c0c

9 files changed

+51
-17
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
A command-line tool and library for converting ASCII-art diagrams into beautiful SVG circuit schematics.
1010

1111
Works with Python 3.10+. It uses the new `match` feature in a few places. If you need to run Schemascii on an older version of Python, feel free to fork it and send me a pull request.
12+
13+
<!-- https://realpython.com/pypi-publish-python-package/ -->

pyproject.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "schemascii"
7+
version = "0.1.0"
8+
description = "Render ASCII-art schematics to SVG"
9+
readme = "README.md"
10+
authors = [{ name = "dragoncoder047", email = "101021094+dragoncoder047@users.noreply.github.com" }]
11+
license = { file = "LICENSE" }
12+
classifiers = [
13+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
14+
"Programming Language :: Python",
15+
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3.10",
17+
"Intended Audience :: Science/Research",
18+
"Operating System :: OS Independent",
19+
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
20+
"Topic :: Scientific/Engineering",
21+
]
22+
keywords = ["schematic", "electronics", "circuit", "diagram"]
23+
requires-python = ">=3.10"
24+
25+
[project.urls]
26+
Homepage = "https://github.com/dragoncoder047/schemascii"
27+
28+
# [project.scripts]
29+
# schemascii = "schemascii.__init__:cli_main"

schemascii/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
from grid import Grid
2-
from components import find_all
3-
from edgemarks import find_edge_marks
4-
from components_render import render_component
5-
from wires import get_wires
6-
from utils import XML
1+
from .grid import Grid
2+
from .components import find_all
3+
from .edgemarks import find_edge_marks
4+
from .components_render import render_component
5+
from .wires import get_wires
6+
from .utils import XML
7+
8+
__version__ = "0.1.0"
79

810

911
def render(filename: str, text: str = None, **options) -> str:

schemascii/components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
2-
from grid import Grid
3-
from utils import Cbox, BOMData
2+
from .grid import Grid
3+
from .utils import Cbox, BOMData
44

55
SMALL_COMPONENT_OR_BOM = re.compile(r'#*([A-Z]+)(\d+|\.\w+)(:[^\s]+)?#*')
66

schemascii/components_render.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from typing import Callable
22
from cmath import phase, rect
33
from math import pi
4-
from utils import (Cbox, Terminal, BOMData, XML, Side,
4+
from .utils import (Cbox, Terminal, BOMData, XML, Side,
55
polylinegon, id_text, make_text_point,
66
bunch_o_lines, deep_transform, make_plus, make_variable)
7-
from metric import format_metric_unit
7+
from .metric import format_metric_unit
88

99
RENDERERS = {}
1010

schemascii/edgemarks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from itertools import chain
22
from types import FunctionType
3-
from utils import Cbox, Flag, Side, Terminal
4-
from grid import Grid
3+
from .utils import Cbox, Flag, Side, Terminal
4+
from .grid import Grid
55

66

77
def over_edges(box: Cbox) -> list:

schemascii/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from cmath import phase, rect
55
from types import GeneratorType
66
from typing import Callable
7-
from metric import format_metric_unit
7+
from .metric import format_metric_unit
88

99
Cbox = namedtuple('Cbox', 'p1 p2 type id')
1010
BOMData = namedtuple('BOMData', 'type id data')

schemascii/wires.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from cmath import phase
1+
from cmath import phase, rect
22
from math import pi
3-
from cmath import rect
4-
from grid import Grid
5-
from utils import iterate_line, merge_colinear, XML
3+
from .grid import Grid
4+
from .utils import iterate_line, merge_colinear, XML
65

76
# cSpell:ignore dydx
87

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from setuptools import setup
2+
setup()

0 commit comments

Comments
 (0)