Skip to main content

Map strings sequencially

Project description

seqo

A Python package to map strings and numbers sequentially.
Easily generate and index custom base-N strings from a given character set.

Installation

Publish

Use the package manager pip to install seqo.

pip install seqo

Usage

from seqo import SequentialString

# Create an instance with a custom character set
ss = SequentialString("ABC")

# Check the character set
print(ss.charset)
# Output: ['A', 'B', 'C']

# Generate the first 10 strings in sequence
sequence = [ss.get(n) for n in range(10)]
print(sequence)
# Output: ['A', 'B', 'C', 'AA', 'AB', 'AC', 'BA', 'BB', 'BC', 'CA']

# Get the numeric index of a string
print(ss.index_of("CABA"))  # Output: 96

# Get the string at a specific index
print(ss.get(96))           # Output: 'CABA'

# Generate all strings between two values
start = "AA"
end = "CC"

strings_between = [
    ss.get(n)
    for n in range(ss.index_of(start), ss.index_of(end))
]

print(strings_between)
# Output: ['AB', 'AC', 'BA', 'BB', 'BC', 'CA', 'CB']

Contributing

Pull requests are welcome!
For major changes, please open an issue first to discuss what you'd like to change or add.

License

Distributed under the GNU GPLv3 License.
See LICENSE for more information.

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

seqo-0.1.2.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

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

seqo-0.1.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file seqo-0.1.2.tar.gz.

File metadata

  • Download URL: seqo-0.1.2.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for seqo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 155e1c0f900db119ca6cf911fa4d93de1693ab8b0c43ebd3b0e6e56f2e9943ae
MD5 3d6d6e615e6458fa0f37efbdfd42fc44
BLAKE2b-256 a2a6529e2e30a0c5f0ca5bd6ce2fe55a61349bf73531555ad25b0cb087ad41bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for seqo-0.1.2.tar.gz:

Publisher: deploy-pypi.yml on enzoconejero/seqo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file seqo-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: seqo-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for seqo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9a995f5e314b7b0beb038baac89da83c98b683a64725164620c09452e74ab915
MD5 30536b9dd0c39f731e4a00aeee0c739c
BLAKE2b-256 26020b7bf0aac647c85a7ed88d2980a712eb94973cb7a4c965f8f9db2ce4f3a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for seqo-0.1.2-py3-none-any.whl:

Publisher: deploy-pypi.yml on enzoconejero/seqo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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