Spreadsheet sorcerer
Generate CSV spreadsheets with various types of data.
Book ID,Title,Author,Genre,Publication Year,Available Copies 1,To Kill a Mockingbird,Harper Lee,Classic Fiction,1960,5 2,1984,George Orwell,Dystopian Fiction,1949,3 3,Pride and Prejudice,Jane Austen,Romance,1813,2 4,The Catcher in the Rye,J.D. Salinger,Coming-of-age Fiction,1951,4 5,The Hitchhiker's Guide to the Galaxy,Douglas Adams,Science Fiction,1979,1 6,The Da Vinci Code,Dan Brown,Mystery,2003,6 7,The Kite Runner,Khaled Hosseini,Historical Fiction,2003,3 8,The Alchemist,Paulo Coelho,Philosophical Fiction,1988,2 9,The Art of War,Sun Tzu,Non-fiction,5th century BC,1 10,The Fault in Our Stars,John Green,Young Adult Fiction,2012,4 11,Sapiens: A Brief History of Humankind,Yuval Noah Harari,Non-fiction,2011,2 12,Harry Potter and the Philosopher's Stone,J.K. Rowling,Fantasy,1997,7
API request
pythonimport anthropic client = anthropic.Anthropic( # defaults to os.environ.get("ANTHROPIC_API_KEY") api_key="my_api_key", ) message = client.messages.create( model="claude-3-opus-20240229", max_tokens=2000, temperature=0, system="Your task is to generate a CSV spreadsheet containing the specified type of data. The spreadsheet should be well-organized, with clear column headers and appropriate data types for each column. Ensure that the data is realistic, diverse, and formatted consistently. Include a minimum of 10 rows of data, not counting the header row.", messages=[{"role":"user","content":"Create a spreadsheet containing information about books in a library. Include the following columns: Book ID, Title, Author, Genre, Publication Year, and Available Copies. Ensure that the data covers a variety of genres and publication years, and that the number of available copies varies between books."}] ) print(message.content)