Skip to main content

Python package for RYTR

Project description

Rytr

Before using the library, create an enviroment variable with your Rytr API KEY.

Enviroment:
RYTR_API_KEY=XXXX

Install

pip install rytr

Languages

from rytr.languages import Languages

Languages.list()
>>> {'success': True, 'message': '', 'data': [...]}

Languages.find_by_slug('english')
>>> {'_id': '607adac76f8fe5000c1e636d', 'isDefault': True, 'name': '🇺🇸 English', 'slug': 'english', 'createdAt': '2021-04-17T12:55:35.150Z', 'isNew': False}

Tones

from rytr.tones import Tones

Tones.list()
>>> {'success': True, 'message': '', 'data': [...]}

Tones.find_by_slug('enthusiastic')
>>> {'_id': '6058213830f7b1000c1c4f8e', 'name': 'Enthusiastic', 'slug': 'enthusiastic', 'createdAt': '2021-03-22T04:46:48.471Z', 'isNew': False}

Use-case

from rytr.tones import Tones

UseCases.list()
>>> {'success': True, 'message': '', 'data': [...]}

UseCases.find_by_slug('question-answer-generator')
>>> {'_id': '611e2a98045b460ef10242ce', 'name': 'Question & Answer', 'key': 'questions-generator', ...}

UseCases.get(id="611e2a98045b460ef10242ce")
>>> {'success': True, 'message': '', 'data': {'_id': '611e2a98045b460ef10242ce', 'name': 'Question & Answer', 'slug': 'question-answer-generator' ... }}

Content

from rytr.usecases import UseCases
from rytr.content import Content

usecase = UseCases.get(id="607c7ae91ebe15000cbbc7af")
usecase = usecase["data"]

content = Content.generate(
    user_id=1,
    language_id="607adac76f8fe5000c1e636d",
    tone_id="6058213830f7b1000c1c4f8e",
    usecase_id=usecase["_id"],
    input_contexts={
        usecase["contextInputs"][0]["keyLabel"]: "I'M LOVIN 'IT",
        usecase["contextInputs"][1]["keyLabel"]: "I love the result."
    },
)
Props Description Optional Type
user_id Primary key for users database table. As a consumer of Rytr API, they assume you have a product/service with users no String
language_id Language ID no String
tone_id Tone ID no String
usecase_id Use Case ID no String
inputContexts Key/value dictionary no Object
format html / text yes String
creativityLevel default / none / low / medium / high / max yes String
variations 1 to 3 yes String

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

rytr-0.0.3.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

rytr-0.0.3-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file rytr-0.0.3.tar.gz.

File metadata

  • Download URL: rytr-0.0.3.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for rytr-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8d5f4e76dcee086b98112fa979a7e1487ac6db1d7330486bbdde4b854d65e008
MD5 0ab12d2e20f153234c97c0a1a74ead1e
BLAKE2b-256 509132e2a9833e6745da944b649cf780660474be7226799c1e8aa9d1b8e86add

See more details on using hashes here.

File details

Details for the file rytr-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: rytr-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for rytr-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 160ef4f7445b37abe500dbb6506a838de556daae62f54c4116a115075bd6bd07
MD5 ec7bb87f4b3af1a5229d0da9d82fedfc
BLAKE2b-256 f1b999467dd8e0f26deba2dbad324e285390ad45896c2082c7dc955118388114

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