Skip to main content

Persai

Persai Logo

Introduction 🔎

Persai is a Python package designed to analyze Twitter (X) posts and provide insights into the Big Five personality traits (Openness, Conscientiousness, Extraversion, Agreeableness, Neuroticism). This tool leverages data from your Twitter archive to offer a unique perspective on your social media presence. 🐦

Diagram

Visit our website for more information and documentation

Installation 🛠️

Install Persai easily using pip:

pip install persai

How to Use 💡

Follow these steps to analyze your Twitter (X) data using Persai:

  1. Export Your Twitter Data:

  2. Prepare Your Data:

    • Locate the twitter.js file in your downloaded Twitter (X) data.
    • Save this file in the directory where you plan to run the Persai package.
  3. Set Your OpenAI Key:

    • Assign your OpenAI key to a variable. For security reasons, avoid hardcoding the key in your script. Instead, consider using environment variables or other secure methods.
  4. Run Persai:

    • Use the following Python code to perform the Big Five analysis:
     from persai import big_five
    
     openai_key = "your_openai_key_here"
     data = "twitter.js"
     result = big_five(data, openai_key)
     print(result)
    

Sample Output 📈

After running the script, you'll receive a dictionary with the analysis results. It will look something like this:

{
  "openness": "high",
  "conscientiousness": "low",
  "extraversion": "low",
  "agreeableness": "low",
  "neuroticism": "low"
}

These results provide a snapshot of the personality traits expressed in your Twitter (X) posts.

Contributing

Feel free to contribute to the project or suggest improvements! 🌟

Acknowledgments 👏

This project is a reimplementation of the ideas and methodologies presented in the paper Is ChatGPT a Good Personality Recognizer? A Preliminary Study. Thank you for providing this research.

License

This project is licensed under the MIT License.

Metadata

Release files for persai 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for persai 0.0.5
File Size Uploaded Provenance Actions
persai-0.0.5.tar.gz 4.6 kB Without provenance Details for persai-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for persai 0.0.5
File Interpreter ABI Platform Actions
persai-0.0.5-py3-none-any.whl Python 3 none any Details for persai-0.0.5-py3-none-any.whl

Total release size: 10.1 kB

Release files / persai-0.0.5.tar.gz

Download URL persai-0.0.5.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6f036037ac837f82dfbdf65d9f9a2ab13f888b979ecb4c1d455eefe16b5213c3
BLAKE2b-256 checksum
How to use checksums
5c8087872d2065d13753b518fa44ce46e516184b2b58e65d2f8dfc8dd3a17856
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / persai-0.0.5-py3-none-any.whl

Download URL persai-0.0.5-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f219b2d88b32cb553c8c6a543c38df855b1f2b47af5fb7ad93529b916a4fa82
BLAKE2b-256 checksum
How to use checksums
dcd2dc52ab40367b1ac27f003290642c1998d698aba44708a2cc1841a6577059
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for persai 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page