<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python/tests/test_cepis.py, branch v0.2.0</title>
<subtitle>Python client for the public CEP API
</subtitle>
<id>http://git.cep.is/python/atom?h=v0.2.0</id>
<link rel='self' href='http://git.cep.is/python/atom?h=v0.2.0'/>
<link rel='alternate' type='text/html' href='http://git.cep.is/python/'/>
<updated>2026-07-27T23:32:01Z</updated>
<entry>
<title>Carry the municipality of a CEP that does not exist</title>
<updated>2026-07-27T23:32:01Z</updated>
<author>
<name>Murilo Ijanc</name>
<email>murilo@ijanc.org</email>
</author>
<published>2026-07-27T23:32:01Z</published>
<link rel='alternate' type='text/html' href='http://git.cep.is/python/commit/?id=b199ae044f8f9cd4b745214cd5e5495f86b5eb54'/>
<id>urn:sha1:b199ae044f8f9cd4b745214cd5e5495f86b5eb54</id>
<content type='text'>
A failing CEP is rarely random: it is someone who knows the city and
guessed the number, and the classic guess is the -000 that 957
municipalities never received. The API now answers those 404s with a
faixa block naming the municipality the CEP would have belonged to, so
a caller can ask "did you mean somewhere in Areal/RJ?" instead of
"invalid CEP".

CEPNotFound gains faixa, defaulting to None. It stays a 404 and stays
an exception — the field is context for the error, never a demotion of
it into a partial success. Parsing is deliberately total: anything
missing, empty or malformed under faixa yields None, because turning a
clean not-found into a parse failure over an optional courtesy field
would be strictly worse than not having the field at all.

Faixa's cep_ini/cep_fim are the smallest and largest CEP that actually
exist there, not the bounds the Correios publish, and the range in
between is sparse — hence ceps, so the pair is never read as a list of
valid numbers.
</content>
</entry>
<entry>
<title>Initial import</title>
<updated>2026-07-26T14:44:58Z</updated>
<author>
<name>Murilo Ijanc</name>
<email>murilo@ijanc.org</email>
</author>
<published>2026-07-26T14:44:58Z</published>
<link rel='alternate' type='text/html' href='http://git.cep.is/python/commit/?id=a82459630e957a8d94c375394dae66734f3c90c1'/>
<id>urn:sha1:a82459630e957a8d94c375394dae66734f3c90c1</id>
<content type='text'>
</content>
</entry>
</feed>
