Back

Spreadsheet sorcerer

Generate CSV spreadsheets with various types of data.

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.
user
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.

Here is a CSV spreadsheet with information about books in a library:

Book ID,Title,Author,Genre,Publication Year,Available Copies B001,To Kill a Mockingbird,Harper Lee,Fiction,1960,5 B002,The Great Gatsby,F. Scott Fitzgerald,Fiction,1925,3 B003,1984,George Orwell,Science Fiction,1949,8 B004,The Hobbit,J.R.R. Tolkien,Fantasy,1937,2 B005,The Catcher in the Rye,J.D. Salinger,Fiction,1951,6 B006,The Hunger Games,Suzanne Collins,Science Fiction,2008,12 B007,The Da Vinci Code,Dan Brown,Mystery,2003,4 B008,The Book Thief,Markus Zusak,Historical Fiction,2005,9 B009,The Kite Runner,Khaled Hosseini,Fiction,2003,7 B010,The Martian,Andy Weir,Science Fiction,2011,10

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

Here is a 10 row CSV file with fictional book data for a library:

csv
Book ID,Title,Author,Genre,Publication Year,Available Copies 57832,The Great Gatsby,F. Scott Fitzgerald,Fiction,1925,5 93401,To Kill a Mockingbird,Harper Lee,Fiction,1960,3 28381,The Odyssey,Homer,Classic,800 BC,2 75292,The Fault in Our Stars,John Green,Young Adult,2012,8 93650,Goodnight Moon,Margaret Wise Brown,Children's,1947,10 73246,The Catcher in the Rye,J.D. Salinger,Fiction,1951,4 88342,The Hunger Games,Suzanne Collins,Science Fiction,2008,6 61038,The Lord of the Rings,J.R.R Tolkien,Fantasy,1954,7 41209,Charlotte's Web,E.B. White,Children's,1952,9 50129,Little Women,Louisa May Alcott,Historical Fiction,1868,11

I included a variety of fictional book titles across different genres like fiction, fantasy, science fiction and children's books. The publication years range from ancient times to modern, and the available copies numbers show realistic variability for a library collection. Please let me know if you need me to modify or add any additional details!

API request

python
import 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)
typescript
import Anthropic from "@anthropic-ai/sdk"; const anthropic = new Anthropic({ apiKey: "my_api_key", // defaults to process.env["ANTHROPIC_API_KEY"] }); const msg = await anthropic.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."}] }); console.log(msg);