Skip to main content

A simple and user-friendly library for AI services

Project description

😺🚀 RoCat

RoCat is a Python library that provides a simple and user-friendly interface for integrating AI services into your projects. It supports various AI functionalities such as text summarization, YouTube transcript retrieval, audio transcription using OpenAI's Whisper, and web search using SerpAPI.

Installation

You can install RoCat using pip:

pip install rocat

Quick Start Guide

  1. Initialize RoCat: Begin by creating a default configuration and example code to get started.
rocat init

Default configuration file and example code created.
- config.ini
- rocat_example.py

This command creates a default configuration file (config.ini) and an example script (rocat_example.py).

  1. Edit Configuration: Open config.ini to add your API keys.
[API_KEYS]
openai = 
anthropic = 
serpapi =
naver_clovastudio =
naver_apigw =
  1. Write Your Code: You can refer to the rocat_example.py file for sample usage of the library.
# rocat_example.py
import rocat as rc

def main():
    # Initialize the library
    rc.initialize()
    
    # Write your code here.

if __name__ == "__main__":
    main()

Example Usage

Text Summarization

def main():
    rc.initialize()
    
    # Get text from a web page
    url = "https://www.example.com/sample-page"
    text = rc.get_web(url)
    
    # Summarize the text
    summary = rc.ai_summarize(text, 3)
    
    # Print the summarized text
    print("\nAI Summary Test:")
    print(summary)

if __name__ == "__main__":
    main()

YouTube Transcript Retrieval

def main():
    rc.initialize()
    
    # Get captions from a YouTube video
    video_url = "https://www.youtube.com/watch?v=example-video-id"
    transcript = rc.get_youtube(video_url)
    
    # Print the caption text
    print("\nYouTube Caption Test:")
    print(transcript)

if __name__ == "__main__":
    main()

Audio Transcription

def main():
    rc.initialize()
    
    # Convert an audio file to text
    audio_file = "path/to/example/audio.mp3"
    transcription = rc.get_whisper(audio_file)
    
    # Print the converted text
    print("\nWhisper Recognition:")
    print(transcription)

if __name__ == "__main__":
    main()

Web Search

def main():
    rc.initialize()
    
    # Get Google search results
    query = "python"
    search_results = rc.get_search(query)
    for result in search_results:
        print(f"Title: {result['title']}")
        print(f"Link: {result['link']}")
        print(f"Snippet: {result['snippet']}")

if __name__ == "__main__":
    main()

Features

  • Text summarization using AI
  • YouTube transcript retrieval
  • Audio transcription using OpenAI's Whisper
  • Web search using SerpAPI
  • File utilities for handling various file formats (txt, xls, xlsx, doc, docx, ppt, pptx, csv, pdf, hwp, hwpx)
  • Language model integration (GPT-3.5, GPT-4, Claude, Opus, Haiku, Sonnet)

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

Contact

If you have any questions or inquiries, please contact the author:

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

rocat-0.2.3.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

rocat-0.2.3-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file rocat-0.2.3.tar.gz.

File metadata

  • Download URL: rocat-0.2.3.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.2

File hashes

Hashes for rocat-0.2.3.tar.gz
Algorithm Hash digest
SHA256 25fe55a41dc09c9a8e1e4531c0d72d756a1c0b7ec20460ccd6bea7d897d82861
MD5 864c043dcb235e290cd54ba8fb1f5282
BLAKE2b-256 cbc6c5bf72f3013acfea4d4e093414725dc7547dc1d8304f9ee27d5661d56709

See more details on using hashes here.

File details

Details for the file rocat-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: rocat-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.2

File hashes

Hashes for rocat-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 652723154cfaf8a88254ed2ff03a35a4bfe3b5813e77041b36e7a629e3d720d1
MD5 30d64b5a1f4b86a872adb20c6dcaf22b
BLAKE2b-256 5d151c9708c8255941d01aef132f725cb54594e6380de1194e6a2701c6b87652

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