pun-sort: package api
This commit is contained in:
23
flake.lock
generated
23
flake.lock
generated
@@ -16,6 +16,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1766870016,
|
||||||
|
"narHash": "sha256-fHmxAesa6XNqnIkcS6+nIHuEmgd/iZSP/VXxweiEuQw=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "5c2bc52fb9f8c264ed6c93bd20afa2ff5e763dce",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1665296151,
|
"lastModified": 1665296151,
|
||||||
"narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
|
"narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
|
||||||
@@ -33,17 +49,14 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": "nixpkgs",
|
||||||
"rust-overlay",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1677119371,
|
"lastModified": 1677119371,
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
description = "All kinds of stuff";
|
description = "All kinds of stuff";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||||
nixpkgs.follows = "rust-overlay/nixpkgs";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
@@ -52,6 +52,7 @@
|
|||||||
};
|
};
|
||||||
onomap = pkgs.haskellPackages.callCabal2nix "onomap" ./onomastics-ng { };
|
onomap = pkgs.haskellPackages.callCabal2nix "onomap" ./onomastics-ng { };
|
||||||
hesychius = hesychius/hesychius.txt;
|
hesychius = hesychius/hesychius.txt;
|
||||||
|
pun-sort-api = pkgs.callPackage ./pun-sort {};
|
||||||
alarm = pkgs.writers.writeDashBin "alarm" ''
|
alarm = pkgs.writers.writeDashBin "alarm" ''
|
||||||
set -efu
|
set -efu
|
||||||
export PATH=${
|
export PATH=${
|
||||||
|
|||||||
19
pun-sort/default.nix
Normal file
19
pun-sort/default.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{ writers, python3Packages }:
|
||||||
|
writers.writePython3Bin "pun_sort_api.py" {
|
||||||
|
flakeIgnore = [
|
||||||
|
"E203"
|
||||||
|
"E203"
|
||||||
|
"E226"
|
||||||
|
"E302"
|
||||||
|
"E305"
|
||||||
|
"E501"
|
||||||
|
"F841"
|
||||||
|
"W503"
|
||||||
|
];
|
||||||
|
libraries = [
|
||||||
|
python3Packages.fastapi
|
||||||
|
python3Packages.uvicorn
|
||||||
|
python3Packages.pydantic
|
||||||
|
python3Packages.pydantic-core
|
||||||
|
];
|
||||||
|
} ./sort_api.py
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
"""
|
||||||
FastAPI backend for phonetic word sorting
|
FastAPI backend for phonetic word sorting
|
||||||
Sorts words by their phonetic similarity using espeak-ng IPA transcription
|
Sorts words by their phonetic similarity using espeak-ng IPA transcription
|
||||||
@@ -6,7 +5,7 @@ Sorts words by their phonetic similarity using espeak-ng IPA transcription
|
|||||||
from fastapi import FastAPI, HTTPException
|
from fastapi import FastAPI, HTTPException
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from typing import List, Optional
|
from typing import List
|
||||||
import string
|
import string
|
||||||
import subprocess
|
import subprocess
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
|
|||||||
Reference in New Issue
Block a user