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 10 row CSV file with fictional book data for a library:
csvBook 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
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)