Ë
    Ã?ÆiŸ  ã                  ó„   — d Z ddlmZ ddlZddl­ ddlmZmZ dZdd„Z	edœdd	„Z
efdd
„Zdd„Zefdd„Zefdd„Zdd„Zy)uY  NACE (classification for businesses in the European Union).

The NACE (nomenclature statistique des activitÃ©s Ã©conomiques dans la
CommunautÃ© europÃ©enne) is a 4-level (and up to 4 digit) code for classifying
economic activities. It is the European implementation of the UN
classification ISIC.

The first 4 digits are the same in all EU countries while additional levels
and digits may be vary between countries. This module validates the numbers
according to revision 2.1 (or 2.0 if that version is supplied) and based on
the registry as published by the EC.

More information:

* https://en.wikipedia.org/wiki/Statistical_Classification_of_Economic_Activities_in_the_European_Community
* https://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_NOM_DTL&StrNom=NACE_REV2&StrLanguageCode=EN&IntPcKey=&StrLayoutCode=HIERARCHIC
* https://showvoc.op.europa.eu/#/datasets/ESTAT_Statistical_Classification_of_Economic_Activities_in_the_European_Community_Rev._2.1._%28NACE_2.1%29/data

>>> validate('A')
'A'
>>> validate('62.01', revision='2.0')
'6201'
>>> get_label('62.10')
'Computer programming activities'
>>> validate('62.05')
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> validate('62059')  # does not validate country-specific numbers
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('6201')
'62.01'
é    )ÚannotationsN)Ú*)ÚcleanÚisdigitsz2.1c                ó6   — t        | d«      j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ú.)r   Ústrip©Únumbers    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/eu/nace.pyÚcompactr   E   s   € ô �˜Ó×#Ñ#Ó%Ð%ó    ©Úrevisionc               óð   — t        | «      } |j                  dd«      }ddlm} t	        «       }|j                  d|› �«      j                  | «      D ]"  \  }}|s
t        «       ‚|j                  |«       Œ$ |S )zALookup information about the specified NACE. This returns a dict.r   Ú r   )Únumdbzeu/nace)	r   ÚreplaceÚstdnumr   ÚdictÚgetÚinfoÚInvalidComponentÚupdate)r   r   r   r   Ú_nÚis         r   r   r   K   ss   € ä�V‹_€FØ×Ñ  RÓ(€HÝÜ‹6€DØ—‘˜W X JÐ/Ó0×5Ñ5°fÓ=ò ‰ˆˆAÙÜ"Ó$Ð$Ø�‰�A�ðð €Kr   c                ó"   — t        | |¬«      d   S )z)Lookup the category label for the number.r   Úlabel)r   ©r   r   s     r   Ú	get_labelr    X   s   € ä� Ô*¨7Ñ3Ð3r   c                óT   — t        j                  dt        d¬«       t        | d¬«      S )z&DEPRECATED: use `get_label()` instead.zlabel() has been to get_label()é   )Ú
stacklevelz2.0r   )ÚwarningsÚwarnÚDeprecationWarningr    r
   s    r   r   r   ]   s%   € ä‡M�MØ)Ü qõ*ô �V eÔ,Ð,r   c                óà   — t        | «      } t        | «      dkD  r
t        «       ‚t        | «      dk(  r| j                  «       st	        «       ‚t        | «      s
t	        «       ‚t        | |¬«       | S )únCheck if the number is a valid NACE. This checks the format and
    searches the registry to see if it exists.é   é   r   )r   ÚlenÚInvalidLengthÚisalphaÚInvalidFormatr   r   r   s     r   Úvalidater/   e   s]   € ô �V‹_€FÜ
ˆ6ƒ{�Q‚Ü‹oÐÜ	ˆV‹˜Ò	Ø�~‰~ÔÜ“/Ð!ä˜ÔÜ“/Ð!Üˆ˜(Õ#Ø€Mr   c                óN   — 	 t        t        | |¬«      «      S # t        $ r Y yw xY w)r(   r   F)Úboolr/   ÚValidationErrorr   s     r   Úis_validr3   u   s+   € ðÜ”H˜V¨hÔ7Ó8Ð8øÜò Ùðús   ‚ ˜	$£$c                óR   — dj                  | dd | dd f«      j                  d«      S )z8Reformat the number to the standard presentation format.r   Nr"   )Újoinr	   r
   s    r   Úformatr6   ~   s-   € à�8‰8�V˜B˜Q�Z ¨¨ Ð,Ó-×3Ñ3°CÓ8Ð8r   )r   ÚstrÚreturnr7   )r   r7   r   r7   r8   zdict[str, str])r   r7   r   r7   r8   r7   )r   r7   r   r7   r8   r1   )Ú__doc__Ú
__future__r   r$   Ústdnum.exceptionsÚstdnum.utilr   r   ÚDEFAULT_REVISIONr   r   r    r   r/   r3   r6   © r   r   ú<module>r?      sX   ðñ*"õH #ã ä ß 'ð Ð ó&ð *:õ 
ð ,<ô 4ó
-ð +;ô ð  +;ô ô9r   