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.1.1)

pip install receptiviti

Development (version 0.1.2)

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 (in the current directory or ~/Documents) file permanently:

# use the `dotenv` argument
receptiviti.status(dotenv=True)

# or load variables in beforehand
receptiviti.readin_env()

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.1.1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

receptiviti-0.1.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: receptiviti-0.1.1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.0

File hashes

Hashes for receptiviti-0.1.1.tar.gz
Algorithm Hash digest
SHA256 879070d50962605ba1ed4e975657d584e536d91ec3515918e8002f6be2b5c95a
MD5 941ac4ba3bf99941c1300522968dfad2
BLAKE2b-256 84f2b8e1b63f48f5a73d09fb5cd0d4252a715a4ddb3f7bcc03472723bd760ae7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for receptiviti-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17d02a13f7a00f34c4e26bf423e716a5adcc74504b31f77f31e20d65044c77d8
MD5 38b2cffcff0eaa7a0f92440fe8e41eca
BLAKE2b-256 06bd66108132ce6ed4eecba6cdd8e02e9d00891fbcd86d95901ebbfa6e6059f0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page