Registry / web-framework / urlman

urlman

JSON →
library2.0.3pypypi✓ verified 85d ago

A Python library providing a declarative way to build URL patterns for Django models, similar to Django REST Framework's reverse patterns but more general. Current version 2.0.3, with a focus on simplicity and type safety. Release cadence is low; the library is in maintenance mode.

pip install urlman
INSTALL
IMPORT
SIG · URLMAN
U
urlman
web-frameworkpythonv2.0.3
Install
1.6s avg
Import
11ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.010s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Urls
from urlman import Urls
Main class for defining URL patterns

Define URL patterns as a nested Urls class on your Django model.

from django.db import models from urlman import Urls class MyModel(models.Model): name = models.CharField(max_length=100) class urls(Urls): detail = '/{self.pk}/' edit = '/{self.pk}/edit/' inst = MyModel(pk=1, name='test') print(inst.urls.detail) # '/1/' print(inst.urls.edit) # '/1/edit/'
Debug
Known issues
breakingIn version 2.0, the import path changed: previously you could import from urlman.urls directly. Now all public API is from 'urlman'.
fix
Update imports to 'from urlman import Urls'.
affects: <2.0
deprecatedThe 'name' argument when defining url patterns is deprecated; instead use explicit class methods or properties to generate named URLs.
fix
Remove 'name' argument; use the method name as the URL name.
affects: >=1.4, <2.1
gotchaDo NOT use the @property decorator on methods within the Urls class. urlman handles access like attributes automatically.
fix
Define methods that return strings; they are automatically treated as properties by urlman.
affects: all
Errors
Common errors & fixes
AttributeError: 'MyModel' object has no attribute 'urls'
The Urls class must be defined as a class attribute named 'urls' (lowercase) on the model.
fix
Define 'class urls(Urls):' inside your model, not 'class Urls(Urls):'.
TypeError: 'Urls' object is not callable
Trying to call inst.urls() instead of accessing it as an attribute.
fix
Use inst.urls.detail, not inst.urls().
Upgrade
Version history
2.0.3latest on PyPI · released Dec 23, 2025
Audit
Dependencies
djangorequiredRuntime dependency for model URL generation
Agent activity
32 hits · last 30 days
node
26
Meta
2
OpenAI (training)
1
Resources
urlman — pip install urlman · libregistry