Skip to main content

CI CD

pynesthesia

Description

Pynesthesia is inspired by the condition "synesthesia," which refers to when one sense triggers other senses. An example of this would be seeing colors when hearing music or being able to taste words. Our python package reads a given file's SHA-256 hash and is able to turn it into colored text, a jingle (MP3), chiptune (WAV), a page of fortune cards (HTML), or a flower drawing (SVG).

PyPI Page and Install

Our package is on PyPI at pynesthesia

pip install pynesthesia 

How It Works

A SHA-256 hash consists of 32 numbers from 0 to 255. Each of our features use these numbers to determine qualities like tempo, notes, words, colors, and flower type.

Using Pynesthesia

Begin by generating a hash for a given file:

from pynesthesia import hashseed

seed = hashseed.generate_file_hash("/absolute/path/to/file.txt")
# Return the file's SHA-256 hash, or None if it cannot be read.

Colored text

from pynesthesia import colors

print(colors.colorize(seed))
# add a color for each character of the text in terminal

Jingle

from pathlib import Path
from pynesthesia import jingle, output

output.save_mp3(seed, Path("jingle.mp3"), measures=4)
# encode the generated electronic audio as an mp3

for block in jingle.audio_blocks(seed, measures=2):
   print(len(block))
# make one measure of audio at a time

Chiptune

from pynesthesia import chiptune

wav_bytes = chiptune.create_chiptune(seed, bpm=140, bars=4, wave_type="square")
# Turn a SHA-256 hash (64 hex characters) into WAV bytes. Same hash -> same song.

chiptune.save_chiptune(seed, "chiptune.wav", bars=8, wave_type="saw")
# Create the chiptune and write it to `path` as a .wav file.
# Refuses to replace a file that already exists (raises FileExistsError).

Fortune cards

from pynesthesia import htmlgen

cards = htmlgen.generate_cards(seed)
htmlgen.write_html(cards, "fortunes.html")

Flower

from pynesthesia import flower

species, style = flower.choose_flower(seed)
# turn a sha-256 hash into name of flower species and art style

svg_text = flower.render_flower_svg(seed)
# turn a sha-256 hash into flower drawn as svg text

flower.svg_to_file(seed, "flower.svg")
# save svg text of hash into a .svg file

Example program

examples/demo.py uses every function above. Run it from a clone of this repo with:

pipenv run python examples/demo.py

Run from Command Line

Make sure file paths are absolute. Output can be found in the 'pynesthesia_output' folder.

  • jingle: create a jingle from a file
    • --measures: number of measures (1-112, default 8)
pynesthesia jingle /absolute/path/to/file.txt --measures 4
  • chiptune: create a chiptune wav from a file
    • --bars: length in bars (1-32, default 4)
    • --wave: melody sound (square, triangle, saw or pulse; default square)
pynesthesia chiptune /absolute/path/to/file.txt --bars 8 --wave saw
  • html: Create a html fortune page from a file
pynesthesia html /absolute/path/to/file.txt
  • --colorize: text to print in color
pynesthesia --colorize 2cf24dba5fb0a30e

Configuration

Environment variables

pynesthesia doesn't use any environment variables.

Starter data

pynesthesia doesn't use a database or need any starter data.

Secret configuration files

There is no .env or other secret file.

Optional settings

Jingle tempos, scales, rhythms, sounds and length limits are in src/pynesthesia/jingleConfig.json.

Contributing

  • Set up:
git clone https://github.com/software-students-fall2026/python-package-exercise-nocturnal.git
cd python-package-exercise-nocturnal
pip install pipenv
pipenv install --dev
  • Test:
pipenv run python -m pytest --cov=pynesthesia --cov-report=term-missing --cov-fail-under=100
  • Build and check:
pipenv run python -m build
pipenv run twine check dist/*

Team

Metadata

Release files for pynesthesia 2026.11.11.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynesthesia 2026.11.11.18
File Size Uploaded Provenance Actions
pynesthesia-2026.11.11.18.tar.gz 36.7 kB With provenance Details for pynesthesia-2026.11.11.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pynesthesia 2026.11.11.18
File Interpreter ABI Platform Actions
pynesthesia-2026.11.11.18-py3-none-any.whl Python 3 none any Details for pynesthesia-2026.11.11.18-py3-none-any.whl

Total release size: 67.1 kB

Release files / pynesthesia-2026.11.11.18.tar.gz

Download URL pynesthesia-2026.11.11.18.tar.gz
Size 36.7 kB
Tags Source
SHA-256 checksum
How to use checksums
670ec170019a3e357cd90a682e4003d217152601f26e44cc6cd0c00eae5208ef
BLAKE2b-256 checksum
How to use checksums
9de89769850bbbf7c8bf17a87f74ea669efb1ad42ef2ac4b3da09664d3b10112
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / pynesthesia-2026.11.11.18-py3-none-any.whl

Download URL pynesthesia-2026.11.11.18-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
250bf2c6e4009eebca11aac84f364f04f4d7cdc43a8f6a1c4c6435ac7c6750e7
BLAKE2b-256 checksum
How to use checksums
3c5bfa97e91f5c404c1b3f5b38a7add0a0edce13f6ffcabffca6afac7eaeb6d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for pynesthesia 2026.11.11.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pynesthesia-2026.11.11.18.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page