Skip to main content

Convierte de un número o números a un grupo de caracteres y viceversa

Project description

Libreria Python / Secuenciador alfanumerico

Ejemplos

NumDiccionario(["A", "B", "C"], [0, 4], 5)
# ['AAAAA', 'AAAAB', 'AAAAC', 'AAABA', 'AAABB']
DiccionarioNum(["A", "B", "C"], ['AAAAA', 'AAAAC', 'AACAB'])
# [0, 2, 19]
DiccionarioPredeter("01")
# ["0", "1"]

Proyecto

GitHub

PyPI

Importar libreria

Instalar pip install SecuenciaAlfanumerica

# Importar todas las funciones
import SecuenciaAlfanumerica

Devolver diccionario predeterminado

from SecuenciaAlfanumerica import DiccionarioPreder

# Llamar libreria predeterminada
print(DiccionarioPredeter("AZ"))
# ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

Convertir secuencia numerica a una alfabetica

from SecuenciaAlfanumerica import NumDiccionario

# Convertir numerico en lista caracteres
Diccionario = ["A", "B", "C"] # Array
Devolver = [0, 4] # Devolver del 1 al 5
Grupo = 5 # Devolver con 5 caracteres
print(NumDiccionario(Diccionario, Devolver, Grupo))
# ['AAAAA', 'AAAAB', 'AAAAC', 'AAABA', 'AAABB']

Convertir secuencia alfabetica a una numerica

from SecuenciaAlfanumerica import DiccionarioNum

# Convertir lista a numerico
Diccionario = ["A", "B", "C"] # Diccionario de elementos
Resolver = ['AAAAA', 'AAAAC', 'AACAB'] # Elementos para resolver
print(DiccionarioNum(Diccionario, Resolver))
# [0, 2, 19]

Partes

Diccionario

Puedes llamar a un Diccionario predefinido o declararlo tu.

Declarar diccionario no definido: En vez de poner el identificador habria que inglesar un array ["a", "b", "c"]

Diccionarios predefinidos:

"01" - ["0", "1"]
"09" - ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
"AZ" - ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
"AñZ" - ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "Ñ", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
"az" - ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
"añz" - ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "ñ", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
"AZaz" - Diccionario = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
"AñZañz" - ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "Ñ", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "ñ", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
"azAZ" - ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
"añzAñZ" - ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "ñ", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "Ñ", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
"0Z" - ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
"0ñZ" - ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "Ñ", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
"0z" - ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
"0ñz" - ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "ñ", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
"A0" - ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
"Añ0" - ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "Ñ", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
"a0" - ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
"añ0" - ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "ñ", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]

Devolver

Es el conjunto de valores el cual se va a convertir.

[0, 4] - Devolver del 1 al 5

[4] - Devolver 4

Grupo

Cantidad minima de caracteres del grupo. Si no se define se devolvera la maxima a la que llegue.

5 - AAABA

1 - BA

Sin definir - BA

Resolver

Valores de los cuales se quiere saber la posicion.

['AAAAA', 'AAAAC', 'AACAB'] - [1, 3, 19]

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

SecuenciaAlfanumerica-2022.5.12.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file SecuenciaAlfanumerica-2022.5.12.tar.gz.

File metadata

File hashes

Hashes for SecuenciaAlfanumerica-2022.5.12.tar.gz
Algorithm Hash digest
SHA256 965872ba2884f7428a50fb24d0ba3567cfb3f4fd484345013abec2b1b05deff2
MD5 35a13579a12a215f50e4b42058ba4993
BLAKE2b-256 dbedf7c4f73bea140eaa61239f9dc87a30298b976094810c9a2a1afe6f9f8d29

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