Skip to main content

Converte letras (A–Z) em índices numéricos (0–25)

Project description

converter_letra_numero

Biblioteca Python simples para converter letras (A–Z) em índices numéricos (0–25).


Pré-requisitos

  • Python 3.12 instalado
  • Virtual environment (recomendado) ou pip configurado
  • Windows 11, macOS ou Linux

Estrutura do Projeto

converter_letra_numero/        # pasta raiz do projeto
│
├── .venv/                   # ambiente virtual (PyCharm)
├── converter_letra_numero/  # pacote Python
│   ├── __init__.py
│   └── conversor.py         # função letra_para_numero()
│
├── README.md                # documentação do pacote
├── setup.py                 # configurações de build/install
├── requirements.txt         # dependências (vazio)
├── LICENSE                  # texto da licença MIT
└── tests/                   # testes automatizados (pytest)

Ainda pendente:

  • adicionar o arquivo LICENSE com texto MIT
  • criar a pasta tests/ com testes de pytest
  • (opcional) subpacote inverso/ para conversão número→letra

Instalando localmente

Abra o terminal (PowerShell/CMD no Windows, Terminal no macOS/Linux) na pasta raiz do projeto e execute:

# ativa virtualenv (opcional)
pip install -e .

Instala o pacote em modo editável, refletindo alterações imediatamente.


Exemplo de uso

from converter_letra_numero import letra_para_numero

print(letra_para_numero('C'))  # → 2

Submódulo inverso (opcional)

Se tiver criado converter_letra_numero/inverso/numero_para_letra.py, importe:

from converter_letra_numero import numero_para_letra

print(numero_para_letra(0))  # → 'A'

Testes (pytest)

  1. Instale o pytest:
    pip install pytest
    
  2. Crie tests/test_conversor.py:
    from converter_letra_numero import letra_para_numero
    
    def test_letra_A():
        assert letra_para_numero('A') == 0
    
    def test_letra_Z():
        assert letra_para_numero('Z') == 25
    
  3. Execute:
    pytest
    

Publicação no PyPI (opcional)

pip install build twine
python -m build
twine upload dist/*

Licença

Licenciado sob MIT. Veja o arquivo LICENSE para detalhes.


Compatível com: Python 3.12

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

converter_letra_numero-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

converter_letra_numero-0.1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file converter_letra_numero-0.1.0.tar.gz.

File metadata

  • Download URL: converter_letra_numero-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for converter_letra_numero-0.1.0.tar.gz
Algorithm Hash digest
SHA256 50620a3e1a344258d7290b208b2f78b18d6124c2e6707dd63194234819f4b277
MD5 46335cd346618722dc6c0ec10d3d3825
BLAKE2b-256 e5e955a54d17793620f696f6f463c4ec613e0d642abcba59a3821495f70d6250

See more details on using hashes here.

File details

Details for the file converter_letra_numero-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for converter_letra_numero-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cdb43cfcdc939d4097acfda7f17df8994d06cd4cfa707ec8404b2850faa3adc
MD5 ba18516edf5580c98ae947e7e205770f
BLAKE2b-256 047dd7a28dfd641aeba936a3cfccdca54733d6620204339ec98e8d36cdab57c3

See more details on using hashes here.

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