{"id":18984336,"url":"https://github.com/phidlarkson/ghana-nlp-python-library","last_synced_at":"2025-04-19T20:15:38.364Z","repository":{"id":260976636,"uuid":"864689794","full_name":"PhidLarkson/Ghana-NLP-Python-Library","owner":"PhidLarkson","description":"A Python library for interacting with the GhanaNLP APIs","archived":false,"fork":false,"pushed_at":"2024-11-04T00:58:59.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-16T17:29:45.766Z","etag":null,"topics":["africa","ghana-nlp","library","localisation","python"],"latest_commit_sha":null,"homepage":"https://translation.ghananlp.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhidLarkson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-28T22:32:01.000Z","updated_at":"2025-02-22T04:40:09.000Z","dependencies_parsed_at":"2024-11-04T01:27:49.685Z","dependency_job_id":"60c343ec-a306-4de8-b3c7-d9f043fb2c11","html_url":"https://github.com/PhidLarkson/Ghana-NLP-Python-Library","commit_stats":null,"previous_names":["phidlarkson/ghana-nlp-python-library"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhidLarkson%2FGhana-NLP-Python-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhidLarkson%2FGhana-NLP-Python-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhidLarkson%2FGhana-NLP-Python-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhidLarkson%2FGhana-NLP-Python-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhidLarkson","download_url":"https://codeload.github.com/PhidLarkson/Ghana-NLP-Python-Library/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249789702,"owners_count":21325855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["africa","ghana-nlp","library","localisation","python"],"created_at":"2024-11-08T16:20:52.176Z","updated_at":"2025-04-19T20:15:38.291Z","avatar_url":"https://github.com/PhidLarkson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ghana NLP Python Library \n\nThe **[Ghana NLP API](https://translation.ghananlp.org/) Python Library** provides an easy way to integrate local African language technologies into your Python projects. Whether you're looking for **translation**, **speech-to-text (STT)**, or **text-to-speech (TTS)**, this library makes it simple and intuitive to get started.\n\n## Features\n\n- **Translation**: Translate text between supported African languages (e.g., English to Twi).\n- **Speech-to-Text (STT)**: Convert audio files into text.\n- **Text-to-Speech (TTS)**: Generate natural-sounding speech from text in local languages.\n\n## Installation\n\nYou can install the library directly from PyPI:\n\n```bash\npip install ghana-nlp\n```\nAnd update to the lastest version\n\n```bash\npython -m pip install --upgrade ghana-nlp\n```\n\n## Usage\n\n### Initialize the Library\n\nFirst, import the library and set your API key:\n\n```python\nfrom ghana_nlp import GhanaNLP\n\nnlp = GhanaNLP(api_key=\"your_api_key_here\")\n```\n\n### Translation \n\nTranslate from English to Twi:\n\n```python\nresult = nlp.translate(\"Hello, how are you?\", language_pair=\"en-tw\")\nprint(result)  # Wo ho te sɛn?\n```\n\n### Speech-to-Text (STT)\n\nConvert an audio file (WAV format) to text:\n\n```python\nresult = nlp.stt(\"your_audio_file.wav\", language=\"tw\")\nprint(result) \n```\n\n### Text-to-Speech (TTS)\n\nConvert text to speech:\n\n```python\nresult = nlp.tts(\"Good morning\", lang=\"tw\")\nprint(result)  # audio binary, write a code to either serve to an audio file or play directly\n```\n\nCheck this repo to guide you with dealing with audio binary data: [EXAMPLE CODE](https://github.com/PhidLarkson/ghananlp-tts-python)\n\n\n## Supported Languages\n\nThe library supports multiple African languages, including:\n- **English (en)**\n- **Twi (tw)**\n- **Ga (gaa)**\n- **Ewe (ee)**\n- **Fante (fat)**\n- **Dagbani (dag)**, and more!\n\n## Error Handling\n\nThe library provides clear error messages if something goes wrong, such as incorrect language codes or invalid API requests. Check the `message` field in the response for details.\n\n## License\n\nThis library is licensed under the MIT License.\n\n---\n\nFor more details, check out the [documentation](https://pkwolffe.hashnode.dev/ghana-nlp-python-library) and start building cool stuff with **Ghana NLP**! 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphidlarkson%2Fghana-nlp-python-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphidlarkson%2Fghana-nlp-python-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphidlarkson%2Fghana-nlp-python-library/lists"}