Skip to main content

Process texts with the Receptiviti API

Project description

A Python package to process text with the Receptiviti API.

Installation

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

Release (version 0.1.0)

pip install receptiviti

Development (version 0.1.1)

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

Uploaded Source

Built Distribution

receptiviti-0.1.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for receptiviti-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3c3484bf05608036dabd751879b8e03414b3b4ac2fc02bfb29ff0646e171ac8
MD5 b82fa3566f30e438acfd880b2be05155
BLAKE2b-256 667791b85e541347f6a45162115ccd6bc7d5501f55e8932e814c2fd56035b827

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for receptiviti-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8420b448c178f1b97c10f05368cd6fe67bdfc704af5171615046979cf46fe5ee
MD5 8d1e529f732a5a2bb57d0e706b075993
BLAKE2b-256 bdba098f2097c874b72bb63f9d3fcb691bfeed84b7f030584f3caa9ee6ff0b82

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