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
LICENSEcom texto MIT- criar a pasta
tests/com testes depytest- (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)
- Instale o pytest:
pip install pytest
- 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
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50620a3e1a344258d7290b208b2f78b18d6124c2e6707dd63194234819f4b277
|
|
| MD5 |
46335cd346618722dc6c0ec10d3d3825
|
|
| BLAKE2b-256 |
e5e955a54d17793620f696f6f463c4ec613e0d642abcba59a3821495f70d6250
|
File details
Details for the file converter_letra_numero-0.1.0-py3-none-any.whl.
File metadata
- Download URL: converter_letra_numero-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cdb43cfcdc939d4097acfda7f17df8994d06cd4cfa707ec8404b2850faa3adc
|
|
| MD5 |
ba18516edf5580c98ae947e7e205770f
|
|
| BLAKE2b-256 |
047dd7a28dfd641aeba936a3cfccdca54733d6620204339ec98e8d36cdab57c3
|