Skip to main content

Process texts with the Receptiviti API

Project description

A Python package to process text with the Receptiviti API.

An R package is also available at Receptiviti/receptiviti-r.

Installation

If needed, download Python from python.org, then install the package with pip:

Release (version 0.2.2)

pip install receptiviti

Development

pip install git+https://github.com/receptiviti/receptiviti-python.git

And load the package in a Python console:

import receptiviti

Examples

# score a single text
single = receptiviti.request("a text to score")

# score multiple texts, and write results to a file
multi = receptiviti.request(["first text to score", "second text"], "filename.csv")

# score texts in separate files
## defaults to look for .txt files
file_results = receptiviti.request(directory = "./path/to/txt_folder")

## could be .csv
file_results = receptiviti.request(
  directory = "./path/to/csv_folder",
  text_column = "text", file_type = "csv"
)

# score texts in a single file
results = receptiviti.request("./path/to/file.csv", text_column = "text")

API Access

To access the API, you will need to load your key and secret, as found on your dashboard.

You can enter these as arguments in each function call, but by default they will be looked for in these environment variables:

RECEPTIVITI_KEY="32lettersandnumbers"
RECEPTIVITI_SECRET="56LettersAndNumbers"

You can store these in a .env file (in the current directory or ~/Documents) permanently, or set them temporarily:

import os
os.environ["RECEPTIVITI_KEY"]="32lettersandnumbers"
os.environ["RECEPTIVITI_SECRET"]="56LettersAndNumbers"

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

receptiviti-0.2.2.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

receptiviti-0.2.2-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file receptiviti-0.2.2.tar.gz.

File metadata

  • Download URL: receptiviti-0.2.2.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for receptiviti-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d0d3b698dde316aa37852e5e1960f8a2acc5ffdde2ade88ed0f6ff38d3eae5f6
MD5 3c891b081de9ed72671a4cab066b8e22
BLAKE2b-256 dc000211a764db639dbed822698c5c413fee6cbe796795a48f4234ed2e1fa4c8

See more details on using hashes here.

File details

Details for the file receptiviti-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: receptiviti-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for receptiviti-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6bad539ad6bdeb57e5723935a2d56b6a821b6e4e125104ef76b5c263ce4a77b
MD5 8e7b51d187e509745e423d198d3bd334
BLAKE2b-256 8a7541652f2ea8452b7a040787a539e12c60f6d7b0be810221b52d6a5d455ae6

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