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.6.1.tar.gz (339.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.6.1-py3-none-any.whl (201.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: archit_app-0.6.1.tar.gz
  • Upload date:
  • Size: 339.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.6.1.tar.gz
Algorithm Hash digest
SHA256 298a9b099edaaa7e46712bd8d26718c62cc0b45200c356397faaecf8fd4bb2ee
MD5 1d4bbbe6564643f4fda2ce6148cf10fe
BLAKE2b-256 f72a8aa9b82dbdd99f8a2092483c8aa123a9190b1df485ee922ec04a44d200c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for archit_app-0.6.1.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.6.1-py3-none-any.whl.

File metadata

  • Download URL: archit_app-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 201.0 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.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a9dc5a13df128d977005073e9f12dd1018cc89c1551f56ad5f93720d5147ca8
MD5 a1d1c125d53f3e6727e25423cd6434e6
BLAKE2b-256 4ebc74b43647f75c68b4d18a0147aace72f5d3a4d137f3ab15cfc2df7ccfbf87

See more details on using hashes here.

Provenance

The following attestation bundles were made for archit_app-0.6.1-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