arscode

Crates.ioarscode
lib.rsarscode
version0.2.0
created_at2025-11-17 14:23:15.5084+00
updated_at2025-12-01 13:56:00.510139+00
descriptionWorking with the German Amtlicher Regionalschlüssel (ARS): parse, validate and manipulate ARS codes.
homepagehttps://github.com/demot/arscode
repositoryhttps://github.com/demot/arscode
max_upload_size
id1936854
size71,805
(demot)

documentation

https://docs.rs/arscode

README

arscode

arscode provides Rust types and utilities for working with the German Amtlicher Regionalschlüssel (ARS) — a twelve-digit hierarchical regional classification used to identify administrative regions in Germany from the country level down to municipalities.

Features

  • Parse and format ARS codes
  • Validate ARS code parts (state, district, county, admin associations, municipality)
  • Inspect and navigate administrative hierarchy (parent/child levels)
  • Convert between FederalState and ARSCode

Examples

use arscode::{ARSCode, ARSLevel, FederalState};

let municipality = ARSCode::new(5, 3, 15, 8, 4, 42).unwrap();
assert_eq!(municipality.level(), ARSLevel::MUNICIPALITY);
println!("{}", municipality);

let state: ARSCode = FederalState::Hamburg.into();
assert_eq!(state.level(), ARSLevel::STATE);

Reference

License This project is licensed under the MIT License.

Commit count: 0

cargo fmt