Skip to main content

A general-purpose, extensible floorplan library for architects and developers.

Project description

archit-app

A general-purpose, extensible Python library for architectural floorplan design and analysis.

pip install archit-app

PyPI Python 3.11+ License: MIT


What's new in 0.5.0

  • Typed error hierarchy (ArchitError, OverlapError, OutOfBoundsError, ElementNotFoundError, GeometryError, SessionError) — structured code / element_id / hint.
  • Structured validate(building) in archit_app.analysis.validatelist[Finding] with severity, code, message, and a paste-ready fix_hint.
  • Opening.swing_arc() and Opening.glazing_lines() — door-swing and window-glazing geometry derived in the geometry layer; every renderer agrees.
  • Polished SVG / PDF exports — title block, scale bar, north arrow, room labels with areas, exterior dimension chains, dashed swing arcs, glazing lines, all in the brand palette (Void / Vellum / Blueprint / Datum).
  • Per-Level Shapely cache + new batch mutators (Level.add_openings, add_columns, add_beams, add_slabs, add_ramps, Building.add_levels, replace_levels).
  • Lazy heavy importsimport archit_app no longer pulls numpy or shapely at module load.

See CHANGELOG.md for the full list.


Overview

archit_app provides a clean, layered data model for working with architectural floorplans in Python. It supports non-Manhattan shapes, curved walls, multi-level buildings, and exports to SVG, DXF, GeoJSON, IFC, PNG, PDF, and a canonical JSON format — all built on immutable, type-safe objects.

Highlights

  • Geometry primitives with CRS taggingPoint2D, Vector2D, Polygon2D, Segment2D, Ray2D, Line2D, Polyline2D, Transform2D. Mixing spaces raises an error immediately.
  • CoordinateConverter — graph-based multi-CRS path-finding; Point2D.to(target, conv).
  • Full NURBS evaluator — Cox–de Boor; clamped_uniform() factory; exact conic sections via rational weights.
  • Architectural elements — walls (straight / arc / spline), rooms, openings, columns, staircases, slabs, ramps, elevators, beams, furniture (20 categories, 19 SVG symbols), annotations (text / dimension / section mark), structural grid, wall joining (miter_join, butt_join, join_walls).
  • Multi-level buildingsLevel → Building, with elevators and a structural grid attached at the building level.
  • Land parcel model — GPS coordinates, setbacks, buildable envelope, AI-agent context hook.
  • Spatial analysis — adjacency graph, egress, area validation, zoning compliance, daylighting, isovist.
  • Floorplan Agent Protocol v1.0.0 — versioned, strict-Pydantic inter-agent message layer (FloorplanSnapshot, AgentHandoff, MutationEnvelope, ProtocolReport).
  • I/O — JSON, SVG, GeoJSON, DXF round-trip, IFC 4.x round-trip, PNG raster, PDF (multi-page).
  • Layer registry, unit conversion, element transforms, structured validation, spatial index, plugin registry.
  • Immutable Pydantic models throughout — every "mutation" returns a new object.

Installation

pip install archit-app                                # core
pip install "archit-app[io]"                          # + DXF / SVG export
pip install "archit-app[ifc]"                         # + IFC 4.x export
pip install "archit-app[image]"                       # + PNG raster
pip install "archit-app[pdf]"                         # + multi-page PDF
pip install "archit-app[analysis]"                    # + graph analysis
pip install "archit-app[io,ifc,image,pdf,analysis]"   # everything

Requirements: Python 3.11+, pydantic ≥ 2.0, shapely ≥ 2.0, numpy ≥ 1.26.


Quick start

from archit_app import (
    Wall, Room, Level, Building, Opening, Column,
    Polygon2D, WORLD,
)

# Room + walls
boundary = Polygon2D.rectangle(0, 0, 6, 4, crs=WORLD)
living   = Room(boundary=boundary, name="Living Room", program="living")

walls = [
    Wall.straight(0, 4, 6, 4, thickness=0.2, height=3.0),
    Wall.straight(0, 0, 6, 0, thickness=0.2, height=3.0),
    Wall.straight(0, 0, 0, 4, thickness=0.2, height=3.0),
]
walls[2] = walls[2].add_opening(Opening.door(x=0, y=1.5, width=0.9, height=2.1))

# Level + Building
ground = (
    Level(index=0, elevation=0.0, floor_height=3.0, name="Ground Floor")
    .add_room(living)
    .add_walls(walls)
    .add_column(Column.rectangular(x=2.8, y=1.8, width=0.3, depth=0.3, height=3.0))
)
building = (
    Building()
    .with_metadata(name="My House", architect="A. Architect")
    .add_level(ground)
)

# Export
from archit_app.io.svg import save_level_svg
save_level_svg(ground, "ground_floor.svg", pixels_per_meter=50)

For the rest — DXF / PDF / IFC / NURBS / structural grid / agent protocol / spatial analysis / unit conversion — see docs/cookbook.md.


Coordinate system

Y-up, meters world coordinates — the standard for architecture. Screen and image layers are Y-down; the library handles the flip at export time.

Space Origin Y direction Unit Use
WORLD site datum up meters all architectural geometry
SCREEN top-left down pixels rendering, UI events
IMAGE top-left down pixels raster images, panoramas
WGS84 lat/lon up meters GIS / site georeferencing

Every Point2D and Vector2D carries its CRS. Arithmetic between mismatched spaces raises CRSMismatchError immediately.


Architecture

archit_app/
├── geometry/    Layer 1 — CRS, points, vectors, transforms, polygons, curves, lines
├── elements/    Layer 2 — Wall, Room, Opening, Column, Staircase, Slab, Ramp, Elevator,
│                          Beam, Furniture, annotations, wall_join utilities
├── building/    Layer 3 — Land, Level, Building, BuildingMetadata, StructuralGrid,
│                          Layer registry, ValidationReport, spatial_index
├── analysis/    Layer 6 — topology, circulation, area, compliance, daylighting,
│                          visibility, validate (structured findings)
├── protocol/    Layer 7 — Floorplan Agent Protocol v1.0.0
├── io/          Layer 5 — JSON, SVG, GeoJSON, DXF, IFC, PNG, PDF
├── core/                  Plugin/extension registry + typed error hierarchy
└── units.py               Unit conversion (`parse_dimension`, to/from feet/inches/mm/cm)

All models are immutable. Every "mutation" method returns a new object.


Documentation


Contributing

Contributions are welcome. See CONTRIBUTING for setup and coding standards.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

archit_app-0.7.0.tar.gz (351.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

archit_app-0.7.0-py3-none-any.whl (205.7 kB view details)

Uploaded Python 3

File details

Details for the file archit_app-0.7.0.tar.gz.

File metadata

  • Download URL: archit_app-0.7.0.tar.gz
  • Upload date:
  • Size: 351.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for archit_app-0.7.0.tar.gz
Algorithm Hash digest
SHA256 3ea6a2b27c1240a54fe8da62fbfcf8e520ce7acad774355ff923683ecd3e6330
MD5 b8f957865d2ac9ed81361a8532ef699d
BLAKE2b-256 ed5b43c9d8744c6556968a2d38b42be12100ec19d503e1be00f47572736b3228

See more details on using hashes here.

Provenance

The following attestation bundles were made for archit_app-0.7.0.tar.gz:

Publisher: release.yml on archit-app/archit-app

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file archit_app-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: archit_app-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 205.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for archit_app-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be25e4cfcc886ea6ccfbd9c2deeb513df895661a4e606e72dcdfdb11af45ec50
MD5 c8493e6903074562dc00980d0b94944c
BLAKE2b-256 4c89573994ef1d51b4599f8a1d942cbe240c6b78178da30c377e1601ed0ff007

See more details on using hashes here.

Provenance

The following attestation bundles were made for archit_app-0.7.0-py3-none-any.whl:

Publisher: release.yml on archit-app/archit-app

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page